Get LMS Status

Nov 30, 2012


I'm trying to figure out how to retrieve the LMS status for the course (Completed, Unsuccessful, etc) so that I can control user navigation if the user did not pass the course on the previous attempt.

I used:

var studentStatus = lmsAPI.GetStatus();

In an Execute Javascript slide trigger and then create studentStatus as a variable in the regular part of Storyline.

When I enter a text field with


and test in the LMS, the text field is always populated with:


regardless of my status. I've tried to change the variable name to no avail. Where is that 4 coming from, or even better, how can I retreive the lms status and assign it to a variable?


7 Replies
Steve Flowers

Hi, Karessa - 

Here's the status translation on that value. Open the constants.js file within the LMS folder for these:

var LESSON_STATUS_PASSED        = 1; //the user completed the content with a score sufficient to pass

var LESSON_STATUS_COMPLETED     = 2; //the user completed the content

var LESSON_STATUS_FAILED        = 3; //the user completed the content but his/her score was not sufficient to pass

var LESSON_STATUS_INCOMPLETE    = 4; //the user began the content but did not complete it

var LESSON_STATUS_BROWSED       = 5; //the user looked at the content but was not making a recorded attempt at it

var LESSON_STATUS_NOT_ATTEMPTED = 6; //the user has not started the content

Steve Flowers

Well, that's the way it worked in Presenter a couple of years back. Looks like a value is coming in so I'd assume it's setting things up the right way. You might try running a JavaScript trigger to force completion first if you're running the Flash based player.

You can hijack the same function Flash uses:

//We're going to leverage the published output method to update status from Flash

//The delimiters need to be setup just like this to jam in the array. totalScore can be handjammed into a variable in the trigger or extracted using the GetVar() method.


//first argument is status: complete

//second argument is score

//third and fourth are min / max

//fifth is passing score

//sixth is type

Nick Moffitt

Hi Karessa and Steve,

I need to solve the same problem that Karessa describes, and I'm tantalizingly close to a solution (thanks to your exchange), but I can't quite figure out the lmsAPI.GetStatus(); call. I've got the status variable declared, but I can't seem to get the lmsAPI call to return anything. I've had luck with other examples that use player.GetVar and player.SetVar, so I think I understand the mechanics of it. I'm using the Inquisiqr3 LMS (SaaS); does every LMS support lmsAPI calls?

One thing that's confusing me is the var declaration in front of the lmsAPI call; it seems as though the status variable is var-declared in the Variable Manager dialog and should then simply be assigned in the JavaScript. I'm guessing there's more to it than a single line in the JS trigger. Sorry to ask such basic questions, but the JS part of this is foreign to me and I'm hoping to avoid getting immersed (mired?) in it until after the current deadline.

Any chance you could be more specific on the JavaScript for the trigger that polls the lesson status? Or maybe a shove in the right direction?

Thanks much!

Steve Flowers

Hi, Nick - 

All LMS that support SCORM support LMS API calls. It's how the LMS and SCORM content packages communicate. We use Inquisiq as well

Try this as a quick test -- Construct a JavaScript trigger with contents:


...just to see what it returns for you. I'll run a quick test when I get into the office to see how it behaves for me.

Nick Moffitt

Hi, Steve;

Thanks for the quick reply. The good news is that your suggestion works; I get the PASSED and INCOMPLETE responses that I expect. The bad news (for me) is that success is computer- and browser-specific. As luck would have it, it does not work in Chrome on the system I was using for development. That was a surprise, because Chrome has always run my content reliably. When I rerun my first attempts in IE, they work. 

Anyway, thank you very much for the help.


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