add 128!

Hi. I am going crazy trying to get a number variable to add 1 when the correct answer to a question is selected. For some reason even though I have set the trigger to adjust the variable by adding 1 when the check box is selected, it keeps adding 128. I have 4 questions, so if they get them all right the variable should be 4 at the end. But instead it is 512 (128x4).

Other than that it works fine, it just would have been easier to count if it was just 4! Any ideas why this is happening?

8 Replies
Alphonso Hendricks

Hi Lauren

I'm going to put it down to being Black Friday.

First I deleted your variable and then re-installed it. When published, it added 125 instead of 128. So I was no closer to solving this mystery.

Then I used "adjust variable based on state change of radio button (or collection of radio buttons) as my trigger instead of clicking NEXT and adding conditions.

That worked. See attached. But it still does not explain where the 128 or 125 comes from.

 

Lauren Andrews

I figured out how to stop it adding 128 to the value of the variable instead of 1! It has something to do with the pre-made submit the result trigger of each question. Although it would not let me delete the trigger, I simply edited it to change state of unassigned instead. Now when selecting the correct answer of the question it adds 1 when pressing submit.

 

Tim Clark

I would put the adjust variable trigger on the "correct" feedback layer. 

Although I notice you aren't using feedback layers, this could be achieved by having the feedback layer blank and simply adding the trigger "jump to next slide when timeline starts" on the feedback layer. with "+ add value 1".

Not sure if it will help but its a different way of going about it.