Creating Accuracy Score

Dec 03, 2021


I'm creating a drag and drop game in Storyline 360. The scenario is this: learner should be able to drag the cards provided into 5 categories within 3 minutes (otherwise, game's over). I would like to be able to calculate the total number of cards attempted in 3 minutes, the total number of cards matched correctly, and using that, be able to display an accuracy score.

Here's what I have tried so far:

1) Created a variable to calculate the total number of cards matched correctly: Patientcard

2) Created a variable to calculate the total number of cards attempted in 3 minutes: Cardsattempted

3) Created a variable for accuracy: Percentage

4) Set Percentage to variable Patientcard when the timeline starts on the slide

5) Divide Percentage by variable Cardsattempted when the timeline starts on the slide

6) Multiply percentage with value 100.

7) Display the percentage variable reference on the slide.

But for some reason, the percentage result appears as Nan.

Can someone please help me figure out how to fix this?

4 Replies
Maria Costa-Stienstra

Hi, Divya.

Thank you for sharing your .story file!

The triggers you're using are set to "when the timeline starts". At that point, all the variables are set to 0, which is why you're getting the error. 

Those variables are not getting "re-checked" as the timeline is not re-starting as the user progresses. 

Instead, assign the triggers to "when the variable changes":

Windows 10 (1) 2021-12-06 at 10.00.18 AM

Here are two recordings of what this would look like in Preview:

Example 1: 100%

Screen Recording 2021-12-06 at 10.00.34 AM

Example 2: 60%

Screen Recording 2021-12-06 at 10.01.06 AM

I hope this helps!