Forum Discussion
Can text or numeric entries be reset to saved or initial state?
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.
- DebraMascott-05Community Member
Thank you, Brian. I have variables for every empty box, but I didn't insert a trigger for true/false. I'll give it a go. (However, I have been reading about NaN and Java Script). Do I have to go down that rabbit hole?
- SlDeveloper-8a8Community Member
Hello Debra! You can try creating creating correct and incorrect layers with other variables having static values. Thanks!
- JudyNolletSuper Hero
This could be done with Storyline programming. For each text-entry variable, use a trigger that adjusts it to blank with the condition that the value is not equal to the correct amount.
When those triggers run depends on how the question is set up.
- DebraMascott-05Community Member
- JudyNolletSuper Hero
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.
- NedimCommunity Member
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.