Submit button to check work

How do I create a submit button or something that will check student work? I have multiple choice questions and I want students to have to check their answer and get the answer correct before they move on to the next question. Currently they have no way of knowing if their answer is correct or not.

Piggy backing this; is this possible during a select all question (checkboxes)?

You can use set conditions to show content: in a note. For multiple choice or checkboxes, you need to determine the desired answer(s). Then, use that as a condition for your content in the note (and/or coverText on the next slide. See the thread at the bottom).
Multiple choice is easy. Here the third answer is correct:
correct = this.isSelected(3)

Checkboxes take some care. Say the 2nd and 3rd answers are correct, but answers 1 and 4 should not be checked:
correct = this.isSelected(2) and this.isSelected(3) and not(this.isSelected(1) or this.isSelected(4) )

Make an action button and name it.
Then, in your note:

content: when yourButtonName.timeSincePress() > 0 
(when yourCheckboxName.script.correct "Great Job!" otherwise "Try again.")
otherwise "Put your instructions here"

I’m using a nested when-otherwise. When the button is pressed it follows the when-otherwise in parentheses, otherwise it shows your directions.

Using coverText:

When I do the
content: when yourButtonName.timeSincePress() > 0
(when yourCheckboxName.script.correct “Great Job!” otherwise “Try again.”)

I get an error message "Syntext Error: Expected_ otherwise_ token not found

You’re missing the last line of my example. It was a nested when-otherwise (i.e. a when-otherwise inside a when-otherwise). You currently have “when the button is pressed, do this when-otherwise”, but you’re missing another otherwise (i.e. what to do if the button has not been pressed).

Your help has been amazing and I greatly appreciate it! I’ve managed to make it work for two of my cards, but now every card since then it has stopped working. The code is all good (no error messages) but the button simply doesn’t react when I input an answer and click on it. I’ve checked it multiple times and its exactly correct; any ideas why it would stop working?

1 Like

Can you share your activity and identify the slide in question?

I think I figured out the problem actually, but thanks for your willingness to go above and beyond to help me!

Hi - I have created a really similar slide but I want to allow students to retry their answer. I don’t know how to get the button to reset - it doesn’t seem to reset if you change your check box answers so the text just automatically changes to give them feedback once they get the correct combination. I would like them to be forced to click the button to submit their next choice. Any ideas?
Many thanks!

I worked out a solution - I just added some text for the resetLabel!

So simple! :slight_smile:

Hi Natalie_V_MEI,
Can you explain how this resetlabel works?

Hi - I used this bit of code to show “Try again” once they had clicked the button … I had already defined what the correct answer was in the note component fb1:

resetLabel: when not(fb1.script.correct)
“Try again” otherwise “”

Might make more sense to look at the whole screen so I put that screen here: Reset label • Activity Builder by Desmos :slight_smile: I hope that helps!

1 Like