Add helper function to get verbs
parent
5483a3f151
commit
36b1fd2d8c
10
js/x-api.js
10
js/x-api.js
|
@ -62,6 +62,16 @@ H5P.XAPIEvent.prototype.setVerb = function(verb) {
|
||||||
// Else: Fail silently...
|
// Else: Fail silently...
|
||||||
};
|
};
|
||||||
|
|
||||||
|
H5P.XAPIEvent.prototype.getShortVerb = function() {
|
||||||
|
var statement = this.data.statement;
|
||||||
|
if ('verb' in statement) {
|
||||||
|
return statement.verb.id.slice(31);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
H5P.XAPIEvent.prototype.setObject = function(instance) {
|
H5P.XAPIEvent.prototype.setObject = function(instance) {
|
||||||
this.data.statement.object = {
|
this.data.statement.object = {
|
||||||
// TODO: Correct this. contentId might be vid
|
// TODO: Correct this. contentId might be vid
|
||||||
|
|
Loading…
Reference in New Issue