Merge branch 'release'
commit
2fc1b9a050
|
@ -161,7 +161,9 @@ H5P.QuestionSet = function (options, contentId, contentData) {
|
||||||
var randomizeQuestionOrdering = function (questions) {
|
var randomizeQuestionOrdering = function (questions) {
|
||||||
|
|
||||||
// Save the original order of the questions in a multidimensional array [[question0,0],[question1,1]...
|
// Save the original order of the questions in a multidimensional array [[question0,0],[question1,1]...
|
||||||
var questionOrdering = questions.map(function (questionInstance, index) { return [questionInstance, index]; });
|
var questionOrdering = questions.map(function (questionInstance, index) {
|
||||||
|
return [questionInstance, index];
|
||||||
|
});
|
||||||
|
|
||||||
// Shuffle the multidimensional array
|
// Shuffle the multidimensional array
|
||||||
questionOrdering = H5P.shuffleArray(questionOrdering);
|
questionOrdering = H5P.shuffleArray(questionOrdering);
|
||||||
|
@ -553,7 +555,8 @@ H5P.QuestionSet = function (options, contentId, contentData) {
|
||||||
// Update buttons
|
// Update buttons
|
||||||
initializeQuestion();
|
initializeQuestion();
|
||||||
|
|
||||||
} else if (params.randomQuestions) {
|
}
|
||||||
|
else if (params.randomQuestions) {
|
||||||
randomizeQuestions();
|
randomizeQuestions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1084,7 +1087,8 @@ H5P.QuestionSet = function (options, contentId, contentData) {
|
||||||
var questionCopyrights;
|
var questionCopyrights;
|
||||||
for (var i = 0; i < questionInstances.length; i++) {
|
for (var i = 0; i < questionInstances.length; i++) {
|
||||||
var instance = questionInstances[i];
|
var instance = questionInstances[i];
|
||||||
var qParams = params.questions[i].params;
|
var instanceParams = params.questions[i].params;
|
||||||
|
|
||||||
questionCopyrights = undefined;
|
questionCopyrights = undefined;
|
||||||
|
|
||||||
if (instance.getCopyrights !== undefined) {
|
if (instance.getCopyrights !== undefined) {
|
||||||
|
@ -1094,13 +1098,16 @@ H5P.QuestionSet = function (options, contentId, contentData) {
|
||||||
if (questionCopyrights === undefined) {
|
if (questionCopyrights === undefined) {
|
||||||
// Create a generic flat copyright list
|
// Create a generic flat copyright list
|
||||||
questionCopyrights = new H5P.ContentCopyrights();
|
questionCopyrights = new H5P.ContentCopyrights();
|
||||||
H5P.findCopyrights(questionCopyrights, qParams, contentId);
|
H5P.findCopyrights(questionCopyrights, instanceParams.params, contentId,{
|
||||||
|
metadata: instanceParams.metadata,
|
||||||
|
machineName: instanceParams.library.split(' ')[0]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine label
|
// Determine label
|
||||||
var label = (params.texts.questionLabel + ' ' + (i + 1));
|
var label = (params.texts.questionLabel + ' ' + (i + 1));
|
||||||
if (qParams.contentName !== undefined) {
|
if (instanceParams.params.contentName !== undefined) {
|
||||||
label += ': ' + qParams.contentName;
|
label += ': ' + instanceParams.params.contentName;
|
||||||
}
|
}
|
||||||
else if (instance.getTitle !== undefined) {
|
else if (instance.getTitle !== undefined) {
|
||||||
label += ': ' + instance.getTitle();
|
label += ': ' + instance.getTitle();
|
||||||
|
|
Loading…
Reference in New Issue