Remove buttons when not displaying results

Also removed empty feedback section to remove space.
HFJ-1935
pull/5/head
Frode Petterson 2016-05-25 09:51:23 +02:00
parent 1a36c88e66
commit 8f30b1e3a7
1 changed files with 29 additions and 25 deletions

View File

@ -340,6 +340,7 @@ H5P.QuestionSet = function (options, contentId) {
$myDom.children().hide(); $myDom.children().hide();
$myDom.append(endTemplate.render(eparams)); $myDom.append(endTemplate.render(eparams));
if (params.endGame.showResultPage) {
// Add event handlers to summary buttons // Add event handlers to summary buttons
hookUpButton('.qs-finishbutton', function () { hookUpButton('.qs-finishbutton', function () {
self.trigger('h5pQuestionSetFinished', eventData); self.trigger('h5pQuestionSetFinished', eventData);
@ -365,7 +366,6 @@ H5P.QuestionSet = function (options, contentId) {
} }
}); });
if (params.endGame.showResultPage) {
if (scoreBar === undefined) { if (scoreBar === undefined) {
scoreBar = H5P.JoubelUI.createScoreBar(totals); scoreBar = H5P.JoubelUI.createScoreBar(totals);
} }
@ -373,6 +373,10 @@ H5P.QuestionSet = function (options, contentId) {
scoreBar.setScore(finals); scoreBar.setScore(finals);
$('.feedback-text', $myDom).html(scoreString); $('.feedback-text', $myDom).html(scoreString);
} }
else {
// Remove buttons and feedback section
$('.qs-finishbutton, .qs-solutionbutton, .qs-retrybutton, .feedback-section', $myDom).remove();
}
self.trigger('resize'); self.trigger('resize');
}; };