Forum Discussion

DeepikaBatra-1a's avatar
DeepikaBatra-1a
Community Member
4 months ago

Number variables for checking button clicks/ visiting layers

Hi, I am trying out a number variable (default value 0) and adding 1 to the variable when the user clicks the button to ensure all the buttons (4) are clicked before moving on. Also the next button is disabled and is enabled when the count of the variable is >= 4 (in case the user clicks the button more than once or revisits). However, it is not working. I have even tried to check the count of variable using variable reference and it surely reaches 4 but the next button is not enabled still. I also added a binary variable to the number variable which doesn't work either. Is this a right approach or shall I try using a binary variable for each button and mark it true when the layer is visited?

  • Because the user is visiting layers (and not different slides) when they click the buttons, you could simply enable the NEXT button when the STATE of all the buttons = Visited. 

    Keep in mind that the NEXT button would be enabled as soon as the last button is clicked. Thus, if the layer has audio or video, the user could skip it. One way to prevent that is to use Dialog layers, because those cover the Player. Otherwise, you could use an alternate method to enable the NEXT button when the layer timelines are all completed. 

    You'll also want to add a condition to the trigger that disables NEXT when the timeline starts, because you don't want that to run if the user revisits the slide after completing the interaction.

    Here's more info: https://community.articulate.com/discussions/articulate-storyline/tip-controlling-the-next-button-101 

  • AndrewHanley's avatar
    AndrewHanley
    Community Member

    Hi Deepika,

    It sounds like you have nearly done everything correct. But I suspect there is one thing making this not work correctly for you.

    When we set up our trigger, its tempting to use the "when user clicks" option.... however, for this sort of interaction, you actually will be better using the "STATE" option.

    First, ensure all your buttons have a VISITED state.

    Then simply delete all your individual button triggers, and replace them with a single trigger that says...

    "ADJUST VARIABLE add value 1 to <numberVariableName> when the STATE of at least one of <select all your buttons from the dropdown list> is VISITED"

    NOTE - the "at least one of" part of the trigger is important.

    And that should now count up properly and you can use the count to unlock your Next button easily with the "Change State of.... when variable changes if its value = 4" trigger.

    Hope that helps! :)

  • Because the user is visiting layers (and not different slides) when they click the buttons, you could simply enable the NEXT button when the STATE of all the buttons = Visited. 

    Keep in mind that the NEXT button would be enabled as soon as the last button is clicked. Thus, if the layer has audio or video, the user could skip it. One way to prevent that is to use Dialog layers, because those cover the Player. Otherwise, you could use an alternate method to enable the NEXT button when the layer timelines are all completed. 

    You'll also want to add a condition to the trigger that disables NEXT when the timeline starts, because you don't want that to run if the user revisits the slide after completing the interaction.

    Here's more info: https://community.articulate.com/discussions/articulate-storyline/tip-controlling-the-next-button-101