Storyline 360 Tutorial

How to Start and Reset Timer Setup in Storyline 360 Using JavaScript

Tracking active time spent on assessments, simulations, or interactive modules gives instructional designers valuable insights into learner behavior. While Articulate Storyline 360 offers native player timers for timed quizzes, implementing custom JavaScript controls provides complete flexibility to start, pause, and reset timer functionality based on specific user actions.

By initializing a global JavaScript timer instance on the slide master, developers can seamlessly update Storyline variables in real time.

Core Benefits of Custom JavaScript Timers

  • ✓
    Flexible Control

    Allows learners or system triggers to start, pause, and reset elapsed time without resetting slide progress.

  • ✓
    Performance Analytics

    Correlates exact time spent on specific interactive scenarios with final assessment scores.

  • ✓
    Adaptive Pacing

    Enables custom triggers to direct fast or slow learners to targeted remedial content based on elapsed time values.

Step-by-Step Implementation Guide

  1. 01

    Set Up Variables and Slide Master Interface

    • Create a dynamic Text variable named timer with an initial default value of 00:00:00.
    • Open Slide Master view and insert two control buttons: Start and Reset.
    • Place a text reference box containing %timer% on the slide overlay to display active elapsed time.
  2. 02

    Initialize Timer Script on Timeline Start

    Add an Execute JavaScript trigger on the Slide Master set to run when Timeline starts:

    window.gameTimer = window.gameTimer || (function () { let sec = 0; let timerId = null; let isRunning = false; 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++; const player = GetPlayer(); player.SetVar("timer", formatTime(sec)); } }, 1000); } isRunning = true; } function pause() { isRunning = false; } function reset() { if (timerId !== null) { clearInterval(timerId); timerId = null; } sec = 0; isRunning = false; const player = GetPlayer(); player.SetVar("timer", formatTime(sec)); } return { start, pause, reset }; })();
  3. 03

    Configure Start, Pause, and Reset Button Triggers

    • Start Button Trigger: Set action to Execute JavaScript when clicked, using code: gameTimer.start();. Add a toggle condition to execute gameTimer.pause(); if clicked again while active.
    • Reset Button Trigger: Set action to Execute JavaScript when clicked, using code: gameTimer.reset();.

Script Functions and Variable Mapping

Function / Component Technical Purpose
formatTime(totalSeconds) Converts raw incremental seconds into standard digital clock format (HH:MM:SS).
setInterval() Increments active counter variables once every 1000 milliseconds while isRunning evaluates to true.
player.SetVar("timer", ...) Updates the active Storyline text variable so elapsed time renders live on screen.
clearInterval() Stops active background interval execution loops when the reset trigger fires.
FAQ

Frequently Asked Questions

Are custom JavaScript timers compatible with published SCORM packages?

Yes. JavaScript triggers run natively inside standard HTML5 course outputs across desktop and modern mobile web browsers.

Can I pass the final elapsed time variable value to an LMS?

Yes. You can send the final value held inside your custom timer variable to your LMS via standard SCORM cmi.suspend_data or cmi.interactions reporting triggers.

Why is it recommended to initialize the timer on the Slide Master?

Initializing on the Slide Master prevents duplicate interval instances from spawning when learners navigate across different slides in the course.

Related Solutions

Explore Related eLearning Solutions

Custom E-learning Solutions

Transform organizational knowledge into high-impact digital learning experiences engineered to scale across multi-device environments.

Learn more about Custom E-learning Solutions

Learning Management System (LMS)

Optimize enterprise training distribution, automate compliance monitoring, and gain clear visibility into workforce performance.

Learn more about Learning Management System (LMS)

Off-the-Shelf Courses

Accelerate skill development using a pre-configured library of interactive, SCORM-compliant training modules ready for LMS integration.

Learn more about Off-the-Shelf Courses
Get in Touch

Ready to Transform Your Training?

Get a tailored project proposal, custom timeline, and a free SCORM sample built directly from a slice of your existing training materials.

  • Free Proof-of-Concept

    Send us a short document or presentation, and we'll transform it into an interactive SCORM sample so you can judge our instructional design.

  • Expert Consultation

    Talk directly with our eLearning specialist to align your business goals with the right technology stack.

  • Transparent Pricing

    Clear cost estimates and realistic project milestones delivered with zero hidden fees.

Prefer direct email? Reach our lead team at [email protected].

Send Us a Message

Fill in a few details and we'll get straight back to you.