Can text or numeric entries be reset to saved or initial state?

Apr 19, 2024

In an accounting course, I created an exercise. The table has several cells. I inserted numeric entries/variables for the student to answer each question. Giving them two attempts, I would like the correct answers to stay in place and the incorrect entries to be blank so the student can try again.  (Since text and numeric entries are not objects, I can't assign a correct and incorrect state). So, is there another way to do this? Here's a screenshot. Many thanks.

7 Replies
Judy Nollet

I meant there should be a separate trigger for each variable. The trigger action would adjust the value, with the condition that it doesn't equal the correct value.

However, looking more closely at your description, I noticed you're using numeric-entry fields. Unfortunately, while you can adjust a numeric-entry value to 0, you can't adjust it to [blank]. After an entry is made, a numeric-entry field will always hold a numeric value.

You could use text-entry fields instead (as demonstrated in the attached file). However, that does mean the users could enter any characters in the fields. And you'd lose the ability to calculate with the values.

Nedim Ramic

Hi Debra,

Judy is absolutely correct. Adjusting a numeric-entry value to 'blank' isn't feasible. I agree with the suggestion to opt for text-entry fields instead. I've included a revised version of Judy's proposal, along with an additional Execute JS trigger. This trigger incorporates code to prevent learners from inputting non-numeric characters. You can still utilize the triggers Judy created to reset values to 'blank'. However, please note that if you intend to perform calculations based on entered values, this approach may limit your options.