Setting a numeric variable to null

Jun 28, 2018

Is it possible to set a numeric variable equal to null instead of 0?

4 Replies
Ashley Terwilliger-Pollard

With the updates to Storyline 3 and Storyline 360, it removed some of the functionality for these various methods to access system variables. Storyline isn't currently designed to expose system variables for user interaction and these JavaScript triggers that reference them could interfere with course playback. 

Our team is looking into what variables users would like access to and how we can provide that same functionality built-in. So I'd love to have you share a bit more about your needs with our team through a feature request!

Andrea Mandal

Here's what I want to do. I can't share my actual .story file due to company requirements but see if this makes sense:

A user needs to solve a math problem. The answer is input into a numeric entry field.

There are two variables attached to this; let's call them Answer and AnswerNull.

The AnswerNull variable is set to true by default while the numeric entry field is blank.
When a user inputs the answer into the field and the Answer variable changes to something greater than or equal to 0.00, AnswerNull goes false.

Answer is set to the typed value in the numeric entry field when the control loses focus.
A state change occurs on a checkmark from "hidden" to "normal" if Answer is correct.
A layer called WrongAns displays if Answer is incorrect AND AnswerNull is false.

AnswerNull is used to prevent the WrongAns layer from displaying if the user clicks from numeric entry field to numeric entry field (there are about 40 on one page, all with variables Answer2, Answer3, etc. and their corresponding Answer2Null, Answer3Null, etc.)

The problem occurs when a user wants to ERASE their value from Answer and go do another problem. I can't toggle AnswerNull back to true (to prevent the WrongAns layer from appearing.) They've already seen WrongAns once; currently if they erase it and try a different problem, it will appear a second time when they click out of the Answer numeric entry box. It's a minor UI issue but extremely annoying.

One thing that might fix it is if there were an option in the Trigger Wizard Conditions as "not greater than or equal to" but there is no such option. The trigger would then be "Set AnswerNull equal to True when Answer changes if Answer is not greater than or equal to 0.00"

Setting it to "less than" doesn't work because answer is currently blank. It isn't 0 (and 0 is an acceptable answer for many of our questions so we can't arbitrarily set it to 0)

I can't figure out a way to get the system to understand that the user has erased their answer and it's blank again. Viewing the variable %Answer% onscreen, I can watch it change from blank, to an incorrect answer, back to blank when I erase it. How do I account for that blank variable?

 

This discussion is closed. You can start a new discussion or contact Articulate Support.