Skip to main content
Known Participant
August 18, 2014
Question

communication with lmsAPI scorm variables

  • August 18, 2014
  • 1 reply
  • 738 views

sorry to ask this again, but this is a very important point we need to solve before starting to develop dozen of courses switching from Storyline to Captivate.

We have convinced our partners to switch to Captivate for several reasons, mainly for the better experience in the html5 version for mobile devices that is more stable and (apparently) less buggy than Storyline.

What we miss to be ready to develop, is to understand how to use javascript to communicate with lmsAPI to read/write on scorm variables. While these informations are clear and easy enough to find on Storyline forum (there are several examples provided), here we cannot find any reference or help on how to do achieve this. So, again I ask if someone has ever developed a simple javascript sequence of commands to read/write scorm variables from/to LMS for different purposes.

I searched all over the help section and couldn't find any reference.

Without these informations we will be forced to stay developing over with Storyline...

many thanx for any help

    This topic has been closed for replies.

    1 reply

    Known Participant
    August 20, 2014

    answring to myself, i found this useful reference for using Javascript in Captivate.

    http://helpx.adobe.com/captivate/using/common-js-interface.html

    after different tryouts, i also found that native scorm functions are defined into scormdriver.js (published into the scorm package) and examining that file you can find the way to achieve several operations on scorm variables.

    Those functions can be called into the javascript window (by executing javascript command using an advanced action) as they are defined inside the scormdriver.js.

    Example:

    SetObjectiveScore("id1", 20, 30, 0);

    will behave as it is supposed by scorm data model specification, for a scorm 1.2 package it will do the following on the LMS (just tested on Moodle):

    LMSSetValue("cmi.objectives_0.id", "id1")

    LMSSetValue("cmi.objectives_0.score.raw", "20")

    LMSSetValue("cmi.objectives_0.score.max", "30")

    LMSSetValue("cmi.objectives_0.score.min", "0")

    all those Captivate lms native functions are evaluated so that, depending on the scorm version you are publishing, they are automatically translated to fix the appropriate syntax for the corresponting scorm data model (there are some differences betweeb scorm 1.2 and scorm 2004 when setting some parameters, and also scorm 2004 have more variables available).

    Hope this can help.