Trigger trouble for a running score total

Hi everyone, 

Newbie here! I'm loving Articulate Storyline but having a bit of trouble with triggers for my variables and states. I'm trying to create a quiz where if the user gets an answer correct they get 10 points, and if they get an answer wrong they have 5 points deducted. There are four icons per slide, one for each possible answer. Each icon changes state so that the icon changes colour, and changes back again if they click on another icon. 

 

I have tried to set up the trigger so that the points are added/subtracted when the relevant icon's state is set to my custom state, "clicked", on the condition that the other three icons' states are equal to "normal". 

 

My problem is that the score that is being displayed on my score layer when they click "submit" seems to be based on the user's first click. For example, if they click on a wrong answer, but then change their mind and click the right answer, and *then* click submit, they have 5 points deducted rather than 10 points added.

 

I appreciate this is probably user-error; can anyone help please? I'm happy to give more details if needed.

 

Many thanks,

 

Alice 

2 Replies
Veronica Budnikas

Hi Alice,

Welcome to Heroes!

You said "I have tried to set up the trigger so that the points are added/subtracted when the relevant icon's state is set to my custom state, "clicked", on the condition that the other three icons' states are equal to "normal". "

I think that if you change it to trigger not on the state change, but rather on Submit, then it should work properly. so: Subtract 5 when user clicks Submit if icon X is Clicked and icons A, B and C are Normal (and one for each possible combination).

Happy to look at your file if this doesn't work and you're able to share!

 

 

Walt Hamilton

Veronica is right, that the simplest method is to calculate according to the state when Submit is selected.

If you want all other icons to return to normal state when one is selected, the simplest method for doing that is to use the built-in state, and make them all one button set. That allows only one to have the selected state without you writing any triggers. Just copy your custom state, and name it selected.