Tracking time in e-learning courses can greatly enhance learner engagement and provide valuable insights into learner behavior. In Articulate Storyline 360, you can easily set up a Start and Reset timer using JavaScript without complex coding.
Click Preview to watch how to Start and Reset Timer Setup in Storyline 360 Using JavaScript.
In this article, we will show you through a step-by-step process to track time effectively in your Storyline 360 course.
Why Tracking Time Matters
Whether you’re creating quizzes, interactive scenarios, or timed assessments, monitoring how long learners spend on each activity can help:
1. Improve engagement: identify sections where learners spend too little or too much time.
2. Measure performance: correlate time spent with quiz results to spot areas for improvement.
3. Enable adaptive learning: customize content based on learner pacing.
With JavaScript integration, Storyline 360 offers a flexible way to create timers that respond to user actions like Start, Pause and Reset.
Step-by-Step Guide: Implementing a Timer in Storyline 360
Step 1: Prepare Your Storyline Project
- Open Your Project: Launch Articulate Storyline 360 and open the project where you wish to add the timer.
- Navigate to the Slide Master: Go to the View tab and select Slide Master to make global changes.
Step 2: Add Start and Reset Buttons
Insert two buttons:
- Start – to begin or pause the timer.
- Reset – to restart the timer.
Rename the buttons clearly for easier trigger setup.
Step 3: Create a Timer Variable
- Create a text variable, e.g., TimerText, with a default value of 00:00:00.
- Place this variable in a visible location on the slide to display the elapsed time.
Rename the buttons clearly for easier trigger setup.
Step 4: Add JavaScript Trigger for Start Button
- Select the Start button and create a trigger to execute JavaScript when it’s clicked.
- Set the trigger condition so it only runs if the Start button is in the ‘Selected’ state.
- Open the JavaScript editor and paste the following code:
gameTimer.start();
- Add an Else condition trigger to allow pausing the timer when clicked again.
gameTimer.pause()
Step 5: Add JavaScript Trigger for Reset Button
- Select the Reset button and create a trigger to execute JavaScript when clicked.
- Paste the reset script:
gameTimer.reset();
- Add another trigger to return the Start button to its ‘Normal’ state when Reset is clicked.
Step 6: Initialize Timer on Timeline Start
- Create a trigger to execute JavaScript when the slide timeline starts.
- Paste the initialization code to prepare the timer without starting it automatically.
window.gameTimer = window.gameTimer || (function () {
let sec = 0;
let timerId = null;
let isRunning = false;
// Helper function to format seconds to HH:MM:SS
function formatTime(totalSeconds) {
const hrs = Math.floor(totalSeconds / 3600);
const mins = Math.floor((totalSeconds % 3600) / 60);
const secs = totalSeconds % 60;
return [hrs, mins, secs]
.map(unit => unit.toString().padStart(2, ‘0’))
.join(‘:’);
}
function start() {
if (!timerId) {
timerId = setInterval(() => {
if (isRunning) {
sec++;
setVar(“timer”, formatTime(sec));
}
}, 1000);
}
isRunning = true;
}
function pause() {
isRunning = false;
}
function reset() {
if (timerId !== null) {
clearInterval(timerId);
timerId = null;
}
sec = 0;
isRunning = false;
setVar(“timer”, formatTime(sec)); // Reset display to “00:00:00”
}
return {
start,
pause,
reset
};
})();
Step 7: Preview Your Course
Close the Slide Master.
Preview your course.
- Click Start to begin or pause the timer.
- Click Pause to stop the timer at any time.
- Click Reset to restart the timer at any time.
Quick Tips for eLearning Developers
1. Make sure your variable is displayed clearly on the slide.
2. Test both Start and Reset buttons to ensure smooth functionality.
3. Use conditions if you want the timer to pause or stop under specific scenarios.
Conclusion
Setting up a Start and Reset timer in Storyline 360 using JavaScript is quick, efficient and highly effective for eLearning developers. Timers help track learner engagement, improve quiz performance and add interactivity. By following these steps, you can implement a seamless, user-friendly timer in your courses.
Frequently Asked Questions (FAQs)
Q1. How do I add a timer in Storyline 360?
A. You can add a timer by creating a text variable to display elapsed time and using JavaScript triggers for Start and Reset buttons. This approach updates the timer dynamically as learners interact with your course.
Q2. Does the timer work in SCORM-compliant courses?
A. Yes. JavaScript timers are fully compatible with SCORM and xAPI and Storyline variables tracking time can be reported to your LMS.
Q3. Why should I use a JavaScript timer instead of Storyline’s built-in timer?
A. JavaScript timers offer more flexibility, including Start, Reset and custom timing conditions, allowing for interactive control over how time tracking behaves in your eLearning course.
Q4. Can I track quiz time in Storyline 360?
A. Yes! By integrating a timer with JavaScript, you can monitor how long learners spend on quizzes or individual slides, helping measure engagement and performance.
Q5. Does using JavaScript affect Storyline 360 course publishing?
A. No. JavaScript triggers work in HTML5 output, which is the standard publishing format for Storyline 360 courses. Make sure scripts are tested before final publishing.

