HFJ-1: Re-added postUserStatistics stuff lost in QuestionSet

pull/1/head
Frank Ronny Larsen 2013-11-07 11:43:52 +01:00
parent 334d36f692
commit f4d1fde0e8
2 changed files with 12 additions and 3 deletions

View File

@ -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;

View File

@ -3,7 +3,7 @@
"contentType": "question",
"majorVersion": 1,
"minorVersion": 0,
"patchVersion": 30,
"patchVersion": 31,
"runnable": 1,
"fullscreen": 0,
"machineName": "H5P.QuestionSet",