Class: XAPIEvent

H5P. XAPIEvent

new XAPIEvent()

Used for xAPI events.

Extends

Members

<static> allowedXAPIVerbs :Array

List of verbs defined at ADL xAPI Vocabulary
Type:
  • Array

Methods

getBubbles() → {boolean}

Get bubbling status
Inherited From:
Returns:
true if bubbling false otherwise
Type
boolean

getContentXAPIId(instance)

Get content xAPI ID.
Parameters:
Name Type Description
instance Object The H5P instance

getMaxScore() → {number}

Get the max value of the result - score part of the statement
Returns:
The max score, or null if not defined
Type
number

getScore() → {number}

Get the raw value of the result - score part of the statement
Returns:
The score, or null if not defined
Type
number

getVerb(full) → {string}

Get the statements verb id.
Parameters:
Name Type Description
full boolean if true the full verb id prefixed by http://adlnet.gov/expapi/verbs/ will be returned
Returns:
Verb or null if no verb with an id has been defined
Type
string

getVerifiedStatementValue(keys) → {*}

Figure out if a property exists in the statement and return it
Parameters:
Name Type Description
keys Array.<string> List describing the property we're looking for. For instance ['result', 'score', 'raw'] for result.score.raw
Returns:
The value of the property if it is set, null otherwise.
Type
*

isFromChild() → {Boolean}

Check if this event is sent from a child (i.e not from grandchild)
Returns:
Type
Boolean

preventBubbling()

Prevent this event from bubbling up to parent
Inherited From:

scheduleForExternal() → {boolean}

Try to schedule an event for externalDispatcher
Inherited From:
Returns:
true if external and not already scheduled, otherwise false
Type
boolean

setActor()

Set the actor. Email and name will be added automatically.

setContext(instance)

Set the context part of the statement.
Parameters:
Name Type Description
instance Object The H5P instance

setObject(instance)

Set the object part of the statement. The id is found automatically (the url to the content)
Parameters:
Name Type Description
instance Object The H5P instance

setScoredResult(score, maxScore, instance, completion, success)

Set scored result statements.
Parameters:
Name Type Description
score number
maxScore number
instance object
completion boolean
success boolean

setVerb(verb)

Set a verb.
Parameters:
Name Type Description
verb string Verb in short form, one of the verbs defined at ADL xAPI Vocabulary
Documentation generated by JSDoc 3.4.3 on 2017-02-07T13:45:43+01:00