HFJ-187: Fixed copyrights for boardgame and libraries used there.
parent
06b0ecaa20
commit
6c9634eae7
|
@ -376,6 +376,47 @@ H5P.QuestionSet = function (options, contentId) {
|
||||||
return score;
|
return score;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gather copyright information for the current content.
|
||||||
|
*
|
||||||
|
* @returns {H5P.ContentCopyrights}
|
||||||
|
*/
|
||||||
|
var getCopyrights = function () {
|
||||||
|
var info = new H5P.ContentCopyrights();
|
||||||
|
|
||||||
|
// Background
|
||||||
|
if (params.backgroundImage.copyright !== undefined) {
|
||||||
|
var background = new H5P.MediaCopyright(params.backgroundImage.copyright);
|
||||||
|
background.setThumbnail(new H5P.Thumbnail(H5P.getPath(params.backgroundImage.path, contentId), params.backgroundImage.width, params.backgroundImage.height));
|
||||||
|
info.addMedia(background);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Questions
|
||||||
|
for (var i = 0; i < questionInstances.length; i++) {
|
||||||
|
var questionInstance = questionInstances[i];
|
||||||
|
if (questionInstance.getCopyrights !== undefined) {
|
||||||
|
var rights = questionInstance.getCopyrights();
|
||||||
|
if (rights !== undefined) {
|
||||||
|
info.addContent(rights);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Success video
|
||||||
|
var video = params.endGame.successVideo[0];
|
||||||
|
if (video.copyright !== undefined) {
|
||||||
|
info.addMedia(new H5P.MediaCopyright(video.copyright));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fail video
|
||||||
|
video = params.endGame.failVideo[0];
|
||||||
|
if (video.copyright !== undefined) {
|
||||||
|
info.addMedia(new H5P.MediaCopyright(video.copyright));
|
||||||
|
}
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
// Masquerade the main object to hide inner properties and functions.
|
// Masquerade the main object to hide inner properties and functions.
|
||||||
var returnObject = {
|
var returnObject = {
|
||||||
attach: attach, // Attach to DOM object
|
attach: attach, // Attach to DOM object
|
||||||
|
@ -386,7 +427,8 @@ H5P.QuestionSet = function (options, contentId) {
|
||||||
},
|
},
|
||||||
totalScore: totalScore,
|
totalScore: totalScore,
|
||||||
reRender: reRender,
|
reRender: reRender,
|
||||||
defaults: defaults // Provide defaults for inspection
|
defaults: defaults, // Provide defaults for inspection
|
||||||
|
getCopyrights: getCopyrights
|
||||||
};
|
};
|
||||||
return returnObject;
|
return returnObject;
|
||||||
};
|
};
|
|
@ -3,8 +3,7 @@
|
||||||
"contentType": "question",
|
"contentType": "question",
|
||||||
"majorVersion": 1,
|
"majorVersion": 1,
|
||||||
"minorVersion": 0,
|
"minorVersion": 0,
|
||||||
"patchVersion": 39,
|
"patchVersion": 43,
|
||||||
"patchVersion": 42,
|
|
||||||
"runnable": 1,
|
"runnable": 1,
|
||||||
"fullscreen": 0,
|
"fullscreen": 0,
|
||||||
"machineName": "H5P.QuestionSet",
|
"machineName": "H5P.QuestionSet",
|
||||||
|
|
Loading…
Reference in New Issue