HFJ-1: Re-added postUserStatistics stuff lost in QuestionSet
parent
334d36f692
commit
f4d1fde0e8
|
@ -108,7 +108,8 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
showAnimations: false,
|
||||
successVideo: undefined,
|
||||
failVideo: undefined
|
||||
}
|
||||
},
|
||||
postUserStatistics: (H5P.postUserStatistics === true)
|
||||
};
|
||||
|
||||
var template = new EJS({text: texttemplate});
|
||||
|
@ -130,6 +131,10 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
// TODO: Render on init, inject in template.
|
||||
|
||||
var libraryObject = H5P.libraryFromString(question.library);
|
||||
$.extend(question.params, {
|
||||
displaySolutionsButton: false,
|
||||
postUserStatistics: false
|
||||
});
|
||||
var tmp = new (H5P.classFromName(libraryObject.machineName))(question.params, contentId);
|
||||
questionInstances.push(tmp);
|
||||
}
|
||||
|
@ -170,7 +175,7 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
$('.question-container', $myDom).hide().eq(questionNumber).show();
|
||||
|
||||
// Trigger resize on question in case the size of the QS has changed.
|
||||
if (questionInstances[questionNumber].resize) {
|
||||
if (questionInstances[questionNumber].resize !== undefined) {
|
||||
questionInstances[questionNumber].resize();
|
||||
}
|
||||
|
||||
|
@ -220,6 +225,10 @@ H5P.QuestionSet = function (options, contentId) {
|
|||
passed: success
|
||||
};
|
||||
var displayResults = function () {
|
||||
if (params.postUserStatistics === true) {
|
||||
H5P.setFinished(contentId, getScore(), totalScore());
|
||||
}
|
||||
|
||||
if (!params.endGame.showResultPage) {
|
||||
$(returnObject).trigger('h5pQuestionSetFinished', eventData);
|
||||
return;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
"contentType": "question",
|
||||
"majorVersion": 1,
|
||||
"minorVersion": 0,
|
||||
"patchVersion": 30,
|
||||
"patchVersion": 31,
|
||||
"runnable": 1,
|
||||
"fullscreen": 0,
|
||||
"machineName": "H5P.QuestionSet",
|
||||
|
|
Loading…
Reference in New Issue