How to limit the number of attempts for a quiz

Hi everyone,

I'm currently experiencing a problem for which i can't seem to find a solution.

I want to limit the number of attempts on a quiz to 3 attempts. If the learner fails the quiz after the third attempt I want to direct them to a 'correct solution' page.

These are my steps. Maybe someone can figure out what I'm doing wrong?

1. I added a trigger to my 'start quiz' button (slide = resume saved state): adjust variable 'attempts' + add value 1 when user clicks on object  'start quiz button'. This should increase the variable 'attempts' with 1,00 each time the user clicks 'start quiz'.

2. On the result slide the user goes to the layer 'failed' when the score is lower than... AND the value of variable 'attempts' is lower than 3. I made a third layer there where the user goes to the 'correct solution' page when the score is lower than... and the value of variable 'attempts' equals 3.
The result slide is set to 'reset to initial state'.

3. I also added a reference to the 'failed' layer that states the number of attempts. (Attempts: %attempts%/3). When the user is being directed to the failed layer for the first time it should say: Attempts: 1/3.

4. On the failed layer there is a 'try again' button, which leads the user back to the start of the quiz where they have to click the 'start quiz' button.

When the user hits the 'start quiz' button for the second time, i'm assuming the value of the variable should be '2,00'. But when I end up on the failed layer for the second time, it still says "Attempts: 1/3". The first attempt has been added, the second hasn't. How come?

The only thing i can think of is that the result slide should be set to 'resume saved state' but then I will immediately be directed to the failed layer after the second attempt, even if I have succeeded the test.

Thanks to anyone who can shed some light on this mystery!

4 Replies
Alexandros Anoyatis

Hi Stefaan,

Right off the top of my head, i would do the following :

1) Add a variable (say 'count') with a value of 0.

2) On the 'Incorrect' slide, add a trigger when timeline starts that adds '1' to variable 'count'.

3) On the 'Incorrect' slide, add an extra trigger to navigate to the slide of your choice when user presses continue (if 'count'=3) and make sure this trigger is placed before the same trigger without the conditional statement.

That should do it.

Let me know if it helps!

Stefaan Leleu

Alexandros Anoyatis said:

Hi Stefaan,

Right off the top of my head, i would do the following :

1) Add a variable (say 'count') with a value of 0.

2) On the 'Incorrect' slide, add a trigger when timeline starts that adds '1' to variable 'count'.

3) On the 'Incorrect' slide, add an extra trigger to navigate to the slide of your choice when user presses continue (if 'count'=3) and make sure this trigger is placed before the same trigger without the conditional statement.

That should do it.

Let me know if it helps!


Hi Alexandros, after reading your comment I changed 1 thing: instead of adding the adjust variable trigger to the 'start quiz' button, i added the trigger to the incorrect slide where it added a value +1 to the variable when the timeline starts. That did the trick for me.

Thanks for your help!

Alexandros Anoyatis

Just remembered,

also try to create an extra trigger that resets count of that variable to 0 and place it inside the 'correct' slide (before the 'proceed to next slide' trigger). You don't want the count to continue where it left of in a previous answer (unless you want to have 3 tries total for all your questions in your quiz).

Alex