Forum Discussion
Using Variables to Control Button States
I want to be able to display a button state as a feedback after "Submit" button is clicked. There are 4 possible button states based on if a.) Choice is Correct or Wrong; and b.) If Learner Clicked Button or Did Not Click. It seems simple enough to accomplish using variables to determine which button state to display, but I am having trouble constructing the statements. I've attached my source file and a diagram of which graphic I want to display based on which combination of variables are true.
- MariaCSStaff
Hi, Tracy.
Thank you for reaching out and sharing your .story file!
If I understand correctly, each button will only be one of two states (Yes/NotSelectedButCorrect or No/Distractor). Since when designing, you already know which ones will be correct/incorrect, you can create the conditions based on the states they're in when the user submits:
Here is an example of:
- Choice one is correct, but not selected.
- Choice two is incorrect, but not selected.
And here's an example of:
- Choice one is correct and selected.
- Choice two is incorrect and selected.
Let me know if this works!
- TracyNaso-01983Community Member
YES! That worked. Thanks for the quick response.