Forum Discussion
Resetting variables on return to slide
Hello all.
I am trying to reset variables when the learner returns to a slide. My variables have instant feedback on other layers or objects when the variable changes. I have set up triggers to reset the variables to blank when the timeline starts on the slide. However, since my variables have triggers to give instant feedback when the variable changes, the reset when the slide begins is also setting off the trigger to give feedback. I have attached an example file to replicate the problem. If you fill in all the fields and click to go to the next slide, then click to come back, you can see the instant incorrect feedback come up.
Thanks in advance for any help!
Hello,
I believe your problem is that you have a trigger that says "Show incorrect layer when the value of a variable, such as field1, changes." If you think about it, your variable is changing at the beginning of the timeline because you have a trigger to set the value to blank when the timeline begins. Therefore, the variable is changing at the beginning of the timeline, the field value is incorrect, and thus you are getting the incorrect feedback.
The solution could be to change when the incorrect layers are shown. Instead of showing the incorrect layers when the variable changes, try changing the trigger to be "Show layer incorrect 1 when field 1 loses focus." After the user enters their text and clicks away or perhaps tabs away, the trigger should make the incorrect layer show up if the number does not equal what you want.
I have attached a revised version of your project that seems to work.
If this solves your problem, please mark it solved. Otherwise, feel free to ask a follow-up question.
8 Replies
- KendalRasnake-1Community Member
Hello,
I believe your problem is that you have a trigger that says "Show incorrect layer when the value of a variable, such as field1, changes." If you think about it, your variable is changing at the beginning of the timeline because you have a trigger to set the value to blank when the timeline begins. Therefore, the variable is changing at the beginning of the timeline, the field value is incorrect, and thus you are getting the incorrect feedback.
The solution could be to change when the incorrect layers are shown. Instead of showing the incorrect layers when the variable changes, try changing the trigger to be "Show layer incorrect 1 when field 1 loses focus." After the user enters their text and clicks away or perhaps tabs away, the trigger should make the incorrect layer show up if the number does not equal what you want.
I have attached a revised version of your project that seems to work.
If this solves your problem, please mark it solved. Otherwise, feel free to ask a follow-up question.
- mcgriffCommunity Member
Kendal, thank you for the help! I realized why it was happening, but wasn't sure of the fix. I think your solution will work. It certainly works in the sample file. My training is much more complex than this, but I'm going to try it. Thank you!
- mcgriffCommunity Member
I'll add on to this, in case somebody else runs into this issue. My variables are being filled by "adjust variable" through popup menus in other layers that enter information into the variables when a button on the menu is selected. The solution Kendal offered worked fine if the learner is inputting the text into the field manually, but didn't work with the menu the way I had them set up. My solution was to put the instruction for showing the "incorrect" layer into each of the incorrect answers on the menu selection layer.
- Jonathan_HillSuper Hero
You could also make the trigger conditional, so it only fires if the variable is NOT EQUAL TO BLANK.
This way, when the variable resets to BLANK, it won't trigger.
- mcgriffCommunity Member
This could work. The only exception is that I have some variables that pass the condition by not being blank. I don't care what they put in the field, but it must have something.
- mcgriffCommunity Member
I have an add-on question, if that's ok. Is there any way to set a True/False variable to blank upon the return to the slide. The first time the user gets to the slide, the variable is blank (or my "incorrect selection" layer would become visible). After it has been selected, the only option I have to reset it to is True or False, not blank.
- Jonathan_HillSuper Hero
True/False variables are either True or False, they can't be blank. But you can reset them to their original value, and ensure the events you're triggering only happen at a certain time or cue point when its value changes again.
- mcgriffCommunity Member
That's what I thought. So, when returning to the slide, if I set a trigger to return the default to false, this is recognized as an adjustment to the variable and it is triggering the display of the "incorrect" layer. It does this based on a trigger set to display the incorrect layer when the variable changes to false. The first time the slide is visited, it is set to false, even though the check mark is not selected. So, it does not trigger the incorrect layer unless the learner clicks on the false check box.
Related Content
- 10 months ago
- 10 months ago
- 10 months ago
- 10 months ago