Forum Discussion

DebraMascott-05's avatar
DebraMascott-05
Community Member
5 months ago

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.

  • Variables can be used to capture, save and display values from text boxes. I'm pretty certain the same holds true for numeric entries. Here's one of many primers on variables.

  • 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?

  • Hello Debra! You can try creating creating correct and incorrect layers with other variables having static values. Thanks!

  • 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. 

  • Hello @JudyNollet

    Here are my triggers (Pick 1).I am not clear how I would swap out the INCORRECT values.  On the Try Again, I would like every incorrect answer to swap to a blank entry.

  • 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.

  • 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.