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