JI-1285 Add comment

HFP-2862-fix-download-warning
Paal Joergensen 2019-09-10 14:13:49 +02:00
parent 7a8f894c85
commit 0922db6fab
1 changed files with 7 additions and 1 deletions

View File

@ -142,7 +142,13 @@ H5P.XAPIEvent.prototype.setObject = function (instance) {
}
}
else {
// Empty object
// Content types view always expect to have a contentId when they are displayed.
// This is not the case if they are displayed in the editor as part of a preview.
// The fix is to set an empty object with definition for the xAPI event, so all
// the content types that rely on this does not have to handle it. This means
// that content types that are being previewed will send xAPI completed events,
// but since there are no scripts that catch these events in the editor,
// this is not a problem.
this.data.statement.object = {
definition: {}
};