Forum Discussion
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
- JudyNolletSuper Hero
What you have is a custom-menu slide. This post has instructions and a demo file that show how to program a custom-menu slide so that the user has to view all of the topics. https://community.articulate.com/discussions/discuss/tip-create-a-custom-menu-slide/1030699
The same programming would work for your situation. Track each question with a T/F variable. Allow the user to advance to the final slide when all of the variables = True.
- SarahSextonCommunity Member
Judy, It was working and now it's not. Uggh. Can you tell why the variables are not working. I tried isolating each of the variables one at a time to see if they would trigger the next button and none of them did. Please help
- JudyNolletSuper 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:
- SarahSextonCommunity 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.
- JudyNolletSuper 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.