Add helper function to get verbs

namespaces
Svein-Tore Griff With 2015-02-11 20:06:40 +01:00
parent 5483a3f151
commit 36b1fd2d8c
1 changed files with 10 additions and 0 deletions

View File

@ -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