Constructor
new SCORM(API, reporter)
SCORM constructor
| Name | Type | Description | 
|---|---|---|
API | object | The global SCORM API object  | 
reporter | module:report/Reporter. | The   | 
- Source
 
Members
API :object
SCORM API object used to communicate with the LMS
- object
 
- Source
 
core :string
Prefix used in core SCORM keys. Should be 'cmi.core.' for 1.2 and 'cmi.' for 2004
- string
 
- Source
 
is2004 :boolean
True when the API is of type SCORM 2004, false for SCORM 1.2
- boolean
 
- Source
 
prefix :string
Prefix to be used in SCORM function names. Should be 'LMS' for SCORM 1.2
- string
 
- Source
 
reporter :module:report/Reporter.Reporter
The Reporter associated to this SCORM object
- Source
 
studentId :string
The student ID retrieved from the SCORM API
- string
 
- Source
 
studentName :string
The student name retrieved from the SCORM API
- string
 
- Source
 
(static) DISCOVER_MAX_TRIES :number
Maximum recursive attempts allowed to find the global SCORM API object
- number
 
- Source
 
Methods
commit() → {boolean}
Commits current pending data to the SCORM API
- Source
 
- Type:
 - boolean
 
commitInfo()
Commits the current information to the SCORM API
- Source
 
getScormType() → {string}
Gets the SCORM type of this SCORM object
- Source
 
- Type:
 - string
 
getTimeExpression(millis) → {string}
Gets a string expression of the given time (in milliseconds) suitable for a SCORM transaction.
| Name | Type | Description | 
|---|---|---|
millis | number | The amount of time, in milliseconds  | 
- Source
 
- An ISO8601 valid expression
 
- Type:
 - string
 
getValue(key) → {string}
Gets a specific value from the SCORM API
| Name | Type | Description | 
|---|---|---|
key | string | A SCORM valid key  | 
- Source
 
- The value associated with the provided key, or 
nullif not found 
- Type:
 - string
 
initialize() → {boolean}
Initializes communication with the SCORM API
- Source
 
- Type:
 - boolean
 
setValue(key, value) → {string}
Sends a specific value to the SCORM API
| Name | Type | Description | 
|---|---|---|
key | string | A SCORM valid key  | 
value | string | | The value associated with this key  | 
- Source
 
- Type:
 - string
 
terminate() → {boolean}
Terminates communication with the SCORM API
- Source
 
- Type:
 - boolean
 
(static) getSCORM(reporter) → {module:report/SCORM.SCORM}
Checks for the presence of a SCORM API on the current browser session.
| Name | Type | Description | 
|---|---|---|
reporter | module:report/Reporter. | The   | 
- Source
 
- A valid SCORM object, or 
nullif no SCORM API was found. 
(static) scanForAPI(win, tries) → {object}
Recursive function used to find the SCORM "API" object
| Name | Type | Description | 
|---|---|---|
win | object | The 'window' object to scan for global SCORM API objects  | 
tries | number | Recursive attempts currently achieved  | 
- Source
 
- The global SCORM API object, or 
nullif not found 
- Type:
 - object