Using Variables to Control Button States

Jun 02, 2022

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.

2 Replies
Maria Costa-Stienstra

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:

Windows 10 (1) 2022-06-02 at 12.52.48 PM

Here is an example of:

  • Choice one is correct, but not selected.
  • Choice two is incorrect, but not selected.

Screen Recording 2022-06-02 at 12.54.08 PM

And here's an example of:

  • Choice one is correct and selected.
  • Choice two is incorrect and selected.

Screen Recording 2022-06-02 at 12.55.17 PM

Let me know if this works!