From 844883a1cff662558daf2eb7c1544319a0b1c6e4 Mon Sep 17 00:00:00 2001 From: Svein-Tore Griff With Date: Sun, 1 Nov 2015 00:23:10 +0100 Subject: [PATCH] triggerXAPICompleted is deprecated so we don't change it. Also fixes doc --- js/h5p-x-api.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/js/h5p-x-api.js b/js/h5p-x-api.js index aeec7b6..735161c 100644 --- a/js/h5p-x-api.js +++ b/js/h5p-x-api.js @@ -69,12 +69,7 @@ H5P.EventDispatcher.prototype.createXAPIEventTemplate = function (verb, extra) { * will be set as the "success" value of the result object */ H5P.EventDispatcher.prototype.triggerXAPICompleted = function (score, maxScore, success) { - var verb = 'completed'; - if (typeof success !== 'undefined') { - if (success) {verb = "passed";} - else {verb = "failed";} - } - this.triggerXAPIScored(score, maxScore, verb, true, success); + this.triggerXAPIScored(score, maxScore, 'completed', true, success); }; /** @@ -86,6 +81,10 @@ H5P.EventDispatcher.prototype.triggerXAPICompleted = function (score, maxScore, * Will be set as the "max" value of the score object * @param {string} verb * Short form of adl verb + * @param {boolean} completion + * Is this a statement from a completed activity? + * @param {boolean} success + * Is this a statement from an activity that was done successfully? */ H5P.EventDispatcher.prototype.triggerXAPIScored = function (score, maxScore, verb, completion, success) { var event = this.createXAPIEventTemplate(verb);