Stop negative numbers in numeric variable

Feb 08, 2020

I've set up a numeric variable to countdown from 9 - 0 to represent the number of drag items to use in a drag and drop.  

Each drag item has a trigger to say subtract 1 from variable when user drops item.

There is a trigger to return variable to 9 if user gets try again layer.

The issue I am having is if the user changes their mind before they hit the submit button and drags to another drop item i then get negative numbers if already at 0 or subtracts too many if not all cards have moved. Is there a way to stop double counting?

2 Replies
Ren Gomez

Hi Developer Notes,

Happy to help! You may want to consider adding a condition to each item to subtract only if variable is greater than or equal to 0

Are you comfortable with sharing your .story file for testing? You can share it publicly here with the community, or privately with our support engineers here.

We'll take a look and offer our best recommendation to stay in the positive!

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