Make xAPI work in editor

semantics-font
Svein-Tore Griff With 2015-03-24 18:24:07 +01:00
parent 8e113ff792
commit c746457a87
1 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ H5P.XAPIEvent.prototype.setObject = function(instance) {
} }
} }
else { else {
if (H5PIntegration.contents['cid-' + instance.contentId].title) { if (H5PIntegration && H5PIntegration.contents && H5PIntegration.contents['cid-' + instance.contentId].title) {
this.data.statement.object.definition.name = { this.data.statement.object.definition.name = {
"en-US": H5P.createH5PTitle(H5PIntegration.contents['cid-' + instance.contentId].title) "en-US": H5P.createH5PTitle(H5PIntegration.contents['cid-' + instance.contentId].title)
}; };
@ -177,7 +177,7 @@ H5P.XAPIEvent.prototype.getScore = function() {
H5P.XAPIEvent.prototype.getContentXAPIId = function (instance) { H5P.XAPIEvent.prototype.getContentXAPIId = function (instance) {
var xAPIId; var xAPIId;
if (instance.contentId) { if (instance.contentId && H5PIntegration && H5PIntegration.contents) {
xAPIId = H5PIntegration.contents['cid-' + instance.contentId].url; xAPIId = H5PIntegration.contents['cid-' + instance.contentId].url;
if (instance.uuid) { if (instance.uuid) {
xAPIId += '?uuid=' + instance.uuid; xAPIId += '?uuid=' + instance.uuid;