Satisfy JSHint and prevent crashing.
parent
688b00f55e
commit
971a55df58
|
@ -45,9 +45,8 @@ H5P.XAPIEvent.prototype.setVerb = function(verb) {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.log('illegal verb');
|
H5P.error('illegal verb');
|
||||||
}
|
}
|
||||||
// Else: Fail silently...
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,7 +67,7 @@ H5P.XAPIEvent.prototype.getVerb = function(full) {
|
||||||
else {
|
else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Helperfunction to set the object part of the statement.
|
* Helperfunction to set the object part of the statement.
|
||||||
|
|
|
@ -55,7 +55,7 @@ H5P.EventDispatcher.prototype.triggerXAPICompleted = function(score, maxScore) {
|
||||||
var event = this.createXAPIEventTemplate('completed');
|
var event = this.createXAPIEventTemplate('completed');
|
||||||
event.setScoredResult(score, maxScore);
|
event.setScoredResult(score, maxScore);
|
||||||
this.trigger(event);
|
this.trigger(event);
|
||||||
}
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Internal H5P function listening for xAPI completed events and stores scores
|
* Internal H5P function listening for xAPI completed events and stores scores
|
||||||
|
|
|
@ -548,7 +548,7 @@ H5P.newRunnable = function (library, contentId, $attachTo, skipResize) {
|
||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
H5P.error = function (err) {
|
H5P.error = function (err) {
|
||||||
if (window['console'] !== undefined && console.error !== undefined) {
|
if (window.console !== undefined && console.error !== undefined) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1244,7 +1244,7 @@ H5P.trigger = function(instance, eventType) {
|
||||||
}
|
}
|
||||||
// Try deprecated event system
|
// Try deprecated event system
|
||||||
else if (instance.$ !== undefined && instance.$.trigger !== undefined) {
|
else if (instance.$ !== undefined && instance.$.trigger !== undefined) {
|
||||||
instance.$.trigger(eventType)
|
instance.$.trigger(eventType);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1268,6 +1268,6 @@ H5P.on = function(instance, eventType, handler) {
|
||||||
}
|
}
|
||||||
// Try deprecated event system
|
// Try deprecated event system
|
||||||
else if (instance.$ !== undefined && instance.$.on !== undefined) {
|
else if (instance.$ !== undefined && instance.$.on !== undefined) {
|
||||||
instance.$.on(eventType, handler)
|
instance.$.on(eventType, handler);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue