Forum Discussion

090909's avatar
090909
Community Member
13 hours ago

Timer on each question in a quiz

Hello,  

I hope you are all well! I have an interrogation...I know how to use the timer in the quiz in Storyline but is there a way to have a timer for each question instead of the overall quiz?  I also don't know much JavaScript...

Thanks for the help!

Karine

2 Replies

  • Off the top of my head, the easiest slide-based timer is often just an additional layer of that timer’s length with a trigger to go to the next slide when the timeline ends. If there are no images or visual assets on the layer, the user will never be able to interact with it, but if the timer begins when the slide does and automatically send the user to the next slide when the layer completes, the effect is the same as a timer.

    To respect the user as well as for general accessibility, I think it’s still advised to add visual indicators of the time so that people know how much time is left. Most people think of numeric countdowns but those can be a bit complex, and benefit from JavaScript.

    a low-tech alternative could be to add two rectangles to the timer layer to simulate a progress bar. The background rectangle can be the “container” and the foreground rectangle of a different color can be the bar. Then the bar can given an Entrance Animation of wipe-right with a duration equal to that of the timer—say, three minutes. Then when the slide layer begins, learners will see the foreground rectangle slowly “fill” the background rectangle.

    Ensuring the bar timer is communicated before the quiz begins will reduce learner surprise, and a little bit of graphic design finesse could help guarantee the timer/progress bar looks clean.

  • If you want to set a specific amount of time for a quiz question that shows the amount of time remaining, you can by creating a looping layer, and you don't need JavaScript, but you do need variables.

    • Create a number variable and call it "Timer" and set a default value of however many seconds you want your timer to be (e.g. 60 if you're going to give them 60 seconds).
    • On your quiz slide base layer, you should reference the variable (insert -> text box and insert -> reference to the Timer variable).
    • Create a layer and call it whatever you want, like "countdown." 
    • On the base layer, add a trigger to show the "countdown" layer when the timeline starts on this slide.
    • On the "countdown layer" adjust the timeline duration by dragging the end of the timeline to 1 second, then create a trigger to adjust the "timer" variable: Subtract value 1 from "Timer" when the timeline ends on this layer if Timer > 0. 
    • Now to loop the timer: On the "countdown" layer, create a trigger to jump to time - start of timeline on this layer - when the timeline ends on this layer.

    On any subsequent slides, you will need to reset the timer variable back to its default value (e.g. 60) when the timeline starts on the new slide, which will let the timer start over again. I attached a sample for you. Hope that helps!