Saving variable values before exiting a page

Oct 27, 2021

I'm having this weird "How have I not seen this before" moment.  I'm finding that my SCORM course will not save the variables I set on a page unless a learner leaves that page.  Is it expected that a learner must complete an interactive page and then hit previous or next to get credit (vars saved)?  If I click some or all the buttons, click previous, then back forward to the interactive page, the buttons are in their correct state.

Here's a bit more detail...the page is a basic 3-button click-to-reveal.  Each button opens a content layer where I set a variable (true/false) that the button has been clicked and change the button to a completed state.  I have triggers on the base layer to set the buttons to completed based on those variables values so when revisiting, the learner doesn't have to click on them again.  It's a pretty straight-forward build.

If this is simply "working as designed", has anyone built a work-around?  I've tried various different methods of calling LMSCommit() in a JS trigger, but it didn't save the variables.  I've bounced a learner back to the my interactive page by triggering a "jump to slide" when they close the layer.  The trigger takes them to a page that immediately triggers a "return to previous slide".  Technically it works, but displays a brief "blink" while the learner is bouncing from page to page.

 

 

6 Replies
Lauren Connelly

Hello Brian!

I'm happy to help! The value of a variable depends on the triggers that include the variable. If the value of the variable isn't saving, then it might need a quick adjustment to a trigger. 

Lastly, is the When Revisiting set to "Reset to Initial State," "Resume to Saved State," or "Automatically Decide?"

If you can share your project with us, that would be helpful. You can attach the .story file to this public discussion or upload it privately in a support case.

Brian Roemer

Thanks so much for reaching out Lauren! Let me clarify the issue a bit
more. The triggers, variables, and conditions all work as I expect. The
overall visual behavior of the page is functioning as intended.

The issue arises if a learner exits my course *from* my interactive page
*without* turning the page. In that case, upon relaunching the course, the
page loads as if it's the first time they've visited. It's like the
variables I set during their first visit aren't available for my page to
use.

What I'm discovering through other forum posts is that Storyline won't save
the variables values I've set on that interactive page until the learner
has moved off of that page. Apparently, the act of turning the page is
what adds those variables values to the resume data sent to the LMS.

SO, this may all be a "working as design" situation. Through my testing on
SCORM Cloud, if I complete my interactive page (3 buttons displaying 3
content layers), click Next, and then Previous to return to my interactive
page, all my buttons appear as completed because I have access to those
variables I set previously. The act of clicking the next button seems to
save those variables values to the resume data set.

My ultimate questions are:
1. Is what I'm experiencing the intended design of Storyline?
2. If so, is there a way to "force" a push of variables on a page, before
they click Next?

I'm happy to share one of my modules privately with ELH.

BrianR

Brian Roemer

Got it, thanks Phil.  That's definitely what I'm seeing in my testing.  It's good to have that confirmation.  I'll continue developing my workarounds.  I'd really like to allow my learners complete part of an interaction, exit the course from that page, and then return with their progress saved.  I know that "Resume saved state" is an option on the base layer, but that causes a separate set of issues.

Phil Mayor

Resume saved state should work on layers as well. I hit this problem a few years back and tried what I could. Jumping slides is the only thing I could find worked. I am wondering now if showing a light box slide and closing it would do the same thing (never tried that) as it is possible with JavaScript to make the slide transparent so the user would never know.

If not you have the solution that definitely works, the other option which I have used is that the slide they jump to is a duplicate of the slide you have so they complete one bit and then jump to a replica and complete the next bit and yo yo back and forwards. Would need some triggers to changes states on timeline start but may work for you.

Sent from my iPhone

Brian Roemer

Thanks again Phil. Yes, I've got the "bounce back" technique working
pretty well. When I close a slide layer, instead of using the close layer
trigger, I jump to that alternate page. The alternate page immediately
triggers and returns me to my interactive page.

Your idea about the light box is accurate. Thanks another one of the
workarounds I've been pursuing today. SL does consider a lightbox a page
turn, so that's an option as well.

I couldn't help but laugh at the yo yo idea, but heck, if it works!!

BrianR