Forum Discussion
Reset Numeric Entry Box so no value shows
I have a question with Correct/Incorrect/Try again options. Someone on the Forum was kind enough to help out with IF, THEN, ELSE logic for try again. When you get Try Again and return to layer with NEB, what you typed in remains. I can set the NEB variable to 0 (Zero), but then learner has to delete the value before typing another response. Is there a way to clear out the original answer so the Numeric Entry Box is completely empty?
- SdeBoerCommunity Member
For me it does not work. The field now states "NaN" (not a number).
- PrathibaSrir570Community Member
Any solution to avoid the NaN?
- SnorrskiCommunity Member
I have implemented a temporary workaround in my courses:
instead of the javascript, I use an empty rectangle, styled like the numeric entry field, placed over the entry field, and set to change state to hidden when clicked.
- YuriFernandes-eCommunity Member
hi guys, i've a solution.
For contextualize:
My project is a little game, that in a determinated point the user need to write answers inside a numeric field. If the user writes the wrong answer, he goes to another point in the project that have tips and other exercises for him. After all of this, he comes back to the first quiz to try again, when he comes back the numeric entry fields continued with the wrong answers he had written, if i change the answer to 0, all of the fields stays with the 0, but my objective is when he comes back the fields resets, and stays blank, so... i made this:
1º - Create the numeric entry field in the slide
2º - Now create a text field custom variable
3º - Change the numeric entry field variable, in the triggers screen, for the new text field variable.(This makes your numeric field with the numeric configuration, receiving only numbers, not text, but the values are sign to a text variable)
4º - Now, create a buttom, that had a trigger to Adjust the new text variable value to 'blank' when he was clicked.
DONE.
Your numeric entry field receives only numbers, and you can make him reset to blank.
Hope helps,
Below i attached a little test for you know how works.
Any question, just call me in my instagram: _up.level - SnorrskiCommunity Member
Hi Laurie
I have a solution for you. On a slide before the one where your numeric entry is situated (could be the start page), you put an "execute javascript" trigger. The code you enter is as follows:
var player = GetPlayer();
//Establish an empty javascript variable
var empty = "";
//Set your Storyline Numeric variables equal to the empty js variable
player.SetVar("YOUR_NUMERIC_VARIABLE_NAME_1", empty);
player.SetVar("YOUR_NUMERIC_VARIABLE_NAME_2", empty);
player.SetVar("YOUR_NUMERIC_VARIABLE_NAME_3", empty);
player.SetVar("YOUR_NUMERIC_VARIABLE_NAME_...", empty);And so on...
This will set the variables to empty, even though storyline can't do it automatically.
You will need to make a "player.SetVar(...."-line for each numeric variable you want to set to empty.
Hope this helps everyone...
- DavidLoveCommunity Member
This works well. It also works when you just put it onto the same slide and set it to start when the timeline starts :-)
Hi there, everyone. I wanted to update you that I've documented the issue that when you rename a numeric variable, the entry field and the variable reference display a 0 instead of the default blank.
I'm going to have a look at this issue with our team so we can see what needs to be done! I'll keep this discussion updated.
- LaurieLyonsCommunity Member
Hi Crystal, Any updates on this?
Hi Laurie,
No update yet, but we'll post here as soon as we have more info.
If you're able to stop renaming the variables, you shouldn't be running into this challenge.
For all of you asking about this issue in Storyline 3, I have good news!
We just released Update 7 for Storyline 3! (Build 3.7.20003.0) 🎉In previous versions of Storyline 3, numeric-entry fields displayed default values of zero after renaming their underlying variables. In this update, you'll find that the numeric- entry fields will remain blank until learners enter values.Hi Ken,
By default, the fill in the blank answers will show what the user previously answered as you have seen. Could you set it up to set the value of the variable to (blank) and then you could have that changed based on the timeline starting or similar, so that the whole slide is reset? I'm not sure what other logic you've got going on with your layers - so that may not work, but feel free to share a bit more information here so that folks can chime in.
- JoePillsburyCommunity Member
Hi Ken,
I have a work around, but its a WORK around. Anyhow, if you was create multiple layers with the exact type of numeric box, then when they click on the continue from the try again layer it would take them to a new layer instead of the old one where there is a new blank entry for them. Its just a thought, not sure if it will even work.
- RickAtkinsCommunity Member
Does anyone have an answer for this? I have 11 numeric entry fields and only two of them display a "0" when I preview the slide. I would like them all to either be 0 or blank.
Hi Rick,
It's an older thread, but here are some ideas on how to remove the 0 from that field although it may depend on which version of Storyline you're using, as I know folks in Storyline 2 haven't seen anything there even though the default value is 0.
- KatharineGahanCommunity Member
I would like an answer to this Rick's question too. I'm using S2 and only a handful of the entries default to zero. When the final slide is previewed on its own there is clearly a difference in the values. Thanks!