Storyline 360 Tutorial

Using JavaScript to Control Submit After Learner Interaction in Drag-and-Drop Activities

By default, Articulate Storyline 360 allows learners to click the Submit button on a quiz or interaction slide immediately even before moving any elements on the screen. This often leads to accidental submissions, incomplete participation, and diminished learning retention.

Integrating a lightweight JavaScript listener alongside native Storyline variables ensures that the Submit button remains disabled until a learner actively drags an item out of its starting container.

Watch Tutorial
See the JavaScript listener and trigger setup in action.

Why Enforce Interaction Before Submission?

  • ✓
    Prevents Accidental Submissions

    Stops learners from clicking submit prematurely before interacting with the slide mechanics.

  • ✓
    Improves Learning Retention

    Ensures learners complete hands-on problem-solving exercises rather than bypassing content.

  • ✓
    Maintains Assessment Integrity

    Guarantees that submitted answers reflect deliberate drag-and-drop placement attempts.

Step-by-Step Configuration Guide

  1. 01

    Set Up the Sequence Drag-and-Drop

    Create your slide layout in Storyline 360 with draggable elements and target zones.

  2. 02

    Insert and Disable the Custom Submit Button

    • Draw a shape or button component and label it Submit.
    • Change its Initial State to Disabled.
  3. 03

    Create the Control Variable

    Open the Variables window and add a new boolean flag:

    • Name: submitEnabled
    • Type: True/False
    • Default Value: False
  4. 04

    Attach the JavaScript Execution Trigger

    Create a trigger: Execute JavaScript when Timeline starts on this slide. Add the following code snippet:

    const container = document.querySelector('.sequence-ctrl-scroll-area-contents'); const checkInterval = setInterval(() => { const draggableItems = document.querySelectorAll('.sequence-ctrl-drag-container'); let anyOutside = false; draggableItems.forEach(item => { if (!container.contains(item)) { anyOutside = true; } }); if (anyOutside) { clearInterval(checkInterval); console.log('Item moved out of container. Enabling Submit.'); setVar('submitEnabled', true); } }, 300);
  5. 05

    Set the State Change Trigger

    Add a Storyline trigger to activate the button once the variable updates:

    • Action: Change state of Submit Button to Normal
    • When: Variable changes (submitEnabled)
    • Condition: submitEnabled == True

Video Demonstration

Watch the step-by-step setup in action:

Troubleshooting & Implementation Checkpoints

Checkpoint Problem Solution
Initial Button State Button is clickable on slide load. Confirm the initial state is set to Disabled in the States panel.
Variable Name Case JavaScript fails to update the variable. Ensure submitEnabled in JS matches the Storyline variable name case-sensitively.
Preview vs Published Script behaves differently in preview mode. Test output via published HTML5 (story.html) to ensure correct browser DOM execution.
FAQ

Frequently Asked Questions

Where do I access variable settings in Articulate Storyline 360?

Access the Variables manager by clicking the manage variables icon located in the upper-right corner of the Triggers panel.

Does this script work with standard freeform drag-and-drop slides?

This specific script targets class selectors present in sequence drag-and-drop activities. For standard freeform drag-and-drops, native Storyline object drop triggers can be used without requiring custom JavaScript.

Will this customization work across standard mobile web browsers?

Yes. The DOM query script executes natively in modern mobile and desktop browsers rendering HTML5 content.

Turnkey Safety & Enterprise Training Suites

Off-the-Shelf Occupational Health and Safety (OHS) Courses

Workplace Safety & Health (OHS) Suite

SCORM-compliant safety modules engineered for immediate LMS integration across operations, manufacturing, and distribution:

  • WHMIS standards, hazardous material handling, and chemical spill control protocols.
  • Workspace ergonomics, heavy lifting techniques, personal protective equipment, and first-aid response.
  • Fall protection standards, elevated platform safety, and lockout/tagout (LOTO) procedures.
Free Professional Development Modules

Corporate Leadership & Upskilling Series

Targeted professional development packages designed for corporate teams:

  • Executive leadership development, crisis communication, and cross-departmental alignment.
  • Workplace ethics, data security policies, and dispute resolution frameworks.
Related Solutions

Instructional Design & eLearning Services

Custom Course Development

Modern eLearning architectures tailored to organizational learning objectives and compliance requirements.

Learn more about Custom Course Development

Learning Management System (LMS)

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

Learn more about Learning Management System (LMS)

Global Content Localization

Full translation, audio dubbing, and localized layout adaptation across multi-language SCORM modules.

Learn more about Global Content Localization
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.