Merge branch 'stable'

pull/1/head
Svein-Tore Griff With 2015-07-09 15:49:20 +02:00
commit b9d8321c3e
7 changed files with 58 additions and 16 deletions

View File

@ -98,7 +98,8 @@ H5P.QuestionSet = function (options, contentId) {
overrideButtons: false, overrideButtons: false,
overrideShowSolutionButton: false, overrideShowSolutionButton: false,
overrideRetry: false overrideRetry: false
} },
questionLabel: 'Question'
}; };
var template = new EJS({text: texttemplate}); var template = new EJS({text: texttemplate});
@ -106,7 +107,7 @@ H5P.QuestionSet = function (options, contentId) {
var params = $.extend(true, {}, defaults, options); var params = $.extend(true, {}, defaults, options);
var currentQuestion = 0; var currentQuestion = 0;
var questionInstances = new Array(); var questionInstances = [];
var $myDom; var $myDom;
renderSolutions = false; renderSolutions = false;
@ -369,8 +370,7 @@ H5P.QuestionSet = function (options, contentId) {
} }
}); });
if (question.getAnswerGiven()) { if (question.getAnswerGiven()) {
$('.progress-dot:eq(' + i +')' $('.progress-dot:eq(' + i +')', $myDom).removeClass('unanswered').addClass('answered');
, $myDom).removeClass('unanswered').addClass('answered');
} }
} }
@ -444,20 +444,40 @@ H5P.QuestionSet = function (options, contentId) {
} }
// Questions // Questions
var questionCopyrights;
for (var i = 0; i < questionInstances.length; i++) { for (var i = 0; i < questionInstances.length; i++) {
var questionInstance = questionInstances[i]; var instance = questionInstances[i];
if (questionInstance.getCopyrights !== undefined) { var qParams = params.questions[i].params;
var rights = questionInstance.getCopyrights(); questionCopyrights = undefined;
if (rights !== undefined) {
rights.setLabel('Question '+(i+1)); if (instance.getCopyrights !== undefined) {
info.addContent(rights); // Use the instance's own copyright generator
} questionCopyrights = instance.getCopyrights();
} }
if (questionCopyrights === undefined) {
// Create a generic flat copyright list
questionCopyrights = new H5P.ContentCopyrights();
H5P.findCopyrights(questionCopyrights, qParams, contentId);
}
// Determine label
var label = (params.questionLabel + ' ' + (i + 1));
if (qParams.contentName !== undefined) {
label += ': ' + qParams.contentName;
}
else if (instance.getTitle !== undefined) {
label += ': ' + instance.getTitle();
}
questionCopyrights.setLabel(label);
// Add info
info.addContent(questionCopyrights);
} }
// Success video // Success video
var video;
if (params.endGame.successVideo !== undefined && params.endGame.successVideo.length > 0) { if (params.endGame.successVideo !== undefined && params.endGame.successVideo.length > 0) {
var video = params.endGame.successVideo[0]; video = params.endGame.successVideo[0];
if (video.copyright !== undefined) { if (video.copyright !== undefined) {
info.addMedia(new H5P.MediaCopyright(video.copyright)); info.addMedia(new H5P.MediaCopyright(video.copyright));
} }
@ -478,7 +498,7 @@ H5P.QuestionSet = function (options, contentId) {
}; };
this.showSolutions = function() { this.showSolutions = function() {
renderSolutions = true; renderSolutions = true;
} };
}; };
H5P.QuestionSet.prototype = Object.create(H5P.EventDispatcher.prototype); H5P.QuestionSet.prototype = Object.create(H5P.EventDispatcher.prototype);
H5P.QuestionSet.prototype.constructor = H5P.QuestionSet; H5P.QuestionSet.prototype.constructor = H5P.QuestionSet;

View File

@ -154,6 +154,10 @@
"description": "تفعيل هذا الخيار يجعل المستخدم قادرا على \"إعادة المحاولة\"" "description": "تفعيل هذا الخيار يجعل المستخدم قادرا على \"إعادة المحاولة\""
} }
] ]
},
{
"label": "Question label text",
"default": "Question"
} }
] ]
} }

View File

@ -154,6 +154,10 @@
"description": "L'attivazione di questa opzione far<61> in modo che per l'utente sia abilitata l'opzione \"Riprova\"." "description": "L'attivazione di questa opzione far<61> in modo che per l'utente sia abilitata l'opzione \"Riprova\"."
} }
] ]
},
{
"label": "Question label text",
"default": "Question"
} }
] ]
} }

View File

@ -166,6 +166,10 @@
"description": "Aktivering vil slå på \"Prøv igjen\" ." "description": "Aktivering vil slå på \"Prøv igjen\" ."
} }
] ]
},
{
"label": "Spørsmål-etikett",
"default": "Spørsmål"
} }
] ]
} }

View File

@ -166,6 +166,10 @@
"description": "Aktivering vil slå på \"Prøv igjen\" ." "description": "Aktivering vil slå på \"Prøv igjen\" ."
} }
] ]
},
{
"label": "Spørsmål-etikett",
"default": "Spørsmål"
} }
] ]
} }

View File

@ -3,7 +3,7 @@
"contentType": "question", "contentType": "question",
"majorVersion": 1, "majorVersion": 1,
"minorVersion": 4, "minorVersion": 4,
"patchVersion": 0, "patchVersion": 2,
"embedTypes": [ "embedTypes": [
"iframe" "iframe"
], ],
@ -55,4 +55,4 @@
"minorVersion": 0 "minorVersion": 0
} }
] ]
} }

View File

@ -324,5 +324,11 @@
"default": false "default": false
} }
] ]
},
{
"name": "questionLabel",
"type": "text",
"label": "Question label text",
"default": "Question"
} }
] ]