Readded check for undefined contentid in setActivityStarted()

pull/17/head
Paal Joergensen 2015-12-18 10:26:59 +01:00
parent e83b213183
commit 919ac77f35
1 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,8 @@ H5P.EventDispatcher.prototype.triggerXAPIScored = function (score, maxScore, ver
H5P.EventDispatcher.prototype.setActivityStarted = function() { H5P.EventDispatcher.prototype.setActivityStarted = function() {
if (this.activityStartTime === undefined) { if (this.activityStartTime === undefined) {
// Don't trigger xAPI events in the editor // 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) { H5PIntegration.contents['cid-' + this.contentId] !== undefined) {
this.triggerXAPI('attempted'); this.triggerXAPI('attempted');
} }