Storyline Variables and SCORM

Oct 22, 2012

Is there an interface API in Storyline which might allow populating a Storyline variable with a value stored in JavaScript?  My particular example would be retrieving any of the: [Student name, Lesson Status] from the SCORM LMS and making it available to the course automatically.

I am OK writing the SCORM JavaScript to retrieve the values into a known global variable.  What I lack is a mechanism in Storyline to retrieve those values and insert in a Storyline variable.

54 Replies
Sam Carter

OK and thanks.  This is great news.  My next thought is how can this capability be extended so it doesn't require hand-editing the html every time the course is published.  I publish a course on an average of 10-20 times before it meets final approval, so every hand-edit is multiplied.

Here's a suggestion:  Could Storyline "attach" a JavaScript the same way it AP attached external documents?  

Alexandros Anoyatis

Unless I am missing something regarding your requirements, setting a Script to run once (e.g slide 1 only) to retrieve and pass these values on a storyline variable, would achieve what you want. You should be able to do this within storyline, without the need to edit/change any HTML files.

Hope this helps,


Juanjo Haro


Is there some API instruction to get and set data to the suspend_data in LMS?

What i'm trying to do is store some kind of array like "true,false,true,false", on item for slide to recover that when the course begin and change with these value the item of a menu to visited or completed... i don't know how to do that in another easy way...

I can write comments with lmsAPI.WriteComment but i can recover the info in it with lmsAPI.GetComments... something wrong i'm doing?

var myName = lmsAPI.GetComments();

var array  = myName.split(',');

var newName = array[1] + '  ' + array[0];

player.SetVar("newName", newName);

alert("nombre 1 "+ newName);

player.SetVar("nombre", newName);

Steve Flowers

Hi, Jaunjo - 

I'm still not completely clear on what you're trying to do. The stuff you're talking about:

- Course location

- Visited slides

- Variables you add

Are all automatically pushed and pulled from suspend data. It's not in a clean, readable array, but it's there. I think trying to override that is going to cause more pain than it solves. 

Juanjo Haro

I'm sorry i can't explain :(

Let's see more graphic...

I have a menu of five items with five icons. every icon has red,yellow and green states

Enter a slide will write in suspend data a false in the position of the slide:

Finishing a slide will write a true in the position of the slide:










true,true,true,true,true --> all slides done and this is the array stored in the suspend data

Every time the course starts, i read that array and with these values i can change the color of the icon

none = red

false = yellow

green = true

The problem with the actual array is that i can read it or i don't know

And the most important, our client wants to have the suspend_data in this way (i don't know why maybe for their saba lms or whatever) and the sad is that i can't do test with the client. The monday there is a meeting and we have to say that we are able to addapt a system that works fine and can export html5 for their ipads.

Storyline was my hope but it seems not if i can solve this :(

Juanjo Haro

Yes, and i know how to do this within the course but my problem is to keep this when the student closed the course. Where i can store variables in the LMS to recover later and how... some function, something? Can you post and little example. I post what i doing in that file.

Steve Flowers

Any variables you set are automatically retained in suspend data. So take this instance, for example:

1 - I create true / false variables called section1, section2, and section3 and default them to false

2 - at the end of section1, I use a trigger to set section1 to true. Same with the other 2 sections.

3 - on my menu page, I setup three triggers. When the timeline starts, set objectSection1 (a shape I made) to state "done" (a state I made within the shape) if section1==true. 

4 - I make a copy of the shape and the trigger and change the respective variables and object targets.

Now when I push this to the LMS, it'll remember the variable settings and give me the appropriate visual cue.