From 1177ac68b776859b3cb2c9d44272d3d02a032e7b Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 3 May 2016 11:39:41 +0200 Subject: [PATCH 01/14] Bumped patch version --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index b50a5f1..64ffa25 100644 --- a/library.json +++ b/library.json @@ -4,7 +4,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 8, - "patchVersion": 1, + "patchVersion": 2, "embedTypes": [ "iframe" ], From 11f7a2ba3356708a116b36020afcc814f60af858 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Mon, 9 May 2016 09:32:56 +0200 Subject: [PATCH 02/14] Not invoking getAnswerGiven() initially [HFJ-1876] --- js/questionset.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 945d2d5..0c1fdc1 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -507,9 +507,6 @@ H5P.QuestionSet = function (options, contentId) { } event.data.statement.context.extensions['http://id.tincanapi.com/extension/ending-point'] = currentQuestion + 1; }); - if (question.getAnswerGiven()) { - $('.progress-dot:eq(' + i +')', $myDom).removeClass('unanswered').addClass('answered'); - } } // Allow other libraries to add transitions after the questions have been inited @@ -530,7 +527,6 @@ H5P.QuestionSet = function (options, contentId) { // Hide all but initial Question. _showQuestion(params.initialQuestion); - _updateButtons(); if (renderSolutions) { showSolutions(); From 510123993a771e0cc40889d97b8f683314a6d0bf Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Mon, 9 May 2016 15:30:22 +0200 Subject: [PATCH 03/14] Making end-video using 100% width [HFJ-1875] --- css/questionset.css | 1 + js/questionset.js | 2 ++ 2 files changed, 3 insertions(+) diff --git a/css/questionset.css b/css/questionset.css index 6f5cf48..5e9cd9b 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -178,6 +178,7 @@ } .video-container > video { background-color: #000; + width: 100%; } .video-container > .h5p-button { position: absolute; diff --git a/js/questionset.js b/js/questionset.js index 0c1fdc1..d4cf49d 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -373,6 +373,8 @@ H5P.QuestionSet = function (options, contentId) { scoreBar.appendTo($('.feedback-scorebar', $myDom)); scoreBar.setScore(finals); $('.feedback-text', $myDom).html(scoreString); + + self.trigger('resize'); }; if (params.endGame.showAnimations) { From 3c8adbb1b342a7212e6fb79aa8648aab9bc1bc4a Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Wed, 11 May 2016 09:56:28 +0200 Subject: [PATCH 04/14] More consistency in texts [HFJ-1877] --- language/nb.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/language/nb.json b/language/nb.json index bfe4399..52f0abc 100644 --- a/language/nb.json +++ b/language/nb.json @@ -126,7 +126,7 @@ }, { "label": "Tekst til \"Fasit\" knapp", - "default": "Gå gjennom fasit.", + "default": "Gå gjennom fasit", "description": "" }, { From 636857931ab7003cdb745674c08d1cb9d8a67caa Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Fri, 13 May 2016 11:30:13 +0200 Subject: [PATCH 05/14] Updated dependency to latest DragQuestion --- semantics.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantics.json b/semantics.json index b292c54..f373ebe 100644 --- a/semantics.json +++ b/semantics.json @@ -111,7 +111,7 @@ "description": "Library for this question.", "options": [ "H5P.MultiChoice 1.6", - "H5P.DragQuestion 1.5", + "H5P.DragQuestion 1.6", "H5P.Blanks 1.5", "H5P.MarkTheWords 1.5", "H5P.DragText 1.4" From 9380a9ea98c50db4e98094122c0361314fc09fac Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Fri, 20 May 2016 09:33:45 +0200 Subject: [PATCH 06/14] Made disabled show results show a minimalistic end page [HFJ-1935] --- js/questionset.js | 26 +++++++++++++------------- language/ar.json | 5 +++++ language/de.json | 5 +++++ language/fr.json | 5 +++++ language/it.json | 5 +++++ language/nb.json | 5 +++++ language/nn.json | 5 +++++ semantics.json | 8 ++++++++ 8 files changed, 51 insertions(+), 13 deletions(-) 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", From 1a36c88e66b72f877c76f5eee72ad2c853a5abf1 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 23 May 2016 10:16:46 +0200 Subject: [PATCH 07/14] Fix confirm dialog when intro is present HFJ-1929 --- js/questionset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index 24289a9..1462d71 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -148,7 +148,7 @@ H5P.QuestionSet = function (options, contentId) { question.params = question.params || {}; question.params.overrideSettings = question.params.overrideSettings || {}; - question.params.overrideSettings.$confirmationDialogParent = $template; + question.params.overrideSettings.$confirmationDialogParent = $template.last(); question.params.overrideSettings.instance = this; var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self}); From 8f30b1e3a7541345466ca8fdb3246a7d1970c775 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 25 May 2016 09:51:23 +0200 Subject: [PATCH 08/14] Remove buttons when not displaying results Also removed empty feedback section to remove space. HFJ-1935 --- js/questionset.js | 54 +++++++++++++++++++++++++---------------------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 1462d71..0c255a5 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -340,32 +340,32 @@ H5P.QuestionSet = function (options, contentId) { $myDom.children().hide(); $myDom.append(endTemplate.render(eparams)); - // Add event handlers to summary buttons - hookUpButton('.qs-finishbutton', function () { - self.trigger('h5pQuestionSetFinished', eventData); - }); - hookUpButton('.qs-solutionbutton', function () { - showSolutions(); - $myDom.children().hide().filter('.questionset').show(); - _showQuestion(params.initialQuestion); - }); - hookUpButton('.qs-retrybutton', function () { - resetTask(); - $myDom.children().hide(); - - var $intro = $('.intro-page', $myDom); - if ($intro.length) { - // Show intro - $('.intro-page', $myDom).show(); - } - else { - // Show first question - $('.questionset', $myDom).show(); - _showQuestion(params.initialQuestion); - } - }); - if (params.endGame.showResultPage) { + // Add event handlers to summary buttons + hookUpButton('.qs-finishbutton', function () { + self.trigger('h5pQuestionSetFinished', eventData); + }); + hookUpButton('.qs-solutionbutton', function () { + showSolutions(); + $myDom.children().hide().filter('.questionset').show(); + _showQuestion(params.initialQuestion); + }); + hookUpButton('.qs-retrybutton', function () { + resetTask(); + $myDom.children().hide(); + + var $intro = $('.intro-page', $myDom); + if ($intro.length) { + // Show intro + $('.intro-page', $myDom).show(); + } + else { + // Show first question + $('.questionset', $myDom).show(); + _showQuestion(params.initialQuestion); + } + }); + if (scoreBar === undefined) { scoreBar = H5P.JoubelUI.createScoreBar(totals); } @@ -373,6 +373,10 @@ H5P.QuestionSet = function (options, contentId) { scoreBar.setScore(finals); $('.feedback-text', $myDom).html(scoreString); } + else { + // Remove buttons and feedback section + $('.qs-finishbutton, .qs-solutionbutton, .qs-retrybutton, .feedback-section', $myDom).remove(); + } self.trigger('resize'); }; From 5d5c431c1e9d123cd4c70c4cbe44357b902012b8 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 27 May 2016 13:13:33 +0200 Subject: [PATCH 09/14] Updated Question depedency HFJ-1959 --- library.json | 4 ++-- semantics.json | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/library.json b/library.json index 64ffa25..4ffc1b5 100644 --- a/library.json +++ b/library.json @@ -4,7 +4,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 8, - "patchVersion": 2, + "patchVersion": 0, "embedTypes": [ "iframe" ], @@ -61,4 +61,4 @@ "minorVersion": 1 } ] -} \ No newline at end of file +} diff --git a/semantics.json b/semantics.json index f7e9caa..39f8e19 100644 --- a/semantics.json +++ b/semantics.json @@ -110,11 +110,11 @@ "label": "Question type", "description": "Library for this question.", "options": [ - "H5P.MultiChoice 1.6", - "H5P.DragQuestion 1.6", - "H5P.Blanks 1.5", - "H5P.MarkTheWords 1.5", - "H5P.DragText 1.4" + "H5P.MultiChoice 1.7", + "H5P.DragQuestion 1.7", + "H5P.Blanks 1.6", + "H5P.MarkTheWords 1.6", + "H5P.DragText 1.5" ] } }, @@ -360,4 +360,4 @@ } ] } -] +] \ No newline at end of file From 5431b4b06a425fdba93ecd206e74b283157dfce4 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Mon, 30 May 2016 15:04:24 +0200 Subject: [PATCH 10/14] Making dot-status to answered only when getAnswerGiven() returns true --- js/questionset.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index 0c255a5..acd9afb 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -267,6 +267,9 @@ H5P.QuestionSet = function (options, contentId) { // Hide finish button questionInstances[questionInstances.length - 1].hideButton('finish'); + // Mark all tasks as unanswered: + $('.progress-dot').removeClass('answered').addClass('unanswered'); + //Force the last page to be reRendered rendered = false; }; @@ -501,7 +504,9 @@ H5P.QuestionSet = function (options, contentId) { if (shortVerb === 'interacted' || shortVerb === 'answered' || shortVerb === 'attempted') { - $('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered'); + if (questionInstances[currentQuestion].getAnswerGiven()) { + $('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered'); + } _updateButtons(); } if (shortVerb === 'completed') { From cd3471fee8b381da2fe8b608d88896fc801e9638 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 6 Jun 2016 11:32:46 +0200 Subject: [PATCH 11/14] Reverted DQ version --- semantics.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/semantics.json b/semantics.json index 39f8e19..f1e0d31 100644 --- a/semantics.json +++ b/semantics.json @@ -111,7 +111,7 @@ "description": "Library for this question.", "options": [ "H5P.MultiChoice 1.7", - "H5P.DragQuestion 1.7", + "H5P.DragQuestion 1.6", "H5P.Blanks 1.6", "H5P.MarkTheWords 1.6", "H5P.DragText 1.5" @@ -360,4 +360,4 @@ } ] } -] \ No newline at end of file +] From cf84bcc3f5fe5df4c218024b451033e24703907b Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Fri, 10 Jun 2016 13:19:00 +0200 Subject: [PATCH 12/14] Reverted shortening of texts [HFJ-2010] --- js/questionset.js | 4 ++-- semantics.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index acd9afb..d277c3e 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -98,9 +98,9 @@ H5P.QuestionSet = function (options, contentId) { successComment: 'You have enough correct answers to pass the test.', failGreeting: 'Sorry!', failComment: "You don't have enough correct answers to pass this test.", - scoreString: '@score of @total points', + scoreString: 'You got @score of @total points', finishButtonText: 'Finish', - solutionButtonText: 'Solution', + solutionButtonText: 'Show solution', retryButtonText: 'Retry', showAnimations: false, skipButtonText: 'Skip video' diff --git a/semantics.json b/semantics.json index f1e0d31..1ce4c57 100644 --- a/semantics.json +++ b/semantics.json @@ -204,7 +204,7 @@ "type": "text", "label": "Score display text", "description": "Text used to display Total user score. \"@score\" will be replaced by calculated score, \"@total\" will be replaced by maximum possible score. ", - "default": "@score of @total points", + "default": "You got @score of @total points", "optional": true }, { @@ -270,7 +270,7 @@ "name": "solutionButtonText", "type": "text", "label": "Solution button label", - "default": "Solution", + "default": "Show solution", "description": "Text for the solution button." }, { From 70e35bebb747bd99842d2b0c7d3b998eef0a61ce Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 15 Jun 2016 11:04:13 +0200 Subject: [PATCH 13/14] Bumped patch version --- library.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library.json b/library.json index 4ffc1b5..f4e9632 100644 --- a/library.json +++ b/library.json @@ -4,7 +4,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 8, - "patchVersion": 0, + "patchVersion": 3, "embedTypes": [ "iframe" ], From 2a5f6c35aad918a331d0f1cdd78f799f29419cea Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Thu, 16 Jun 2016 10:15:06 +0200 Subject: [PATCH 14/14] xAPI Context Extensions, use object not array HFJ-2029 --- js/questionset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index d277c3e..f8d60dd 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -514,7 +514,7 @@ H5P.QuestionSet = function (options, contentId) { event.setVerb('answered'); } if (event.data.statement.context.extensions === undefined) { - event.data.statement.context.extensions = []; + event.data.statement.context.extensions = {}; } event.data.statement.context.extensions['http://id.tincanapi.com/extension/ending-point'] = currentQuestion + 1; });