Merge branch 'api-1.2' of b.amendor.com:h5p into api-1.2

Conflicts:
	example_content/boardgame/H5P.Boardgame/js/boardgame.js
pull/1/head
Pål Jørgensen 2014-03-21 13:50:44 +01:00
commit 0f8892d697
1 changed files with 43 additions and 1 deletions

View File

@ -357,6 +357,47 @@ H5P.QuestionSet = function (options, contentId) {
}
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.
var returnObject = {
@ -369,7 +410,8 @@ H5P.QuestionSet = function (options, contentId) {
},
totalScore: totalScore,
reRender: reRender,
defaults: defaults // Provide defaults for inspection
defaults: defaults, // Provide defaults for inspection
getCopyrights: getCopyrights
};
return returnObject;
};