Setting, and getting, multiple variables to/from an LMS using Articulate Storyline

Mar 03, 2015

I have seen various methods of using java script to get things like, the learners name from the LMS into Storyline, and I have also seen this

Which shows how to send a variable into the LMS.

However, after much searching, I am unable to find a proper input/output system for multiple custom variables. I am expecting this is possibly a limitation of LMS/storyline/scorm systems.


What I would like to do, is be able to send a bunch of variables, such as say, a characters statistics, into the LMS, and then retrieve them, possibly in an entirely different SCORM package to the one that put them into the LMS in the first place. So you could create a character, define things about him throughout the first SCORM package you run through, and then later on, open another SCORM package, and the same character, complete with everything that happened during the last package, would be 'loaded up'

Essentially a persistent set of variables per learner

Anyone think this is do-able, or am I simply dreaming?

Or, am I really silly, and there is a way to keep such data in a pre defined way I am not aware of.

Thanks in advance.

20 Replies
Midi Prefix

As suggested here

by staff member Emily Burnett.

I am using Articulate Storyline (to be specific, Storyline 1 actually as we haven't chosen to update since 2 came out)

And Moodle LMS.


If that helps anyone with a response.

Thanks folks.

Midi Prefix

Ok, I will try to explain further, though I kind of think what I want to do just does not exist.

This link

Explains how to SET variables into an LMS, which is great, that's half of what I want done right there, awesome.

But, now, how do I then GET that variable back into storyline?

Can I use this method?

Or does that lack the ability to grab a variable that has been stored as a short answer as explained in the first link up there?

What commands would I use to get hold of that variable I stored in the LMS?

Is there something like 

var player = GetPlayer();

var myName = lmsAPI.GetStudentName();


That I could use to grab something other than the name?

var myName = lmsAPI.GetShortAnswerResponse(AnswerID);

Or something like this?


Steve Flowers

Well... I believe the SCORM published output conforms to SCORM 2004 in packaging (basic) and communication (also basic). The shared data bucket is *still* sandboxed within the same published SCO. So to get that to work in SL you'd need to specifically reference the API in Javascript and use an alternate packager to build a multi-component SCO.

Midi Prefix

Awesome, thanks for replying guys. I did think about using an external database, grabbing the user IDs using javascript etc, and using that to store these variables per user.

Steve's solution, to be quite honest, seems entirely beyond my (current) ken in this department.

I'm not actually sure the best method to start reading/writing from a database using Storyline, but I guess that is a different thread, which may already exist, so I won't go off topic too much.


Thanks again for the replies guys.

Artur Trzebunia

I've read through all of these posts, and I understand well what Midi Prefix is wanting to achieve. I don't know if and how this may be accomplished using Storyline, but I do know that this can be accomplished using Flash and Actionscript. I know, this is outdated technology and language, and I'm not suggesting that you use Flash and Actionscript. I'm only saying that the idea of storing custom variables in an LMS and retrieving them later in another session is possible.

In short, the way it works with Actionscript is the variable values are stored in an array in the LMS. Upon returning to the course, Actionscript parses the array into the actual variables and their last saved values. It's that simple. I don't know what the equivalent js syntax would be to:

  1. save last state of a variables before exiting the course
  2. store those variables in an array (in LMS)
  3. parse the array into variables and last stored values upon returning to the course

I don't know if this is helpful at all, but I'm also looking for a solution like this that would open up a world of gamification options across multiple courses using Storyline.

See attached AS2 code of how this is done in Flash. I have a few hundred variables in this course, and you can see toward the bottom how they're stored and then retrieved with the last stored value.

Steve Flowers

Hi Artur - 

The Storyline player (Flash and HTML versions) already stores variable values in the LMS suspend data field. By adding a variable and updating the value of the variable using a trigger, the value will be stored in the LMS and will be restored in another session.

What Midi is referring to is accessing the variables in between two courses. Since SCORM sandboxes data, data stored from one course can't be accessed from another course. 

Using Actionscript, you could use a local storage option but this presents problems if the user isn't using the Flash player or is accessing the course from a different machine. Local storage (using HTML5 or Flash local storage) could be a good solution in some cases. But it's something I'd be really leery of implementing.

SCORM is going to be replaced soon. CMI5 uses xAPI as part of the stack. The spec is built for allowing access to data across different experiences. Once CMI5 and xAPI start to get a foothold, SCORM vaults will be less of a problem.

In the mean time, if you have access to an LRS and want to communicate across SCO's you could wrap your SCO in an xAPI wrapper and point the course at an LRS. There are some examples on ADL's site. There's a description of how it would work here:


Steve Flowers

Hi Mohamed - The ability to pull SCORM variables from other LO sessions is a SCORM limitation, unfortunately. Because the specification sandboxes each launch, there wouldn't be a way to do that using SCORM. 

However, you could build-on an interface with an external database, send from each LO item to that database, and pull from the database back into your LOs. There are a few ways to do this including xAPI or web services databases like Firebase. If you get clever with the I/O you could even use Google Forms/Spreadsheets.

All of this takes some design and code work. It isn't built into Storyline. SL will let you do it:)

This discussion is closed. You can start a new discussion or contact Articulate Support.