Refactor xAPI Video verb creation to get correct id URI
parent
8ecba8a2e7
commit
d71ed1afdc
|
@ -77,6 +77,14 @@ H5P.XAPIEvent.prototype.setVerb = function (verb) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
else if (H5P.jQuery.inArray(verb, H5P.XAPIEvent.allowedXAPIVideoVerbs) !== -1) {
|
||||||
|
this.data.statement.verb = {
|
||||||
|
'id': 'https://w3id.org/xapi/video/verbs/' + verb,
|
||||||
|
'display': {
|
||||||
|
'en-US': verb
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
else if (verb.id !== undefined) {
|
else if (verb.id !== undefined) {
|
||||||
this.data.statement.verb = verb;
|
this.data.statement.verb = verb;
|
||||||
}
|
}
|
||||||
|
@ -310,14 +318,20 @@ H5P.XAPIEvent.allowedXAPIVerbs = [
|
||||||
'terminated',
|
'terminated',
|
||||||
'voided',
|
'voided',
|
||||||
|
|
||||||
// Custom verbs for video events
|
|
||||||
'played',
|
|
||||||
'paused',
|
|
||||||
'seeked',
|
|
||||||
'finished',
|
|
||||||
|
|
||||||
// Custom verbs used for action toolbar below content
|
// Custom verbs used for action toolbar below content
|
||||||
'downloaded',
|
'downloaded',
|
||||||
'accessed-embed',
|
'accessed-embed',
|
||||||
'accessed-copyright'
|
'accessed-copyright'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of video verbs defined at {@link https://w3id.org/xapi/video/|xAPI Video Profile}
|
||||||
|
*
|
||||||
|
* @type Array
|
||||||
|
*/
|
||||||
|
H5P.XAPIEvent.allowedXAPIVideoVerbs = [
|
||||||
|
'played',
|
||||||
|
'paused',
|
||||||
|
'seeked',
|
||||||
|
'finished',
|
||||||
|
];
|
||||||
|
|
Loading…
Reference in New Issue