Counting how many times a number appears and tracking/reporting results

Jan 11, 2022

Hi, I just started a project to help figure out how to display a random number to the learner, and create a counter and results page like the one shown in the attached example. The numbers 0-9 appear automatically and randomly for a set period of time when the learner chooses to start the sequence.

Right now, they have a prototype that uses 150-200 different numbers manually typed in separate objects at incremental points on the timeline.

From searching for similar situations, I think this could be done with scripting, and that would avoid having all the number objects placed separately and manually on the timeline. I don’t know JavaScript very well, though, and I’m not sure exactly how to do it. Does anyone have any ideas about the best way to create this?
Thanks!

1 Reply
Maria Costa-Stienstra

Hi, Lee.

Thank you for reaching out!

While Javascript might be a way to achieve what you're looking for, I wanted to offer you a suggestion using variables in Storyline. 

You can have two counters (one for clicks and one for times the random number equals five):

Windows 10 (1) 2022-01-12 at 10.43.44 AM

You can set up so the random number changes based on timeline cues (in my attached example, it shows a new number every second, and then the timeline restarts). When the variable changes, you can have a trigger to add the value of one to counter if it equals five. Another trigger will add the value of one to counter_click when the button is clicked.

The results are displayed on the end slide (in my example, the results slide appears either when the user clicks the End button or clicks the main button ten times). 

Screen Recording 2022-01-12 at 10.48.13 AM

If you need to track and report to an LMS, you can use the method described in this article