How to limit the number of attempts for a quiz
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!