From 1177ac68b776859b3cb2c9d44272d3d02a032e7b Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 3 May 2016 11:39:41 +0200 Subject: [PATCH 01/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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/73] 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; }); From 87a1d722ca419b4dd0065f32a2d27a4c11081850 Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Wed, 22 Jun 2016 09:59:23 +0200 Subject: [PATCH 15/73] Fixed empty aria-label on dots [HFJ-2038] --- js/questionset.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index f8d60dd..788b447 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -40,7 +40,7 @@ H5P.QuestionSet = function (options, contentId) { ' <% if (progressType == "dots") { %>' + '
' + ' <% for (var i=0; i' + - ' ' + + ' ">' + ' <%} %>' + '
' + ' <% } else if (progressType == "textual") { %>' + @@ -140,7 +140,6 @@ H5P.QuestionSet = function (options, contentId) { for (var i = 0; i < params.questions.length; i++) { var question = params.questions[i]; - question.jumpAriaLabel = params.texts.jumpToQuestion.replace('%d', i + 1); if (override) { // Extend subcontent with the overrided settings. $.extend(question.params.behaviour, override); From 653d12a85ed3e0ae0edb9953781713878d94dcac Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Mon, 27 Jun 2016 11:43:00 +0200 Subject: [PATCH 16/73] Make readspeakers announce current question of total when changing question. HFJ-2041 --- css/questionset.css | 7 +++++++ js/questionset.js | 15 ++++++++++++++- 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 | 7 +++++++ 9 files changed, 58 insertions(+), 1 deletion(-) diff --git a/css/questionset.css b/css/questionset.css index 5e9cd9b..1786d12 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -125,6 +125,13 @@ transition: none; } +.qs-progress-announcer { + height: 0; + width: 0; + position: absolute; + overflow: hidden; +} + .h5p-question .h5p-question-prev, .h5p-question .h5p-question-finish, .h5p-question .h5p-question-next { diff --git a/js/questionset.js b/js/questionset.js index 788b447..9d87537 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -31,6 +31,7 @@ H5P.QuestionSet = function (options, contentId) { ' ' + '
' + '<% } %>' + + '
' + '
' + ' <% for (var i=0; i' + '
' + @@ -88,7 +89,8 @@ H5P.QuestionSet = function (options, contentId) { finishButton: 'Finish', textualProgress: 'Question: @current of @total questions', jumpToQuestion: 'Jump to question %d', - questionLabel: 'Question' + questionLabel: 'Question', + readSpeakerProgress: 'Question @current of @total' }, endGame: { showResultPage: true, @@ -224,6 +226,17 @@ H5P.QuestionSet = function (options, contentId) { $('.progress-dot:eq(' + questionNumber +')', $myDom).addClass('current'); } + // Announce question number of total, must use timeout because of buttons logic + setTimeout(function () { + var humanizedProgress = params.texts.readSpeakerProgress + .replace('@current', (currentQuestion + 1).toString()) + .replace('@total', questionInstances.length.toString()); + + $('.qs-progress-announcer', $myDom) + .html(humanizedProgress) + .focus(); + }, 0); + // Remember where we are _updateButtons(); self.trigger('resize'); diff --git a/language/ar.json b/language/ar.json index 5217dad..bd1d4e0 100644 --- a/language/ar.json +++ b/language/ar.json @@ -83,6 +83,11 @@ { "label": "Copyright dialog question label", "default": "Question" + }, + { + "label": "Readspeaker progress", + "description": "May use @current and @total question variables", + "default": "Question @current of @total" } ] }, diff --git a/language/de.json b/language/de.json index 82a29c6..a89cdba 100644 --- a/language/de.json +++ b/language/de.json @@ -88,6 +88,11 @@ { "label": "Copyright dialog question label", "default": "Question" + }, + { + "label": "Readspeaker progress", + "description": "May use @current and @total question variables", + "default": "Question @current of @total" } ] }, diff --git a/language/fr.json b/language/fr.json index 23f6fb9..ed64dc7 100644 --- a/language/fr.json +++ b/language/fr.json @@ -83,6 +83,11 @@ { "label": "Copyright dialog question label", "default": "Question" + }, + { + "label": "Readspeaker progress", + "description": "May use @current and @total question variables", + "default": "Question @current of @total" } ] }, diff --git a/language/it.json b/language/it.json index 8af2417..1e43746 100644 --- a/language/it.json +++ b/language/it.json @@ -83,6 +83,11 @@ { "label": "Copyright dialog question label", "default": "Question" + }, + { + "label": "Readspeaker progress", + "description": "May use @current and @total question variables", + "default": "Question @current of @total" } ] }, diff --git a/language/nb.json b/language/nb.json index 84783da..4702512 100644 --- a/language/nb.json +++ b/language/nb.json @@ -85,6 +85,11 @@ { "label": "Opphavsrett spørsmål-etikett", "default": "Spørsmål" + }, + { + "label": "Fremdriftstekst for hjelpemiddelteknologi", + "description": "Kan bruke @current og @total variabler", + "default": "Deloppgave @current av @total" } ] }, diff --git a/language/nn.json b/language/nn.json index 5e47a98..7f14bd7 100644 --- a/language/nn.json +++ b/language/nn.json @@ -85,6 +85,11 @@ { "label": "Opphavsrett spørsmål-etikett", "default": "Spørsmål" + }, + { + "label": "Fremdriftstekst for hjelpemiddelteknologi", + "description": "Kan bruke @current og @total variabler", + "default": "Deloppgave @current av @total" } ] }, diff --git a/semantics.json b/semantics.json index 1ce4c57..b60dbd0 100644 --- a/semantics.json +++ b/semantics.json @@ -165,6 +165,13 @@ "type": "text", "label": "Copyright dialog question label", "default": "Question" + }, + { + "name": "readSpeakerProgress", + "type": "text", + "label": "Readspeaker progress", + "description": "May use @current and @total question variables", + "default": "Question @current of @total" } ] }, From 45af3ef06e832dd4f31483462cf0be4b14a5f759 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Mon, 27 Jun 2016 11:59:36 +0200 Subject: [PATCH 17/73] Make sure to show announcer when changing it, since resetTask hides it. HFJ-2041 --- js/questionset.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/questionset.js b/js/questionset.js index 9d87537..6f3ceb0 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -233,6 +233,7 @@ H5P.QuestionSet = function (options, contentId) { .replace('@total', questionInstances.length.toString()); $('.qs-progress-announcer', $myDom) + .show() .html(humanizedProgress) .focus(); }, 0); From 7bcd2472bac436ef96f65441cf3604cafa13f209 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Mon, 27 Jun 2016 15:42:31 +0200 Subject: [PATCH 18/73] Read feedback when changing question. Do not read feedback when showing all solutions. HFJ-2043 --- js/questionset.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/questionset.js b/js/questionset.js index 6f3ceb0..079876c 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -236,6 +236,10 @@ H5P.QuestionSet = function (options, contentId) { .show() .html(humanizedProgress) .focus(); + + if (instance && instance.readFeedback) { + instance.readFeedback(); + } }, 0); // Remember where we are @@ -252,7 +256,10 @@ H5P.QuestionSet = function (options, contentId) { var showSolutions = function () { for (var i = 0; i < questionInstances.length; i++) { try { + // Do not read answers + questionInstances[i].toggleReadSpeaker(true); questionInstances[i].showSolutions(); + questionInstances[i].toggleReadSpeaker(false); } catch(error) { H5P.error("subcontent does not contain a valid showSolutions function"); From 917a8ed3c471b53c060b69c3a967e3928e166a78 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Tue, 28 Jun 2016 12:29:15 +0200 Subject: [PATCH 19/73] Reset individual questions on retry. Remove finish button if a question is reset. Remove dot styling if a question is reset. HFJ-2044 --- js/questionset.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 079876c..4b9e440 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -180,9 +180,14 @@ H5P.QuestionSet = function (options, contentId) { answered = answered && (questionInstances[i]).getAnswerGiven(); } - if (currentQuestion === (params.questions.length - 1) && answered && + if (currentQuestion === (params.questions.length - 1) && questionInstances[currentQuestion]) { - questionInstances[currentQuestion].showButton('finish'); + if (answered) { + questionInstances[currentQuestion].showButton('finish'); + } + else { + questionInstances[currentQuestion].hideButton('finish'); + } } }; @@ -222,7 +227,14 @@ H5P.QuestionSet = function (options, contentId) { } else { // Set currentNess - $('.progress-dot.current', $myDom).removeClass('current'); + var $currentQuestion = $('.progress-dot.current', $myDom); + var previousQuestion = $currentQuestion.index(); + $currentQuestion.removeClass('current'); + if (previousQuestion >= 0 && !questionInstances[previousQuestion].getAnswerGiven()) { + $currentQuestion + .removeClass('answered') + .addClass('unanswered'); + } $('.progress-dot:eq(' + questionNumber +')', $myDom).addClass('current'); } From bc5668a4a006b64aa55681c0483b5e8a9c1a3001 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Tue, 28 Jun 2016 15:07:05 +0200 Subject: [PATCH 20/73] Accessible navigation line. Made readspeakers abel to announce all visible elements of the navigation line, i.e. answered/unanswered, current, and number. HFJ-2040 --- js/questionset.js | 71 +++++++++++++++++++++++++++++++++++++---------- language/ar.json | 12 ++++++++ language/de.json | 12 ++++++++ language/fr.json | 12 ++++++++ language/it.json | 12 ++++++++ language/nb.json | 12 ++++++++ language/nn.json | 12 ++++++++ semantics.json | 18 ++++++++++++ 8 files changed, 147 insertions(+), 14 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 4b9e440..2670ddc 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -41,7 +41,7 @@ H5P.QuestionSet = function (options, contentId) { ' <% if (progressType == "dots") { %>' + '
' + ' <% for (var i=0; i' + - ' ">' + + ' ">' + ' <%} %>' + '
' + ' <% } else if (progressType == "textual") { %>' + @@ -90,7 +90,10 @@ H5P.QuestionSet = function (options, contentId) { textualProgress: 'Question: @current of @total questions', jumpToQuestion: 'Jump to question %d', questionLabel: 'Question', - readSpeakerProgress: 'Question @current of @total' + readSpeakerProgress: 'Question @current of @total', + unansweredText: 'Unanswered', + answeredText: 'Answered', + currentQuestionText: 'Current question' }, endGame: { showResultPage: true, @@ -227,15 +230,12 @@ H5P.QuestionSet = function (options, contentId) { } else { // Set currentNess - var $currentQuestion = $('.progress-dot.current', $myDom); - var previousQuestion = $currentQuestion.index(); - $currentQuestion.removeClass('current'); - if (previousQuestion >= 0 && !questionInstances[previousQuestion].getAnswerGiven()) { - $currentQuestion - .removeClass('answered') - .addClass('unanswered'); + var previousQuestion = $('.progress-dot.current', $myDom).index(); + if (previousQuestion >= 0) { + toggleCurrentDot(previousQuestion, false); + toggleAnsweredDot(previousQuestion, questionInstances[previousQuestion].getAnswerGiven()); } - $('.progress-dot:eq(' + questionNumber +')', $myDom).addClass('current'); + toggleCurrentDot(questionNumber, true); } // Announce question number of total, must use timeout because of buttons logic @@ -300,7 +300,9 @@ H5P.QuestionSet = function (options, contentId) { questionInstances[questionInstances.length - 1].hideButton('finish'); // Mark all tasks as unanswered: - $('.progress-dot').removeClass('answered').addClass('unanswered'); + $('.progress-dot').each(function (idx) { + toggleAnsweredDot(idx, false); + }); //Force the last page to be reRendered rendered = false; @@ -323,6 +325,48 @@ H5P.QuestionSet = function (options, contentId) { } }; + /** + * Toggle answered state of dot at given index + * @param {number} dotIndex Index of dot + * @param {boolean} isAnswered True if is answered, False if not answered + */ + var toggleAnsweredDot = function(dotIndex, isAnswered) { + var $el = $('.progress-dot:eq(' + dotIndex +')', $myDom); + + // Skip current button + if ($el.hasClass('current')) { + return; + } + + var label = (isAnswered ? params.texts.answeredText : params.texts.unansweredText) + + ', ' + + params.texts.jumpToQuestion.replace('%d', (dotIndex + 1).toString()); + + $el.toggleClass('unanswered', !isAnswered) + .toggleClass('answered', isAnswered) + .attr('aria-label', label); + }; + + /** + * Toggle current state of dot at given index + * @param dotIndex + * @param isCurrent + */ + var toggleCurrentDot = function (dotIndex, isCurrent) { + var $el = $('.progress-dot:eq(' + dotIndex +')', $myDom); + var texts = params.texts; + var label = texts.currentQuestionText + ', '; + + if (!isCurrent) { + var isAnswered = $el.hasClass('answered'); + label = (isAnswered ? texts.answeredText : texts.unansweredText) + ', '; + } + + label += texts.jumpToQuestion.replace('%d', (dotIndex + 1).toString()); + $el.toggleClass('current', isCurrent) + .attr('aria-label', label); + }; + var _displayEndGame = function () { if (rendered) { $myDom.children().hide().filter('.questionset-results').show(); @@ -536,9 +580,8 @@ H5P.QuestionSet = function (options, contentId) { if (shortVerb === 'interacted' || shortVerb === 'answered' || shortVerb === 'attempted') { - if (questionInstances[currentQuestion].getAnswerGiven()) { - $('.progress-dot:eq(' + currentQuestion +')', $myDom).removeClass('unanswered').addClass('answered'); - } + toggleAnsweredDot(currentQuestion, + questionInstances[currentQuestion].getAnswerGiven()); _updateButtons(); } if (shortVerb === 'completed') { diff --git a/language/ar.json b/language/ar.json index bd1d4e0..c8f4942 100644 --- a/language/ar.json +++ b/language/ar.json @@ -88,6 +88,18 @@ "label": "Readspeaker progress", "description": "May use @current and @total question variables", "default": "Question @current of @total" + }, + { + "label": "Unanswered question text", + "default": "Unanswered" + }, + { + "label": "Answered question text", + "default": "Answered" + }, + { + "label": "Current question text", + "default": "Current question" } ] }, diff --git a/language/de.json b/language/de.json index a89cdba..eefb75b 100644 --- a/language/de.json +++ b/language/de.json @@ -93,6 +93,18 @@ "label": "Readspeaker progress", "description": "May use @current and @total question variables", "default": "Question @current of @total" + }, + { + "label": "Unanswered question text", + "default": "Unanswered" + }, + { + "label": "Answered question text", + "default": "Answered" + }, + { + "label": "Current question text", + "default": "Current question" } ] }, diff --git a/language/fr.json b/language/fr.json index ed64dc7..ad1aea9 100644 --- a/language/fr.json +++ b/language/fr.json @@ -88,6 +88,18 @@ "label": "Readspeaker progress", "description": "May use @current and @total question variables", "default": "Question @current of @total" + }, + { + "label": "Unanswered question text", + "default": "Unanswered" + }, + { + "label": "Answered question text", + "default": "Answered" + }, + { + "label": "Current question text", + "default": "Current question" } ] }, diff --git a/language/it.json b/language/it.json index 1e43746..f29ecf6 100644 --- a/language/it.json +++ b/language/it.json @@ -88,6 +88,18 @@ "label": "Readspeaker progress", "description": "May use @current and @total question variables", "default": "Question @current of @total" + }, + { + "label": "Unanswered question text", + "default": "Unanswered" + }, + { + "label": "Answered question text", + "default": "Answered" + }, + { + "label": "Current question text", + "default": "Current question" } ] }, diff --git a/language/nb.json b/language/nb.json index 4702512..503a1d1 100644 --- a/language/nb.json +++ b/language/nb.json @@ -90,6 +90,18 @@ "label": "Fremdriftstekst for hjelpemiddelteknologi", "description": "Kan bruke @current og @total variabler", "default": "Deloppgave @current av @total" + }, + { + "label": "Ikke svart på spørsmål-tekst", + "default": "Ikke svart" + }, + { + "label": "Svart på spørsmål-tekst", + "default": "Svar avgitt" + }, + { + "label": "Aktivt spørsmål-tekst", + "default": "Aktivt spørsmål" } ] }, diff --git a/language/nn.json b/language/nn.json index 7f14bd7..d92e638 100644 --- a/language/nn.json +++ b/language/nn.json @@ -90,6 +90,18 @@ "label": "Fremdriftstekst for hjelpemiddelteknologi", "description": "Kan bruke @current og @total variabler", "default": "Deloppgave @current av @total" + }, + { + "label": "Ikke svart på spørsmål-tekst", + "default": "Ikke svart" + }, + { + "label": "Svart på spørsmål-tekst", + "default": "Svar avgitt" + }, + { + "label": "Aktivt spørsmål-tekst", + "default": "Aktivt spørsmål" } ] }, diff --git a/semantics.json b/semantics.json index b60dbd0..45c80b4 100644 --- a/semantics.json +++ b/semantics.json @@ -172,6 +172,24 @@ "label": "Readspeaker progress", "description": "May use @current and @total question variables", "default": "Question @current of @total" + }, + { + "name": "unansweredText", + "type": "text", + "label": "Unanswered question text", + "default": "Unanswered" + }, + { + "name": "answeredText", + "type": "text", + "label": "Answered question text", + "default": "Answered" + }, + { + "name": "currentQuestionText", + "type": "text", + "label": "Current question text", + "default": "Current question" } ] }, From 6c82013c840d02bcc21f43ace8a62fa037ab4367 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Thu, 30 Jun 2016 09:47:24 +0200 Subject: [PATCH 21/73] Improved how navigation dots are read. HFJ-2040 --- js/questionset.js | 26 ++++++++++++++++++-------- language/ar.json | 4 ++-- language/de.json | 4 ++-- language/fr.json | 4 ++-- language/it.json | 4 ++-- language/nb.json | 4 ++-- language/nn.json | 4 ++-- semantics.json | 4 ++-- 8 files changed, 32 insertions(+), 22 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 2670ddc..24a017e 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -39,9 +39,13 @@ H5P.QuestionSet = function (options, contentId) { '