timer
2 TopicsHow to Create a Timer in Storyline
This week's tip comes from our certified training partner, Yukon Learning. Imagine you're creating a course for a group of new hires in a fast food restaurant whose jobs will require that they manage multiple things -- refilling French fry containers and keeping an eye on the fryer while also fulfilling orders and getting them out to the waiting customers. An e-learning course where workers can practice what they need to do in that situation is an effective way to help them learn how to do the job. They won't have the stress of the live work environment, and the restaurant hopefully won't have as much food waste because learners will know how to manage the time. The key element in this scenario is that in the real world, time can "run out" in a number of ways: the fries burn, the hamburgers get cold, the customers get angry. We can simulate the experience of time running out by creating a timer on a slide. In this video, you'll learn how to: Create a timer using number variables and layers Ensure the timer stops at 0 Determine what happens when time runs out Accessibility Disclaimer: Timers really aren't accessible. They can cause all kinds of problems for all kinds of learners. That said, timers are one of the elements of gamified learning, and can be part of a real learning experience. The Articulate CommunityTeam suggested these tips for working with timers in e-learning: Allow learners to opt out. Timed challenges can be an accessibility issue for some learners. So if the limit isn’t a legal requirement, consider including a way to turn it off. Only include timers when it improves learning. A little time stress goes a long way. It’s best to save this feature for instances where meeting a time limit connects strongly to learning goals. Don’t make it too hard. Ensure the limits you do use are realistic and achievable. If it’s too hard to meet the requirements, your time limit could cause learners to tune out instead of engage. Resources: Yukon Learning YouTube Channel Sign Up for Facilitated Certified Training163Views0likes0CommentsJavaScript Timer Question
Hello! I'm new to using JavaScript in Storyline. But after watching a Learning Dojo video and using Claude to help me put some code together, I was able to come up with the following code to use in an "execute JavaScript" trigger that happens when the learner clicks the Start button for a matching game. My goal is to start a timer when they start the game. It counts in seconds and shows on the screen as they go through the game. When the learner completes the game, it shows them how many seconds it took them. All of that works one time. But if the learner clicks to restart the game, the original timer is still counting from the first go-around, plus a new timer is started, such that it flashes back and forth between one counter and the other. I can't figure out how to stop the timer, reset it, and allow them to start over. Claude suggested the code where it "clears any existing timerId stored in Storyline" -- but while a new timer starts, the old one still keeps going. Is there any solution to this? Thanks for any help! //Getting the player const player = GetPlayer(); //Where to start let sec = 0; //Set up the timer function startTimer() { sec += 1; player.SetVar("timer", sec); } //Clear any existing timerId stored in Storyline let existingTimerId = player.GetVar("timerId"); if (existingTimerId !== null && existingTimerId !== undefined) { clearInterval(existingTimerId); } //Reset the counter sec = 0; player.SetVar("timer", sec); //Start the timer and store the ID in Storyline let timerId = setInterval(startTimer, 1000); player.SetVar("timerId", timerId);Solved758Views1like2Comments