From 919ac77f358b680cbc7585271af01d396b5d0228 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Fri, 18 Dec 2015 10:26:59 +0100 Subject: [PATCH] Readded check for undefined contentid in setActivityStarted() --- js/h5p-x-api.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/h5p-x-api.js b/js/h5p-x-api.js index 6becdad..1cf8b74 100644 --- a/js/h5p-x-api.js +++ b/js/h5p-x-api.js @@ -95,7 +95,8 @@ H5P.EventDispatcher.prototype.triggerXAPIScored = function (score, maxScore, ver H5P.EventDispatcher.prototype.setActivityStarted = function() { if (this.activityStartTime === undefined) { // Don't trigger xAPI events in the editor - if (H5PIntegration.contents !== undefined && + if (this.contentId !== undefined && + H5PIntegration.contents !== undefined && H5PIntegration.contents['cid-' + this.contentId] !== undefined) { this.triggerXAPI('attempted'); }