Variables not working.

I have attached a file of a test run. I want to construct a quiz that allows users to retake the quiz only once. If they fail twice it will allow them to click a button to email me.


I have set up a variable called count, It is a number type, and should increase by 2 every time the “retry quiz” button is pressed.


Layer Fail shows when the users fails the test


Layer Test should show when the user fails the test and count is greater than one.


It is not working and I’m not sure why. Please help.

4 Replies
Wanda Blackett

Hi Zachary,

I had a look at your file - I think the solution may be a simple one.  In the trigger for when the user clicks on the "Retry Quiz" I see that your trigger for adding 2 to the count variable comes after the jump to the first slide.  The order is important, and if the player jumps back to the first slide before the action of adding 2 to the count has been done, then it doesn't get applied.  You just need to move that trigger up in the order list. :)

Wanda

Graham Matheson

Hi Zachary,
From the sounds of it Wanda has solved the problem for you. I just wanted to say, I had the exact same problem yesterday. Ignore me if you know this already but one of the ways of investigating what variable isn't working is by inserting a reference for the variable on screen. 

1. Insert text box on the base layer of your results screen.
2. Insert reference into the textbox (reference is next to textbox on the insert menu).
3. Select your count variable.

This will show whether the variable has been adjusted. When I had this problem, I didn't know whether my trigger to increase the count was broken or if the slide layers needed to be checked. I also find inserting a reference for true/false variable VERY handy. 

Good luck
Graham