Helpers
A selection of useful helpers.
Last updated
Was this helpful?
A selection of useful helpers.
Last updated
Was this helpful?
This gets the launch parameters supplied in the URL. Can be used before initializing.
This returns a object.
This gets the launch data from the LMS. Can not be used before initializing the AU.
This gets the session's authToken. Useful for storing in non-volatile storage local to the user (e.g. SessionStorage) to preserve the state between page refreshes. Pass this value and initializedDate
to initialize
to restore the previous session.
This returns a string
or null
if the Cmi5 instance has not been initialized.
This gets the session's initializedDate. Useful for storing in non-volatile storage local to the user (e.g. SessionStorage) to preserve the state between page refreshes. Pass this value and authToken
to initialize
to restore the previous session.
This returns a Date
or null
if the Cmi5 instance has not been initialized.
This gets the learner preferences from the LMS. Can not be used before initializing the AU.
This returns true
if the environment has all the necessary parameters for initialisation.
This returns a Boolean
.
This returns true
if the instance constructed successfully.
This returns a Boolean
.
Creates a new Cmi5 singleton instance, or if already called returns the same singleton Cmi5 instance.
This returns a global Cmi5
singleton instance.
Clears the Cmi5 singleton instance.
Automatically satisfies the AU based upon the Launch Data from the LMS. It will send the "cmi5 defined" statements for:
Pass or fail if a score is provided and the mastery score is configured
complete statement
terminate statement (unless disabled in the options parameter)
Parameter
Type
Required
Description
options
false
The additional options object.
This returns a Promise
containing an array with the resulting statementIds if successful.
Returns the internal xAPI.js Wrapper library instance. Useful for accessing any xAPI Resources using the Cmi5 authentication. Can only be accessed after successfully calling the initialize
method.
This returns the internal XAPI
instance, authenticated with the LRS endpoint and authentication token.
This returns a object.