Number Variables

Jan 30, 2017

Hi all,

Is there a way to stop a number variable going past a certain number?

I have a 'click and find' slide where I have a variable that tells the user how many parts are left to find. When they click on the hot spot, it subtracts one from the variable number. If they click the same part twice, after finding all three, it will go to -1 where I'd like it to stop at 0.

Or.. is there a way of only letting the hotspot minus one from the total number once?

4 Replies
Dave Cox

Hi Amy,

Sure, there is a couple of ways that you can do this.

To do exactly what you asked for in your description, simply add a condition to your trigger where "Your_Variable >= Greater than or equal to 0.00"

Trigger Condition

To set this up, click the Show Condition button at the bottom of the trigger wizard and then click the little plus sign to the right to add a condition. Set it up similar to the example below.

Add Trigger Condition

It might be better, though, to allow the user to click each hotspot only once.

If you add a disabled state to your hotspot, you can then add a trigger to disable the hotspot when the user clicks it, preventing a second click. Take a look here to see how you can add states. 

Once you've added a disabled state, just add another trigger that sets the state to disabled when the user clicks the hot spot. 

Select Disabled State

Nejc Žorga Dulmin

I would add an extra variable for each object, so you know exactly which object was already clicked:

Object1_clicked, default value FALSE

Then you upgrade your original trigger (where you subtract the value), with a condition using this variable

"on condition: variable Object_1_clicked = FALSE"

And then you add another trigger to change the value to TRUE once user clicks this object (make sure, this trigger is AFTER the trigger above)

Adjust variable Object_1_clicked = TRUE when user clicks Object 1

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