Made disabled show results show a minimalistic end page [HFJ-1935]

pull/5/head
Paal Joergensen 2016-05-20 09:33:45 +02:00
parent 636857931a
commit 9380a9ea98
8 changed files with 51 additions and 13 deletions

View File

@ -60,7 +60,9 @@ H5P.QuestionSet = function (options, contentId) {
' <% if (comment) { %>' +
' <div class="result-header"><%= comment %></div>' +
' <% } %>' +
' <% if (resulttext) { %>' +
' <div class="result-text"><%= resulttext %></div>' +
' <% } %>' +
' <div class="buttons">' +
' <button type="button" class="h5p-joubelui-button h5p-button qs-finishbutton"><%= finishButtonText %></button>' +
' <button type="button" class="h5p-joubelui-button h5p-button qs-solutionbutton"><%= solutionButtonText %></button>' +
@ -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 (params.endGame.showResultPage) {
if (scoreBar === undefined) {
scoreBar = H5P.JoubelUI.createScoreBar(totals);
}
scoreBar.appendTo($('.feedback-scorebar', $myDom));
scoreBar.setScore(finals);
$('.feedback-text', $myDom).html(scoreString);
}
self.trigger('resize');
};

View File

@ -92,6 +92,11 @@
{
"label": "عرض النتائج"
},
{
"label": "No results message",
"description": "Text displayed on end page when \"Display results\" is disabled",
"default": "Finished"
},
{
"label": "نص راس الملاحظات",
"description": "سيتم عرض هذا العنوان في نهاية هذه المسابقة حيثما أجاب المستخدم على جميع الأسئلة المستعملة"

View File

@ -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:",

View File

@ -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."

View File

@ -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."

View File

@ -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:",

View File

@ -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:",

View File

@ -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",