Forum Discussion

GerdaFourie-4b4's avatar
GerdaFourie-4b4
Community Member
21 days ago

Creating a stopwatch event to test reaction time

Hi everyone!

I'm busy with a road safety project. One of the topics is reaction time, and I'm thinking of creating a reaction time test where the user needs to start the test then wait for an object to appear and then click as soon as it appears. Storyline needs to then show the elapsed time between the start of the test and the time the user pressed stop.

I've searched for ways to create a stopwatch which can show the exact time "stop" is pressed but I'm not finding anything, and nothing I've tried has worked so far.

I'm totally clueless when it comes to Java script as well, so no hope there.

Does anyone have any suggestions on how to achieve this?

    • GerdaFourie-4b4's avatar
      GerdaFourie-4b4
      Community Member

      Thank you MathNotermans-9 I will play around with it and see if it works. I did find it on a search I've done but I was not sure if I could simply copy the java script into a trigger. I ended up enrolling into a short course on using java script in Storyline to see if I can learn more about it. That turned out to be a very nice and educational rabbit hole, so I haven't gotten round to testing your suggestion in Storyline to see if it works. I'll definitely try it. Thank you for taking the time to reply!

  • Nedim's avatar
    Nedim
    Community Member

    I can't seem to find my post from a while ago, but I created a timed quiz interaction where the learner needed to answer a question correctly within a time limit. The time response was recorded, and if the answer was incorrect, the learner would earn 0 points. If the answer was correct, the learner would earn a varying amount of points depending on how quickly they responded. 

    If you think this could be useful for your interaction, I can upload my .story file for you. I'll see if I can find some spare time to update it to fit your needs.

    Example:

    • GerdaFourie-4b4's avatar
      GerdaFourie-4b4
      Community Member

      Nedim thank you so much! Yes this may be helpful as well. It would be great to see the .story file as a reference. As I've told MathNotermans-9 in my previous reply, as soon as I get the game fully working, I will share it here for others to use as well.

      • Nedim's avatar
        Nedim
        Community Member

        I experimented with it a bit and managed to display a picture at different points on the timeline each time the Timer button was clicked and the timer started. Then, I used JavaScript to record the time difference between when a picture appeared and when the timer was stopped. The timer can only be stopped after the picture appears. Additionally, I set up triggers in Storyline to reset a few variables and object states, allowing the interaction to restart from the beginning with the timer resetting as well.

        Result: