Make sure title are added

semantics-font
Svein-Tore Griff With 2015-03-22 15:14:28 +01:00
parent c4e488f9c8
commit 9a204b3d8f
1 changed files with 14 additions and 6 deletions

View File

@ -87,15 +87,23 @@ H5P.XAPIEvent.prototype.setObject = function(instance) {
} }
} }
}; };
if (instance.h5pUUID) { if (instance.uuid) {
this.data.statement.object.extensions['http://h5p.org/x-api/h5p-uuid'] = instance.h5pUUID; this.data.statement.object.definition.extensions['http://h5p.org/x-api/h5p-uuid'] = instance.uuid;
} // Don't set titles on main content, title should come from publishing platform
if (typeof instance.getH5PTitle === 'function') { if (typeof instance.getH5PTitle === 'function') {
this.data.statement.object.definition.name = { this.data.statement.object.definition.name = {
"en-US": instance.getH5PTitle() "en-US": instance.getH5PTitle()
}; };
} }
} }
else {
if (H5PIntegration.contents['cid-' + instance.contentId].title) {
this.data.statement.object.definition.name = {
"en-US": H5P.createH5PTitle(H5PIntegration.contents['cid-' + instance.contentId].title)
};
}
}
}
}; };
/** /**