Pipwerks SCORM API Wrapper
It's a module wrapper for the wonderful [Pipwerks] api wrapper.
``
npm install --save pipwerks-scorm-api-wrapper
`
Example
`
js
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();
`
Shortcuts
`
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;
``
Methods
$3
A simple function to allow Flash ExternalInterface to confirm
presence of JS wrapper before attempting any LMS communication.
$3
Looks for an object named API in parent and opener windows
$3
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).
$3
Returns the handle to API object if it was previously set
Returns the pipwerks.SCORM.API.handle variable.
$3
Tells the LMS to initiate the communication session.
$3
Tells the LMS to terminate the communication session
$3
Requests information from the LMS.
$3
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.
$3
Instructs the LMS to persist all data to this point in the session
$3
Requests the error code for the current error state from the LMS
$3
> "Used by a SCO to request the textual description for the error code
specified by the value of [errorCode]."
$3
> "Exists for LMS specific use. It allows the LMS to define additional
diagnostic information through the API Instance."
$3
Converts 'boolean strings' into actual valid booleans.
(Most values returned from the API are the strings "true" and "false".)
$3
Displays error messages when in debug mode.
[Pipwerks]: https://github.com/pipwerks/scorm-api-wrapper