Update variable values in a page trigger when learner goes back to the page and changes answer695 0 2
Hi, I have a set of toggle/check boxes on page 1 that I have to show a value for the ones selected on page 2. I have a trigger that sets a string variable value when the toggle boolean variable is true. The user also has the option to back to page 1 (from page 2) and change their choice but I can't seem to figure out how to update the string variable values when they uncheck the toggle making the boolean variable value false. I do not have any triggers or conditions to set the string variable value if toggle boolean variable is false. (Not sure how to set a variable value to null --i don't know how to indicate that.) Any help you can provide would be greatly appreciated.
Comments( 0 )
Answers ( 2 )
Two items to check.
- When you added the toggle, did you bind a variable (under options ribbon tab) to it or add an action that when switch sets a boolean. The former is the easiest way to go and will then just change the value of the variable whenever the learner changes the toggle.
- If on page one you are "initiating the variables" to a value and you don't want them "reset" every time you goto that page, then make sure in the action properties you check the box to fire once per course/project.
Comments( 0 )
Hey Paul--thanks for replying. I did bind a boolean variable to the toogle but here is the catch. The toggle is next to an option/choice and the user can select one (or more) of these toggle selections. So I had to create a second string variable to assign the choice to it when toggle variable is true.
It looks like this:
Choose one or more of these options
when they select the toggle by red, making (bool_red) = true--I have a page action that assigns a second variable (string_red) the value of "red". When they go to page two, there is a display/output section that says "here are the colors you chose": and there I have String_red in a text box. It should show "red" if they selected the red toggle or show nothing if they did not select it. This works fine.
Now if they can go back to page one and unselect the toggle by red, return to page two, the bool_red toggle is now false --However, I still see the value "red" showing up for string_red varible in the text box. I need to figure out how to account for this scenario. Do I create another action to set the value of string_red to null when bool_red is false? How do I write a condition to assign a variable value = null?
Wow --I hope that makes sense. Thanks again for your help!