NaN appearing in a numeric variable project - no learner manual data entry allowed
Jan 31, 2017
Hi, I have a project where I'm using number variables to move a set of sliders (as feedback indicators) when the learner makes a series of choices. It works as designed however if the learner deselects all their choices the sliders display an layout error as the variables driving them now have a value of NaN (Not a Number). The whole thing is driven by number variables, no text entry data should be able to impact the calculations.
I have attached a test project with the issue. It only occurs if all the checkboxes have been selected and then all deselected (when NaN appears). If the checkboxes are then reselected the NaN errors disappear but the sliders don't reset. Does anyone have an idea what is triggering the NaN status.
5 Replies
That's because your trigger setup allows that a value, e.g. activistspercentage can be divided by a value, e.g. count, which, when none of the checkboxes are selected, is zero. Dividing something by 0 will result in an error.
Hi Michael, thanks for the quick reply.
Thanks, I had overlooked that logic. I'll design a work around.
Cheers
Trevor
Hi again Michael, all fixed, many thanks.
Trevor
You could add a condition to the Division triggers to only divide variable xyz when count is not equal to 0.
Hi Michael, That's what I did, just took a few minutes for the penny to drop.
This discussion is closed. You can start a new discussion or contact Articulate Support.