Forum Discussion

SarahEnrique110's avatar
SarahEnrique110
Community Member
26 days ago
Solved

Help using variables for scenario

I'm working on a training with a set of simple scenarios. We want to give the learner two chances to work through the scenario, but have a different "incorrect" slide show up if the learner is getting the wrong answer for a second time.

I am attempting to do this using variables, which I admit I don't have a ton of experience with. When the learner clicks the incorrect answer, the variable should set to 1. This works except when I also have a trigger that causes navigation based on the clicking of that button, then the variable addition trigger stops working. I'd like it to all flow based on a single click, not have to select the answer and then submit, for example. Is this possible? I'm attaching my file here for reference. Thank you!

  • Setting the 'Scenario_1' variable to 1 when the user clicks 'Incorrect Answer' means it will always remain 1, causing the second condition to never be met. You should also change the order of the triggers. In the current setup, the trigger to jump to slide 1.5 Scenario 1C executes first, preventing the second trigger from running and leaving the 'Scenario_1' variable unchanged at 0. This causes the interaction to loop over the first incorrect slide repeatedly.

     




     

     

    Try this instead:




     

     

     

    Changing the order of the triggers will ensure that the 'Scenario_1' variable is incremented by 1 before jumping to slide 1.5 Scenario 1C. This way, the next time the user clicks the 'Incorrect Answer' button, the variable will be increased again, triggering the 'Else' part of the trigger that jumps to slide 1.7 Scenario 1D. 

     

  • Ah, yes that is just the thing. Thank you. I forgot that the order of triggers matters. Much appreciated!

  • Nedim's avatar
    Nedim
    Community Member

    Setting the 'Scenario_1' variable to 1 when the user clicks 'Incorrect Answer' means it will always remain 1, causing the second condition to never be met. You should also change the order of the triggers. In the current setup, the trigger to jump to slide 1.5 Scenario 1C executes first, preventing the second trigger from running and leaving the 'Scenario_1' variable unchanged at 0. This causes the interaction to loop over the first incorrect slide repeatedly.

     




     

     

    Try this instead:




     

     

     

    Changing the order of the triggers will ensure that the 'Scenario_1' variable is incremented by 1 before jumping to slide 1.5 Scenario 1C. This way, the next time the user clicks the 'Incorrect Answer' button, the variable will be increased again, triggering the 'Else' part of the trigger that jumps to slide 1.7 Scenario 1D.