It's a module wrapper for the wonderful Pipwerks api wrapper.
npm install --save pipwerks-scorm-api-wrapper
import {SCORM} from 'pipwerks-scorm-api-wrapper';
SCORM.init();
var name = SCORM.get('cmi.core.student_name');
SCORM.set('cmi.core.lesson_status', 'completed');
SCORM.save();
SCORM.quit();
pipwerks.SCORM.init = pipwerks.SCORM.connection.initialize;
pipwerks.SCORM.get = pipwerks.SCORM.data.get;
pipwerks.SCORM.set = pipwerks.SCORM.data.set;
pipwerks.SCORM.save = pipwerks.SCORM.data.save;
pipwerks.SCORM.quit = pipwerks.SCORM.connection.terminate;
A simple function to allow Flash ExternalInterface to confirm presence of JS wrapper before attempting any LMS communication.
Looks for an object named API in parent and opener windows
Looks for an object named API, first in the current window's frame hierarchy and then, if necessary, in the current window's opener window hierarchy (if there is an opener window).
Returns the handle to API object if it was previously set Returns the pipwerks.SCORM.API.handle variable.
Tells the LMS to initiate the communication session.
Tells the LMS to terminate the communication session
Requests information from the LMS.
Tells the LMS to assign the value to the named data model element. Also stores the SCO's completion status in a variable named pipwerks.SCORM.data.completionStatus. This variable is checked whenever pipwerks.SCORM.connection.terminate() is invoked.
Instructs the LMS to persist all data to this point in the session
Requests the error code for the current error state from the LMS
"Used by a SCO to request the textual description for the error code specified by the value of [errorCode]."
"Exists for LMS specific use. It allows the LMS to define additional diagnostic information through the API Instance."
Converts 'boolean strings' into actual valid booleans. (Most values returned from the API are the strings "true" and "false".)
Displays error messages when in debug mode.