From 36b1fd2d8c4961582f8ee63e01164b4057350c09 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Wed, 11 Feb 2015 20:06:40 +0100 Subject: [PATCH] Add helper function to get verbs --- js/x-api.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/x-api.js b/js/x-api.js index 687dc59..f93eab3 100644 --- a/js/x-api.js +++ b/js/x-api.js @@ -62,6 +62,16 @@ H5P.XAPIEvent.prototype.setVerb = function(verb) { // 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) { this.data.statement.object = { // TODO: Correct this. contentId might be vid