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
-
01
Set Up the Sequence Drag-and-Drop
Create your slide layout in Storyline 360 with draggable elements and target zones.
-
02
Insert and Disable the Custom Submit Button
- Draw a shape or button component and label it Submit.
- Change its Initial State to Disabled.
-
03
Create the Control Variable
Open the Variables window and add a new boolean flag:
- Name:
submitEnabled - Type: True/False
- Default Value: False
- Name:
-
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); -
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. |
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.