You can optionally reset the score on each load by running the following function ‘On Scene Load’:

window.quizScore = 0;

Scoring / Results

Since we have the window.quizScore = 0; variable, if you want to tally the score at the end, and reward your quiz takers who get a certain number of points, use this function ‘On Scene Load’ in the last scene:

if (window.quizScore >= 6) {
// run a timeline, or something to show that the score is 6 or higher
} else {
// they didn't do so well, so run a timeline or some other action
}

Thanks for this. I’m using this for a touchscreen display. Throughout the quiz folks have an option to return to the beginning and try again. The problem is that the score just keeps adding up. I need a way to reset the score upon return to the first scene. Any assistance very, very much appreciated.

This is great! Question though - even with the sample file I (again, it’s my lack of Javascript knowledge) can’t figure out how to get the final score to show up on my last slide. What calls it from the background and physically puts it next to the “Total Correct” text?