Action button with choice

Has it become impossible to include an Action button and a Choice on the same screen?

Yes. The only time you can not have an action button is if there is no graph component. So if you want to use an action button you’ll need to also add a graph.

1 Like

If you just need a basic Submit button, I think those are possible with choices. Off the top of my head, you need a SubmitLabel sink in the choice component. You also need to call on it somewhere else because the button won’t show up. For example, the note component could have

content: when choice.submitted "You made a choice!"
otherwise "Please make a choice."
1 Like

I tried this, but it give me this syntax error: expected OTHERWISE token but found IDENTIFIER.

I used the following to create a Submit button:
submitLabel: when choice1.submitted “Move to the next slide.”
otherwise “Submit”

And it worked. But now, I need it to tell the students whether they were right or wrong, and show the correct answer after they click the “Submit” button. How do I do this?

Something like this should go in a note. After submitted, you can give the feedback. If not submitted, just give the directions.

I am very confused. Here is my activity:

Could you help me? I seemed to have put in a Submit button, which is good. But, after the Submit button has been pressed, I want it to say “Good job” if they chose the correct answer and “Try again” if they choose the incorrect answer.

No problems, this is a quick fix. Try putting this code in your note component. You actually don’t need any code for the choice to make it work.

content: when choice1.submitted and choice1.isSelected(4) "Great job!"
when choice1.submitted and not(choice1.isSelected(4)) "Check your work to see if you can find your mistake. If you need help, ask your teacher or a classmate."
otherwise "`x^{2}+7x+6=0`"

Thank you so much! It worked. And I used the same idea for my multi-select question and it worked. Thank you again!