Check box to adjust variable
May 06, 2020
By
Anne Baker
I have a checkbox on the first slide of a course that users can check for a more screen-reader friendly version (ie, no drag and drops, etc.) I change a variable (that begins as false) to true when it is in the selected state and then, later in the course, it gives different versions of the same content based on that variable being set to true. However, if I toggle it on (to selected state which is true) and then back off, it does change the variable back to false. What is the easiest way to use checkboxes to toggle between true and false?
4 Replies
The selected state has a built-in set of triggers that changes the state back and forth (toggles) each time you click it. So all you need to do is create one trigger to adjust the variable. When you create the trigger to adjust variable, and enter the T/F variable, you get the option to toggle. Click on set, and choose toggle. The built-in magic of that trigger changes the value of the variable back and forth, just as it changes the selected state.
Complete the trigger with "when user clicks checkbox".
OK, so you said that is has a built in variable. Why does it not add a variable after inserting a checkbox? (Sorry, maybe I am missing something...but you show Variable1 and that was not added automatically after inserting the checkbox.)
Built-in triggers. You have to create the variable, and the trigger to change it. The magic is that it toggles - automatically switches from one state to the other (or one value to the other, if you toggle a T/F variable).
OK, nevermind I created a variable for it and it worked, not sure if I didn't understand...but my software did not automatically generate a variable when I inserted the checkbox. Thanks.
This discussion is closed. You can start a new discussion or contact Articulate Support.