Forum Discussion

SarahSexton's avatar
SarahSexton
Community Member
7 months ago

Branching activity with variables

I am trying to create a short activity/quiz where the user can answer the questions in any order they want, and after the last question is answered, they advance to a "finished" slide. The correctness of the answer in this case does not matter, as we will use this template to build additional activities that work the same way and may not have one clear answer. 

I tried setting it up with just triggers, but the user gets sent to the finished slide after clicking on the last number without going to the question first. I then built variables so that all the numbers defaulted to false and became true when the user got to the question slide for that answer (e.g., number 1 became true when user clicked on the arrow on either the correct or incorrect layers on slide 1.2). It didn't work, but it really seemed like it should have. Then I tried making the variable attached to clicking on the number. Still not working. Then I tried making the result of the variable change a layer on 1.1 that allows the user to advance to the finish slide. Still no go. I can't figure out what I am doing wrong. Is there a more elegant way to program this activity.

5 Replies

      • JudyNollet's avatar
        JudyNollet
        Super Hero

        Here is one of your triggers for changing a variable to True: 

        Trigger order matters. Storyline can't run a trigger if it has already jumped to another slide.

        Move all of your adjust-variable triggers so they appear before the jump-to-slide triggers, and the programming should work. 

        By the way, whenever you're working with variables, troubleshooting is easier if you temporarily insert the variable reference(s) on the slide. That let's you see if the variable changes as expected. For example, if you had variable references on the custom-menu slide, you would have see that they weren't changing. Here's more info about working with variables: 

  • SarahSexton's avatar
    SarahSexton
    Community Member

    Thank you so much. By the way, this solution worked until I set an else statement. I with the else statement it would work, but worked without it.

    • JudyNollet's avatar
      JudyNollet
      Super Hero

      Interesting. Else statements usually work great, and they save the time and effort of creating a separate trigger. 

      FYI: The post was about the built-in Next button. If you're using a custom button on the slide, you could just set its Initial State to Disabled—no trigger needed.