Resetting Numeric Variables

Hello all. I have set up a basic scored quiz that uses numeric variables to add and subtract from zero based on answers the learner gives. At the end is a feedback screen that shows the score the learner has achieved. 

This all works fine, but if the learner uses the previous screen button to go back and try again, this score is held onto, and subsequent attempts accumulate from the already tallied score. So, they are in a position where they could end up getting 12 out of 6!

I know there are ways around this (e.g. have a "Try Quiz Again" option and the learner thinks they are doing the same quiz, but really it is a series of duplicated slides with a new counter), but I wondered if there was a way to reset the score to 0 (perhaps using a trigger)?

Thanks in advance.

19 Replies
Nancy Woinoski

Hi James, there is a Reset Results trigger that will you can place on the first page of the quiz (or on the previous page) that will reset the score to zero.

I don't think this will clear out any type values in the input fields though so you may also have to add a trigger to adjust the variable for the NumberEntry field to zero.

Mike Enders


At the beginning of the quiz, you could use a series of triggers to reset the variables back to their starting state.  So if, for example, the variable started at 0... you could add this trigger:

This would reset the variable back to 0 and refresh the outcome.  You'd do this for each variable you want reset.


Sij X

Hi Mike and James,

I tried using the trick to reset the variable to their original state but it didnt work. On retry quiz and then question 1, my variable which is the same as "Result.ScorePoints" still shows the score i had reached in my previous attempt.

This is my Object trigger to set my variable (ScoreSoFar) = Results.ScorePoint..and this is my slide trigger to reset the variable (ScoreSoFar) to zero when the timeline beginAm I doing something wrong, guys?

James McLuckie

Hi Sij

The way I have started to build my quizzes is over two or three slides:

Slide 1: An intro slide that has a 'Start the [Quiz Name]" button with the following trigger applied to it:

Slide 2: The questions presented over a series of layers. Triggers are set up to the answer boxes to assign points depending on the answer selected

Slide 3: This is the results slide. A "Retake the Quiz" feedback button is set to state hidden, with a trigger applied to only reveal it if the learner scores below a certain number. The 'Retake the Quiz' button takes the learner back to slide 1. Because a trigger has been set-up to set the quiz score to zero when they press the 'Start the Quiz' button, the score will always start afresh. The trick is to set-up your navigation/branching so that the learner can't get to the questions without going through the intro slide. 

In the above trigger, I have set it up to play a sound when the user's feedback is revealed, hence the 'when media completes'. 

I'm sure there are probably quicker ways of doing this, but now I have set it up once, I can import it and adapt it for other projects.

I think the difference between how I set it up and how you have is that the learner actually has to press something to activate the resetting of the score. I'm not sure that "Timeline starts" is enough of a trigger to activate that. But that is a complete guess. 

Hope that helps you out! 

Sij X

Thank you James!

I see how you've designed your quiz and I guess that method should see you avoid the issue that I'm facing.
I think since I'm using the Storyline Result slide variable "Results.ScorePoints", my variable "ScoreSoFar" is unable to get resetted when my learner retries the quiz.
I did use your advice and removed my trigger from timeline start and moved it to the next button on the previous slide, much in line with your user clicking "Text box 18 - Start at its core" but still, when I reach the first question, the variable "ScoreSoFar" is holding on to the previous score.

Much appreciated, James. I learnt a new quiz method thanks to you!
Any heroes to my rescue?

Nancy Woinoski

Sij X said:

Hi Mike,

Hope you sort this out for James and me. I would like the "ScoreSoFar" variable to be re-set to zero before learners retry the quiz.
My variable "ScoreSoFar"= Results.ScorePoints.

Hope you can get this fixed..been waiting all day for a solution!

Hi Sij -  I am not sure which screen you have this trigger on, but maybe place it on the slide with the first quiz question and change it to a screen trigger instead of  having it on the next button. The change the on click to when "Timeline Starts"

Sij X

Thanks for offering to help, Mike.

I have scrubbed my unit down to what I need to get reviewed. The Story file has been attached with this post.
In it, you will find:
An instructions slide
Three question slides each worth 10 points 
Then a Fail or Pass slide depending on your score
I tested it this morning and still, on retrying the quiz, the variable - ScoreSoFar - is still holding on to the score from the previous attempt.

Thank you very much for your assistance! 

Sij X

Hi Sij -  I am not sure which screen you have this trigger on, but maybe place it on the slide with the first quiz question and change it to a screen trigger instead of  having it on the next button. The change the on click to when "Timeline Starts"

Hi Nancy,

I did what you suggested and the trigger pane for my first question now looks like this:..but still the variable holds on to the previous score when I retry the quiz. So, stuck!