How to reset an <answer> with <choice> options

I’m trying to set up practice exercises where students have MC or pull-down responses (e.g., with responses to pick from. The responses I present them with change with the updated values, but I have not figured out how to clear the or the selected.

Doenet is a sample with pull-downs that I’d like to be able to clear (e.g., via ) when they trigger for new inputs.

This is even more complicated when I set the property to lock the answer if they get it correct. How do you reset this in an ?
Ideas welcome.

This is really hard to do within a Doenet document. It works automatically if you use a Doenet assignment with the New Attempt button. I apologizing for beating on this over again, but could you explain why using an assignment and the New Attempt button doesn’t work? Is this something you are giving to students via a PreTeXt book or another embedding mechanism where that feature isn’t available?

Also, I cannot view the activity as you need to make it Unlisted or Public for others to view it.

'Sorry - i fixed this.
I’ll look up the documentation on Doenet assignments and try that.

I did discover how to reset a multiple choice answer. You have to explicitly add in the <choiceInput> around the choices so that you can set its selected index. Here’s a working example.

<answer shuffleOrder inline>
  <choiceInput name="myCi">
    <choice credit="1">Correct</choice>
    <choice>Distractor 1</choice>
    <choice>Distractor 2</choice>
  </choiceInput>
</answer>

<updateValue target="$myCi.selectedIndex" newValue="0">
  <label>Reset answer</label>
</updateValue>

However, I did discover one flaw that I don’t know how to work around. The shuffleOrder for the choices is tied to the different variants. There is no equivalent “resample” feature like with <sampleRandomNumbers>. So, even though you can reset a choice input to blank, you don’t have a way to reorder the list without selecting a new variant (which is currently limited to the New Attempt button of assignments).

The assignment feature, unfortunately, is currently poorly documented. @Anurag_Katyal is making a video to explain the basics.

Here’s a quick run through of how assignments in Doenet work as of 08/15/2026 - https://youtu.be/-6ebbGKor8o

Thanks, Anurag!

If you allow multiple attempts in the Create Assignment dialog that Anurag showed, then students will see a New Attempt button when taking the assignment. When they click that button, they will be assigned a completely new variant, including having the choice inputs reshuffled. If you plan to use this for your students, I’d recommend switching your <sampleRandomNumbers> to <selectRandomNumbers> or <selectFromSequence> and removing all the resample actions and buttons.

Note that there are two types of attempts: (1) the assignment attempts from the Create Assignments dialog and (2) the attempts for each given answer set by its maxNumAttempts attribute, which controls how many times a student can submit a response to that answer for each assignment attempt. When they click the New Attempt button to create a new attempt of the entire assignment, all the answer attempts are reset to zero.

You all are awesome.
Thank you for your patience - 'still learning.

I knew I was going to forget showing something in the video.