diff --git a/js/questionset.js b/js/questionset.js index d4cf49d..24289a9 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -60,7 +60,9 @@ H5P.QuestionSet = function (options, contentId) { ' <% if (comment) { %>' + '
<%= comment %>
' + ' <% } %>' + + ' <% if (resulttext) { %>' + '
<%= resulttext %>
' + + ' <% } %>' + '
' + ' ' + ' ' + @@ -90,6 +92,7 @@ H5P.QuestionSet = function (options, contentId) { }, endGame: { showResultPage: true, + noResultMessage: 'Finished', message: 'Your result:', successGreeting: 'Congratulations!', successComment: 'You have enough correct answers to pass the test.', @@ -324,15 +327,10 @@ H5P.QuestionSet = function (options, contentId) { var displayResults = function () { self.triggerXAPICompleted(self.getScore(), self.totalScore(), success); - if (!params.endGame.showResultPage) { - self.trigger('h5pQuestionSetFinished', eventData); - return; - } - var eparams = { - message: params.endGame.message, - comment: (success ? params.endGame.successGreeting : params.endGame.failGreeting), - resulttext: (success ? params.endGame.successComment : params.endGame.failComment), + message: params.endGame.showResultPage ? params.endGame.message : params.endGame.noResultMessage, + comment: params.endGame.showResultPage ? (success ? params.endGame.successGreeting : params.endGame.failGreeting) : undefined, + resulttext: params.endGame.showResultPage ? (success ? params.endGame.successComment : params.endGame.failComment) : undefined, finishButtonText: params.endGame.finishButtonText, solutionButtonText: params.endGame.solutionButtonText, retryButtonText: params.endGame.retryButtonText @@ -367,12 +365,14 @@ H5P.QuestionSet = function (options, contentId) { } }); - if (scoreBar === undefined) { - scoreBar = H5P.JoubelUI.createScoreBar(totals); + if (params.endGame.showResultPage) { + if (scoreBar === undefined) { + scoreBar = H5P.JoubelUI.createScoreBar(totals); + } + scoreBar.appendTo($('.feedback-scorebar', $myDom)); + scoreBar.setScore(finals); + $('.feedback-text', $myDom).html(scoreString); } - scoreBar.appendTo($('.feedback-scorebar', $myDom)); - scoreBar.setScore(finals); - $('.feedback-text', $myDom).html(scoreString); self.trigger('resize'); }; diff --git a/language/ar.json b/language/ar.json index 168b643..5217dad 100644 --- a/language/ar.json +++ b/language/ar.json @@ -92,6 +92,11 @@ { "label": "عرض النتائج" }, + { + "label": "No results message", + "description": "Text displayed on end page when \"Display results\" is disabled", + "default": "Finished" + }, { "label": "نص راس الملاحظات", "description": "سيتم عرض هذا العنوان في نهاية هذه المسابقة حيثما أجاب المستخدم على جميع الأسئلة المستعملة" diff --git a/language/de.json b/language/de.json index 31b2515..82a29c6 100644 --- a/language/de.json +++ b/language/de.json @@ -97,6 +97,11 @@ { "label": "Ergebnisanzeige" }, + { + "label": "No results message", + "description": "Text displayed on end page when \"Display results\" is disabled", + "default": "Finished" + }, { "label": "Kopfzeile Feedback", "default": "Dein Ergebnis:", diff --git a/language/fr.json b/language/fr.json index 5b00c62..23f6fb9 100644 --- a/language/fr.json +++ b/language/fr.json @@ -92,6 +92,11 @@ { "label": "Montrer les résultats" }, + { + "label": "No results message", + "description": "Text displayed on end page when \"Display results\" is disabled", + "default": "Finished" + }, { "label": "Feedback de fin", "description": "Ce texte sera affiché quand l'utilisateur aura totalement terminé le quiz." diff --git a/language/it.json b/language/it.json index 14c342f..8af2417 100644 --- a/language/it.json +++ b/language/it.json @@ -92,6 +92,11 @@ { "label": "Visualizza risultati" }, + { + "label": "No results message", + "description": "Text displayed on end page when \"Display results\" is disabled", + "default": "Finished" + }, { "label": "Intestazione Feedback", "description": "Questa intestazione verrà visualizzata alla fine del quiz, dopo che l'utente avrà risposto a tutte le domande." diff --git a/language/nb.json b/language/nb.json index 52f0abc..84783da 100644 --- a/language/nb.json +++ b/language/nb.json @@ -94,6 +94,11 @@ { "label": "Vis resultater" }, + { + "label": "Melding når resultater ikke vises", + "description": "Teksten vises på avslutnings-siden når resultater ikke vises", + "default": "Ferdig" + }, { "label": "Overskrift over tilbakemeldinger", "default": "Resultat:", diff --git a/language/nn.json b/language/nn.json index 5d8cb0c..5e47a98 100644 --- a/language/nn.json +++ b/language/nn.json @@ -94,6 +94,11 @@ { "label": "Vis resultat" }, + { + "label": "Melding når resultater ikke vises", + "description": "Teksten vises på avslutnings-siden når resultater ikke vises", + "default": "Ferdig" + }, { "label": "Overskrift over tilbakemeldingar", "default": "Resultat:", diff --git a/semantics.json b/semantics.json index f373ebe..f7e9caa 100644 --- a/semantics.json +++ b/semantics.json @@ -179,6 +179,14 @@ "label": "Display results", "default": true }, + { + "name": "noResultMessage", + "type": "text", + "label": "No results message", + "description": "Text displayed on end page when \"Display results\" is disabled", + "default": "Finished", + "optional": true + }, { "name": "message", "type": "text",