Storyline 360 Tutorial

Sending Learner's Score to LMS Using JavaScript in Articulate Storyline

When building assessments in Articulate Storyline 360, the software natively tracks quiz scores through built-in Results Slides. However, default result variables are locked by Storyline, preventing instructional designers from modifying score calculations or transmitting custom scoring logic directly to a Learning Management System (LMS).

By executing custom JavaScript that calls the SCORM lmsAPI wrapper, developers can send custom calculated score variables directly to the LMS database.

When to Use Custom JavaScript Score Tracking

  • Custom Scoring Logic:

    Awarding weighted scores, partial credit, or non-standard points calculated outside default quiz templates.

  • Multi-Branching Scenarios:

    Aggregating dynamic points gathered across complex narrative choices or interactive simulation paths.

  • Pre-Assessment Overrides:

    Sending customized diagnostic or baseline scores directly to the LMS reporting table.

Step-by-Step Configuration Guide

  1. 01

    Create the Custom Score Variable

    Open the Variables Manager in Storyline and create a new Number variable (e.g., Score) to hold your custom calculated point total.

  2. 02

    Configure the Execution Trigger

    • On your custom results or submission slide, add a new trigger.
    • Set the trigger properties:
      • Action: Execute JavaScript
      • When: Timeline starts
      • Object: Results slide (or target submission slide)
    Storyline Trigger Wizard with Action set to Execute JavaScript, When set to Timeline starts, and Object set to the 2.11 Results slide
  3. 03

    Insert the SCORM API Script

    Click the JavaScript link in the trigger wizard and insert the following code snippet:

    var player = GetPlayer(); // Syntax: lmsAPI.SetScore(Score, MaxScore, MinScore) lmsAPI.SetScore(player.GetVar('Score'), 100, 80); lmsAPI.CommitData();
  4. 04

    Adjust Publishing Tracking Settings

    To prevent Storyline from overwriting your custom JavaScript score with its default quiz calculation:

    • Click Publish and select the LMS tab.
    • Under Tracking Options, select Track using number of slides viewed instead of Track using quiz results.
    Storyline Reporting and Tracking Options dialog with Track using number of slides viewed selected instead of Track using quiz result
  5. 05

    Handle Legacy Exit Score Overrides (Optional)

    In legacy output builds (such as Storyline 2 Update 9 and earlier), clicking a native "Exit Course" trigger can reset reported scores to zero when tracking by slides viewed. To bypass this, replace the native exit trigger with a Jump to URL trigger targeting: ./lms/goodbye.html.

    Storyline Trigger Wizard with Action set to Jump to URL/file and the File field set to ./lms/goodbye.html

Code Breakdown and Function Reference

Function / Object Technical Description
GetPlayer() Fetches the active Storyline player instance, granting access to internal project variables.
lmsAPI The core SCORM API interface object handling communication between the Storyline package and the LMS.
SetScore(score, maxScore, minScore) Sends score parameters to the LMS: earned score, maximum possible score, and passing threshold.
CommitData() Forces the LMS API to immediately save all queued tracking data into the database.
FAQ

Frequently Asked Questions

Will this script work with both SCORM 1.2 and SCORM 2004 LMS packages?

Yes. The lmsAPI object abstracts the underlying SCORM wrapper calls, ensuring standard score reporting across SCORM 1.2, SCORM 2004, and AICC publishing formats.

Can I pass dynamic values for maxScore and minScore using variables?

Yes. You can replace the hardcoded numbers (100, 80) with variables fetched via player.GetVar('MaxScore') and player.GetVar('MinScore').

Related Solutions

Explore Related eLearning Solutions

Custom E-learning Solutions

Build courses global-ready from the start, designed for localization day one.

Learn more about Custom E-learning Solutions

Learning Management System (LMS)

Simplify training administration, track employee compliance effortlessly, and deliver engaging digital learning.

Learn more about Learning Management System (LMS)

Off-the-Shelf Courses

Explore our comprehensive library of off-the-shelf eLearning courses.

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.