From 3036f888af43c6d94fd34b7e232bed01a73a6528 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Thu, 17 Mar 2016 14:09:13 +0100 Subject: [PATCH 01/39] Fix unused semantics. HFJ-1710 --- js/questionset.js | 42 +++++++++++++++++++++++++----------------- language/ar.json | 8 ++++---- language/de.json | 4 ++++ language/fr.json | 8 ++++---- language/it.json | 8 ++++---- language/nb.json | 8 ++++---- language/nn.json | 8 ++++---- library.json | 2 +- semantics.json | 12 ++++++------ upgrades.js | 10 ++++++++++ 10 files changed, 66 insertions(+), 44 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index c34a4a8..50151c4 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -79,7 +79,8 @@ H5P.QuestionSet = function (options, contentId) { prevButton: 'Previous', nextButton: 'Next', finishButton: 'Finish', - textualProgress: 'Question: @current of @total questions' + textualProgress: 'Question: @current of @total questions', + questionLabel: 'Question' }, endGame: { showResultPage: true, @@ -92,14 +93,14 @@ H5P.QuestionSet = function (options, contentId) { finishButtonText: 'Finish', solutionButtonText: 'Show solution', retryButtonText: 'Retry', - showAnimations: false + showAnimations: false, + skipButtonText: 'Skip video' }, override: { overrideButtons: false, overrideShowSolutionButton: false, overrideRetry: false - }, - questionLabel: 'Question' + } }; var template = new EJS({text: texttemplate}); @@ -252,6 +253,17 @@ H5P.QuestionSet = function (options, contentId) { rendered = false; }; + var moveQuestion = function (direction) { + _stopQuestion(currentQuestion); + if (currentQuestion + direction >= questionInstances.length) { + _displayEndGame(); + + } + else { + _showQuestion(currentQuestion + direction); + } + }; + var _displayEndGame = function () { if (rendered) { $myDom.children().hide().filter('.questionset-results').show(); @@ -406,26 +418,22 @@ H5P.QuestionSet = function (options, contentId) { if (questionInstances[questionInstances.length -1] === question) { // Add finish question set button - question.addButton('finish', params.texts.finishButton, function () { - _stopQuestion(currentQuestion); - _displayEndGame(); - }, false); + question.addButton('finish', params.texts.finishButton, + moveQuestion.bind(this, 1), false); } else { // Add next question button - question.addButton('next', '', function () { - _stopQuestion(currentQuestion); - _showQuestion(currentQuestion + 1); - }); + question.addButton('next', '', moveQuestion.bind(this, 1), true, + {title: params.texts.nextButton}); } // Add previous question button if (questionInstances[0] !== question) { - question.addButton('prev', '', function () { - _stopQuestion(currentQuestion); - _showQuestion(currentQuestion - 1); - }); + + question.addButton('prev', '', moveQuestion.bind(this, -1), true, + {title: params.texts.prevButton} + ); } question.on('xAPI', function (event) { @@ -529,7 +537,7 @@ H5P.QuestionSet = function (options, contentId) { } // Determine label - var label = (params.questionLabel + ' ' + (i + 1)); + var label = (params.texts.questionLabel + ' ' + (i + 1)); if (qParams.contentName !== undefined) { label += ': ' + qParams.contentName; } diff --git a/language/ar.json b/language/ar.json index 55032b7..e2c6036 100644 --- a/language/ar.json +++ b/language/ar.json @@ -74,6 +74,10 @@ { "label": "نص التقدم", "description": "النص المستخدم إذا تم تحديد التقدم نصيا" + }, + { + "label": "Question label text", + "default": "Question" } ] }, @@ -154,10 +158,6 @@ "description": "تفعيل هذا الخيار يجعل المستخدم قادرا على \"إعادة المحاولة\"" } ] - }, - { - "label": "Question label text", - "default": "Question" } ] } diff --git a/language/de.json b/language/de.json index 428a353..bbb1aae 100644 --- a/language/de.json +++ b/language/de.json @@ -79,6 +79,10 @@ "label": "Fortschrittstext", "description": "Verwendeter Text wenn Text Fortschrittsanzeige gewählt wurde.", "default": "Aktuelle Frage: @current von @total Fragen" + }, + { + "label": "Question label text", + "default": "Question" } ] }, diff --git a/language/fr.json b/language/fr.json index 27eb841..9120558 100644 --- a/language/fr.json +++ b/language/fr.json @@ -74,6 +74,10 @@ { "label": "Texte de progression", "description": "Texte utilisé si la progression textuelle est utilisée." + }, + { + "label": "Question label text", + "default": "Question" } ] }, @@ -154,10 +158,6 @@ "description": "Affiche le bouton \"Réessayer\"." } ] - }, - { - "label": "Texte de la question", - "default": "Question" } ] } diff --git a/language/it.json b/language/it.json index 6f52c6f..9617f83 100644 --- a/language/it.json +++ b/language/it.json @@ -74,6 +74,10 @@ { "label": "Testo Avanzamento", "description": "esto utilizzato se il testo Avanzamento è selezionato." + }, + { + "label": "Question label text", + "default": "Question" } ] }, @@ -154,10 +158,6 @@ "description": "L'attivazione di questa opzione farà in modo che per l'utente sia abilitata l'opzione \"Riprova\"." } ] - }, - { - "label": "Question label text", - "default": "Question" } ] } diff --git a/language/nb.json b/language/nb.json index 023a101..cbc3739 100644 --- a/language/nb.json +++ b/language/nb.json @@ -76,6 +76,10 @@ "label": "Fremdriftstekst", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", "default": "Deloppgave @current av @total" + }, + { + "label": "Spørsmåls-etikett", + "default": "Spørsmål" } ] }, @@ -166,10 +170,6 @@ "description": "Aktivering vil slå på \"Prøv igjen\" ." } ] - }, - { - "label": "Spørsmål-etikett", - "default": "Spørsmål" } ] } diff --git a/language/nn.json b/language/nn.json index 106be80..223eb8a 100644 --- a/language/nn.json +++ b/language/nn.json @@ -76,6 +76,10 @@ "label": "Fremdriftstekst", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", "default": "Deloppgave @current av @total" + }, + { + "label": "Spørsmål-etikett", + "default": "Spørsmål" } ] }, @@ -166,10 +170,6 @@ "description": "Aktivering vil slå på \"Prøv igjen\" ." } ] - }, - { - "label": "Spørsmål-etikett", - "default": "Spørsmål" } ] } diff --git a/library.json b/library.json index b110dda..62bb6ac 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "description": "Put together a set of different questions that has to be solved. (Quiz)", "contentType": "question", "majorVersion": 1, - "minorVersion": 7, + "minorVersion": 8, "patchVersion": 0, "embedTypes": [ "iframe" diff --git a/semantics.json b/semantics.json index de90e20..de7fd8f 100644 --- a/semantics.json +++ b/semantics.json @@ -152,6 +152,12 @@ "strong", "em" ] + }, + { + "name": "questionLabel", + "type": "text", + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -326,11 +332,5 @@ "default": false } ] - }, - { - "name": "questionLabel", - "type": "text", - "label": "Question label text", - "default": "Question" } ] diff --git a/upgrades.js b/upgrades.js index 77c5add..598c89a 100644 --- a/upgrades.js +++ b/upgrades.js @@ -14,6 +14,16 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) { }); } } + finished(null, parameters); + }, + 8: function (parameters, finished) { + parameters.texts = parameters.texts || {}; + + if (parameters.questionLabel) { + parameters.texts.questionLabel = parameters.questionLabel; + delete parameters.questionLabel; + } + finished(null, parameters); } } From bb943bbb3ba30cae0672a71a2cc581e8e88895f9 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 4 Apr 2016 15:50:41 +0200 Subject: [PATCH 02/39] Easier to use override --- js/questionset.js | 31 +++++++++++++++++------------ language/ar.json | 29 ++++++++++++++++++--------- language/de.json | 29 ++++++++++++++++++--------- language/fr.json | 29 ++++++++++++++++++--------- language/it.json | 29 ++++++++++++++++++--------- language/nb.json | 31 +++++++++++++++++++---------- language/nn.json | 31 +++++++++++++++++++---------- library.json | 2 +- semantics.json | 50 +++++++++++++++++++++++++++++------------------ upgrades.js | 27 +++++++++++++++++++++++++ 10 files changed, 200 insertions(+), 88 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index c34a4a8..abac1c2 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -94,11 +94,6 @@ H5P.QuestionSet = function (options, contentId) { retryButtonText: 'Retry', showAnimations: false }, - override: { - overrideButtons: false, - overrideShowSolutionButton: false, - overrideRetry: false - }, questionLabel: 'Question' }; @@ -113,18 +108,30 @@ H5P.QuestionSet = function (options, contentId) { var up; renderSolutions = false; + // Set overrides for questions + var override; + if (params.override.showSolutionButton || params.override.retryButton) { + override = {}; + if (params.override.showSolutionButton) { + // Force "Show solution" button to be on or off for all interactions + override.enableSolutionsButton = + (params.override.showSolutionButton === 'on' ? true : false); + } + + if (params.override.retryButton) { + // Force "Retry" button to be on or off for all interactions + override.enableRetry = + (params.override.retryButton === 'on' ? true : false); + } + } + // Instantiate question instances for (var i = 0; i < params.questions.length; i++) { var question = params.questions[i]; - // TODO: Render on init, inject in template. - // override content parameters. - if (params.override.overrideButtons) { + if (override) { // Extend subcontent with the overrided settings. - $.extend(question.params.behaviour, { - enableRetry: params.override.overrideRetry, - enableSolutionsButton: params.override.overrideShowSolutionButton - }); + $.extend(question.params.behaviour, override); } var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self}); questionInstance.on('resize', function () { diff --git a/language/ar.json b/language/ar.json index 55032b7..b2b1edd 100644 --- a/language/ar.json +++ b/language/ar.json @@ -139,19 +139,30 @@ }, { "label": "إعدادات زر \"مشاهدة حل \" وزر \"إعادة المحاولة\" ", - "description": "وهذه الخيارات تمكنك من تجاوز وقت العرض بزر \"مشاهدة حل \" وزر \"إعادة المحاولة \" في محتويات متكامل h5p.", "fields": [ { - "label": "تفعيل زر تجاوز \"مشاهدة حل \" و إعدادات \"إعادة \"المحاولة", - "description": "وإذا تم تفعيل هذه الأسئلة سيتم تجاهل الإعدادات الخاصة وسيتم استخدام الضبط أدناه بدلا من ذلك" + "label": "Override \"Show Solution\" button", + "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] }, { - "label": "تفعيل زر \"إظهار الحل\"", - "description": "تفعيل هذا الخيار يجعل الأسئلة تظهر زر \"مشاهدة الحل\"" - }, - { - "label": "تفعيل زر \"إعادة المحاولة\"", - "description": "تفعيل هذا الخيار يجعل المستخدم قادرا على \"إعادة المحاولة\"" + "label": "Override \"Retry\" button", + "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] } ] }, diff --git a/language/de.json b/language/de.json index 428a353..b1b9bc8 100644 --- a/language/de.json +++ b/language/de.json @@ -154,19 +154,30 @@ }, { "label": "Einstellungen für \"Zeige die Lösung\" Button und \"Nochmal\".", - "description": "Diese Möglichkeiten überschreiben die Anzeige von \"Zeige die Lösung\" Button und \"Nochmal\" bei integrierten h5p Inhalten.", "fields": [ { - "label": "Aktiviert das Überschreiben für \"Zeige die Lösung\" Button und \"Wiederholen\" Einstellungen.", - "description": "Wenn dies ausgewählt wurde, werden die Einstellungen der Frage ignoriert und stattdessen werden die nachfolgenden Einstellungen verwendet." + "label": "Override \"Show Solution\" button", + "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] }, { - "label": "Aktiviert \"Zeige die Lösung\" Buttons.", - "description": "Wenn dies ausgewählt wurde, werden die Fragen den \"Zeige die Lösung\" Button haben." - }, - { - "label": "Aktiviert \"Wiederholen\".", - "description": "Wenn diese Option gewählt wurde, ermöglicht es den Benutzern zu \"Wiederholen\" ." + "label": "Override \"Retry\" button", + "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] } ] } diff --git a/language/fr.json b/language/fr.json index 27eb841..7d01efc 100644 --- a/language/fr.json +++ b/language/fr.json @@ -139,19 +139,30 @@ }, { "label": "Options pour les boutons \"Montrer la solution\" et \"Réessayer\".", - "description": "Ces options vous permettent de choisir quand afficher les boutons \"Solutions\" et \"Réessayer\" dans votre acivité h5p..", "fields": [ { - "label": "Activer les réglages par défaut pour les boutons \"Solution\" et \"Réessayer\".", - "description": "Si cette option est choisie, les réglages seront valables pour toutes les questions, les réglages individuels ne seront pas pris en compte." + "label": "Override \"Show Solution\" button", + "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] }, { - "label": "Afficher le bouton \"Solution\".", - "description": "Affiche le bouton \"Solution\"." - }, - { - "label": "Afficher le bouton \"Réessayer\".", - "description": "Affiche le bouton \"Réessayer\"." + "label": "Override \"Retry\" button", + "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] } ] }, diff --git a/language/it.json b/language/it.json index 6f52c6f..bc2725e 100644 --- a/language/it.json +++ b/language/it.json @@ -139,19 +139,30 @@ }, { "label": "Impostazioni per i pulsanti \"Mostra soluzione\" e \"Riprova\".", - "description": "Queste opzioni consentono di ignorare quando visualizzare i pulsanti \"Mostra soluzione\" e \"Riprova\" nel contenuto H5P integrato.", "fields": [ { - "label": "Abilita ignora impostazioni per \"Mostra soluzione\" e \"Riprova\".", - "description": "Se questa opzione è abilitata le proprie impostazioni per le domande saranno ignorate e verranno utilizzate le impostazioni seguenti." + "label": "Override \"Show Solution\" button", + "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] }, { - "label": "Abilita pulsanti \"Mostra soluzione\".", - "description": "L'attivazione di questa opzione farà in modo che le domande mostrino il tasto \"Mostra soluzione\"." - }, - { - "label": "Abilita \"Riprova\".", - "description": "L'attivazione di questa opzione farà in modo che per l'utente sia abilitata l'opzione \"Riprova\"." + "label": "Override \"Retry\" button", + "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.", + "options": [ + { + "label": "Enabled" + }, + { + "label": "Disabled" + } + ] } ] }, diff --git a/language/nb.json b/language/nb.json index 023a101..880001d 100644 --- a/language/nb.json +++ b/language/nb.json @@ -150,20 +150,31 @@ ] }, { - "label": "Innstillinger for \"Vis svar\" knapp og \"Prøv igjen\".", - "description": "Disse instillingene lar deg overstyre når \"Vis svar\" knapp og \"Prøv igjen\" er slått på i integrert h5p innhold.", + "label": "Innstillinger for «Vis svar»- og «Prøv igjen»-knapp", "fields": [ { - "label": "Slå på overstyring for \"Vis svar\" og \"Prøv igjen\".", - "description": "Aktivering vil overstyre de følgende innstillingene for integrert innhold." + "label": "Overstyr «Vis svar»-knapp", + "description": "Dette valget avgjør om «Vis svar»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", + "options": [ + { + "label": "Aktivert" + }, + { + "label": "Deaktivert" + } + ] }, { - "label": "Slå på \"Vis svar\" knapp.", - "description": "Aktivering vil slå på \"Vis svar\" knappen." - }, - { - "label": "Slå på \"Prøv igjen\".", - "description": "Aktivering vil slå på \"Prøv igjen\" ." + "label": "Overstyr «Prøv igjen»-knapp", + "description": "Dette valget avgjør om «Prøv igjen»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", + "options": [ + { + "label": "Aktivert" + }, + { + "label": "Deaktivert" + } + ] } ] }, diff --git a/language/nn.json b/language/nn.json index 106be80..216333e 100644 --- a/language/nn.json +++ b/language/nn.json @@ -150,20 +150,31 @@ ] }, { - "label": "Innstillinger for \"Vis svar\" knapp og \"Prøv igjen\".", - "description": "Disse instillingene lar deg overstyre når \"Vis svar\" knapp og \"Prøv igjen\" er slått på i integrert h5p innhald.", + "label": "Innstillinger for «Vis svar»- og «Prøv igjen»-knapp", "fields": [ { - "label": "Slå på overstyring for \"Vis svar\" og \"Prøv igjen\".", - "description": "Aktivering vil overstyre dei følgjande innstillingene for integrert innhald." + "label": "Overstyr «Vis svar»-knapp", + "description": "Dette valget avgjør om «Vis svar»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", + "options": [ + { + "label": "Aktivert" + }, + { + "label": "Deaktivert" + } + ] }, { - "label": "Slå på \"Vis svar\" knapp.", - "description": "Aktivering vil slå på \"Vis svar\" knappen." - }, - { - "label": "Slå på \"Prøv igjen\".", - "description": "Aktivering vil slå på \"Prøv igjen\" ." + "label": "Overstyr «Prøv igjen»-knapp", + "description": "Dette valget avgjør om «Prøv igjen»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", + "options": [ + { + "label": "Aktivert" + }, + { + "label": "Deaktivert" + } + ] } ] }, diff --git a/library.json b/library.json index b110dda..62bb6ac 100644 --- a/library.json +++ b/library.json @@ -3,7 +3,7 @@ "description": "Put together a set of different questions that has to be solved. (Quiz)", "contentType": "question", "majorVersion": 1, - "minorVersion": 7, + "minorVersion": 8, "patchVersion": 0, "embedTypes": [ "iframe" diff --git a/semantics.json b/semantics.json index de90e20..d670e08 100644 --- a/semantics.json +++ b/semantics.json @@ -300,30 +300,42 @@ { "name": "override", "type": "group", - "label": "Settings for \"Show solution\" button and \"Retry\".", - "description": "These options will let you override when to display \"Show solution\" button and \"Retry\" in integrated h5p content.", + "label": "Settings for \"Show solution\" and \"Retry\" buttons", "optional": true, "fields": [ { - "name": "overrideButtons", - "type": "boolean", - "label": "Enable override for \"Show solution\" and \"Retry\" settings.", - "description": "If this is enabled the questions own settings will be ignored and the below settings will be used instead.", - "default": false + "name": "showSolutionButton", + "type": "select", + "label": "Override \"Show Solution\" button", + "description": "This option determines if the \"Show Solution\" button will be shown for all questions, disabled for all or configured for each question individually.", + "optional": true, + "options": [ + { + "value": "on", + "label": "Enabled" + }, + { + "value": "off", + "label": "Disabled" + } + ] }, { - "name": "overrideShowSolutionButton", - "type": "boolean", - "label": "Enable \"Show solution\" buttons.", - "description": "Enabling this option will make questions show the \"Show solution\" button.", - "default": false - }, - { - "name": "overrideRetry", - "type": "boolean", - "label": "Enable \"Retry\".", - "description": "Enabling this option will make the user able to \"Retry\" .", - "default": false + "name": "retryButton", + "type": "select", + "label": "Override \"Retry\" button", + "description": "This option determines if the \"Retry\" button will be shown for all questions, disabled for all or configured for each question individually.", + "optional": true, + "options": [ + { + "value": "on", + "label": "Enabled" + }, + { + "value": "off", + "label": "Disabled" + } + ] } ] }, diff --git a/upgrades.js b/upgrades.js index 77c5add..210d1ac 100644 --- a/upgrades.js +++ b/upgrades.js @@ -14,6 +14,33 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) { }); } } + finished(null, parameters); + }, + + + /** + * Asynchronous content upgrade hook. + * Upgrades content parameters to support IV 1.7. + * + * Groups all UI text strings to make them eaiser to translate and handle. + * + * @params {Object} parameters + * @params {function} finished + */ + 8: function (parameters, finished) { + if (parameters.override.overrideButtons) { + // Set new variables + parameters.override.showSolutionButton = + (parameters.override.overrideShowSolutionButton ? 'on' : 'off'); + parameters.override.retryButton = + (parameters.override.overrideRetry ? 'on' : 'off'); + } + + // Remove old field variables + delete parameters.override.overrideButtons; + delete parameters.override.overrideShowSolutionButton; + delete parameters.override.overrideRetry; + finished(null, parameters); } } From 40fa6542e66f70a71e11d0fad5bbdfe2459ec914 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Wed, 6 Apr 2016 15:53:50 +0200 Subject: [PATCH 03/39] Show feedback for each question Ref. https://h5p.org/node/8730 HFJ-1747 --- js/questionset.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index abac1c2..8ad3df6 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -406,9 +406,6 @@ H5P.QuestionSet = function (options, contentId) { // Listen for image resize registerImageLoadedListener(question); - // Disable feedback for question - question.setBehaviour({disableFeedback: true}); - // Add next/finish button if (questionInstances[questionInstances.length -1] === question) { From d8be2e07ad300893a580b37b8be8711f4792406d Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Thu, 7 Apr 2016 16:23:15 +0200 Subject: [PATCH 04/39] Added unused semantics to Score/summary screen. HFJ-1710 --- css/questionset.css | 30 ++++++++++++++++++++++++++---- js/questionset.js | 15 +++++++++++++-- 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/css/questionset.css b/css/questionset.css index a6959fa..022d06b 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -190,22 +190,44 @@ text-align: center; background: rgba(255, 255, 255, 0.9); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#E6FFFFFF,endColorstr=#E6FFFFFF); - padding: 0.625em; } .questionset-results .feedback-section { - margin: 1em; + margin: 0.75em; +} + +.questionset-results .greeting { + margin-top: 1em; + color: #777; + font-size: 1.25em; } .questionset-results .feedback-section .feedback-text { - font-weight: bold; - color: #1a73d9; + font-weight: normal; + color: #777; } .questionset-results .buttons { margin-bottom: 1.5em; } +.questionset-results .result-header, +.questionset-results .result-text { + color: #1a73d9; + font-weight: bold; +} + +.questionset-results .result-header { + font-size: 2em; + margin-top: 1em; +} + +.questionset-results .result-text { + font-size: 1.25em; + line-height: 1.25em; + margin: 1em 1em 2.25em; +} + /* No margin for questions when no frame */ .h5p-no-frame .questionset .h5p-question > * { margin-left: 0; diff --git a/js/questionset.js b/js/questionset.js index 50151c4..70c1c30 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -52,13 +52,22 @@ H5P.QuestionSet = function (options, contentId) { var resulttemplate = '
' + + '
<%= message %>
' + ' ' + + ' <% if (comment) { %>' + + '
<%= comment %>
' + + ' <% } %>' + + '
<%= resulttext %>
' + ' ' + '
'; @@ -292,7 +301,9 @@ H5P.QuestionSet = function (options, contentId) { } var eparams = { + message: params.endGame.message, comment: (success ? params.endGame.successGreeting : params.endGame.failGreeting), + resulttext: (success ? params.endGame.successComment : params.endGame.failComment), finishButtonText: params.endGame.finishButtonText, solutionButtonText: params.endGame.solutionButtonText }; From 2a26db16f674bacf029b9b2a531e94dced728a75 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 12:40:28 +0200 Subject: [PATCH 05/39] Links for navigation + ARIA label HFJ-1749 --- css/questionset.css | 3 +-- js/questionset.js | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/css/questionset.css b/css/questionset.css index a6959fa..916c54e 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -128,8 +128,7 @@ .h5p-question .h5p-question-prev, .h5p-question .h5p-question-next { - padding: 0; - height: 2.1875em; + padding: 0.5em 0; width: 2.1875em; } diff --git a/js/questionset.js b/js/questionset.js index 8ad3df6..f0d2f04 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -421,6 +421,9 @@ H5P.QuestionSet = function (options, contentId) { question.addButton('next', '', function () { _stopQuestion(currentQuestion); _showQuestion(currentQuestion + 1); + }, true, { + href: '#', // Use href since this is a navigation button + 'aria-label': 'Next Question' // TODO: Translate }); } @@ -428,7 +431,10 @@ H5P.QuestionSet = function (options, contentId) { if (questionInstances[0] !== question) { question.addButton('prev', '', function () { _stopQuestion(currentQuestion); - _showQuestion(currentQuestion - 1); + _showQuestion(currentQuestion - 1); + }, true, { + href: '#', // Use href since this is a navigation button + 'aria-label': 'Previous Question' // TODO: Translate }); } From 02cd4e1b7ed168d33db33bb333978615d62a8593 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 14:41:17 +0200 Subject: [PATCH 06/39] Added focus effect to progress dots HFJ-1661 --- css/questionset.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/css/questionset.css b/css/questionset.css index 916c54e..e26f47b 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -55,6 +55,11 @@ .progress-dot.current { background: #285585; } +.progress-dot:focus { + outline-color: rgb(40, 130, 211); + outline-width: thin; + outline-style: solid; +} .intro-page .title { font-size: 2em; From ab76075acca2fe1ae06be54e37eb2c9cc6e0076b Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 14:42:49 +0200 Subject: [PATCH 07/39] Converted progress dots to links + ARIA label HFJ-1750 --- js/questionset.js | 7 +++++-- 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 | 6 ++++++ 8 files changed, 35 insertions(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index f0d2f04..7751382 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") { %>' + @@ -79,7 +79,8 @@ H5P.QuestionSet = function (options, contentId) { prevButton: 'Previous', nextButton: 'Next', finishButton: 'Finish', - textualProgress: 'Question: @current of @total questions' + textualProgress: 'Question: @current of @total questions', + jumpToQuestion: 'Jump to question %d' }, endGame: { showResultPage: true, @@ -129,6 +130,7 @@ H5P.QuestionSet = function (options, contentId) { for (var i = 0; i < params.questions.length; i++) { var question = params.questions[i]; + question.jumpAriaLabel = params.text.jumpToQuestion.replace(':num', i + 1); if (override) { // Extend subcontent with the overrided settings. $.extend(question.params.behaviour, override); @@ -473,6 +475,7 @@ H5P.QuestionSet = function (options, contentId) { $('.progress-dot', $myDom).click(function () { _stopQuestion(currentQuestion); _showQuestion($(this).index()); + return false; }); // Hide all but initial Question. diff --git a/language/ar.json b/language/ar.json index b2b1edd..d30f285 100644 --- a/language/ar.json +++ b/language/ar.json @@ -74,6 +74,10 @@ { "label": "نص التقدم", "description": "النص المستخدم إذا تم تحديد التقدم نصيا" + }, + { + "label": "Label for jumping to a certain question", + "default": "Jump to question %d" } ] }, diff --git a/language/de.json b/language/de.json index b1b9bc8..7fa6505 100644 --- a/language/de.json +++ b/language/de.json @@ -79,6 +79,10 @@ "label": "Fortschrittstext", "description": "Verwendeter Text wenn Text Fortschrittsanzeige gewählt wurde.", "default": "Aktuelle Frage: @current von @total Fragen" + }, + { + "label": "Label for jumping to a certain question", + "default": "Jump to question %d" } ] }, diff --git a/language/fr.json b/language/fr.json index 7d01efc..03cc866 100644 --- a/language/fr.json +++ b/language/fr.json @@ -74,6 +74,10 @@ { "label": "Texte de progression", "description": "Texte utilisé si la progression textuelle est utilisée." + }, + { + "label": "Label for jumping to a certain question", + "default": "Jump to question %d" } ] }, diff --git a/language/it.json b/language/it.json index bc2725e..3a59363 100644 --- a/language/it.json +++ b/language/it.json @@ -74,6 +74,10 @@ { "label": "Testo Avanzamento", "description": "esto utilizzato se il testo Avanzamento è selezionato." + }, + { + "label": "Label for jumping to a certain question", + "default": "Jump to question %d" } ] }, diff --git a/language/nb.json b/language/nb.json index 880001d..f2fc642 100644 --- a/language/nb.json +++ b/language/nb.json @@ -76,6 +76,10 @@ "label": "Fremdriftstekst", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", "default": "Deloppgave @current av @total" + }, + { + "label": "Merkelapp ved hopping til spørsmål", + "default": "Hopp til spørsmål %d" } ] }, diff --git a/language/nn.json b/language/nn.json index 216333e..b33561d 100644 --- a/language/nn.json +++ b/language/nn.json @@ -76,6 +76,10 @@ "label": "Fremdriftstekst", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", "default": "Deloppgave @current av @total" + }, + { + "label": "Merkelapp ved hopping til spørsmål", + "default": "Hopp til spørsmål %d" } ] }, diff --git a/semantics.json b/semantics.json index d670e08..49b0cc9 100644 --- a/semantics.json +++ b/semantics.json @@ -152,6 +152,12 @@ "strong", "em" ] + }, + { + "name": "jumpToQuestion", + "type": "text", + "label": "Label for jumping to a certain question", + "default": "Jump to question %d" } ] }, From 04003cf3036efda52df5a73f370dfcd1a586c14b Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 15:36:06 +0200 Subject: [PATCH 08/39] Made summary buttons into valid buttons HFJ-1749 --- js/questionset.js | 43 +++++++++++++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index 7751382..b7e4673 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -57,9 +57,9 @@ H5P.QuestionSet = function (options, contentId) { ' ' + ' ' + '
' + - ' <%= finishButtonText %>' + - ' <%= solutionButtonText %>' + - ' ' + + ' ' + + ' ' + + ' ' + '
' + ''; @@ -280,6 +280,23 @@ H5P.QuestionSet = function (options, contentId) { score: scoreString, passed: success }; + + /** + * Makes our buttons behave like other buttons. + * + * @private + * @param {string} classSelector + * @param {function} handler + */ + var hookUpButton = function (classSelector, handler) { + $(classSelector, $myDom).click(handler).keypress(function (e) { + if (e.which === 32) { + handler(); + e.preventDefault(); + } + }); + }; + var displayResults = function () { self.triggerXAPICompleted(self.getScore(), self.totalScore(), success); @@ -291,26 +308,28 @@ H5P.QuestionSet = function (options, contentId) { var eparams = { comment: (success ? params.endGame.successGreeting : params.endGame.failGreeting), finishButtonText: params.endGame.finishButtonText, - solutionButtonText: params.endGame.solutionButtonText + solutionButtonText: params.endGame.solutionButtonText, + retryButtonText: params.endGame.retryButtonText }; // Show result page. $myDom.children().hide(); $myDom.append(endTemplate.render(eparams)); - $('.qs-finishbutton', $myDom).click(function () { + + // Add event handlers to summary buttons + hookUpButton('.qs-finishbutton', function () { self.trigger('h5pQuestionSetFinished', eventData); }); - $('.qs-solutionbutton', $myDom).click(function () { + hookUpButton('.qs-solutionbutton', function () { showSolutions(); $myDom.children().hide().filter('.questionset').show(); _showQuestion(params.initialQuestion); }); - $('.qs-retrybutton', $myDom) - .html(params.endGame.retryButtonText) - .click(function () { - resetTask(); - $myDom.children().hide().filter('.questionset').show(); - _showQuestion(params.initialQuestion);}); + hookUpButton('.qs-retrybutton', function () { + resetTask(); + $myDom.children().hide().filter('.questionset').show(); + _showQuestion(params.initialQuestion); + }); if (scoreBar === undefined) { scoreBar = H5P.JoubelUI.createScoreBar(totals); From 93a5efd6e8f52e87fcc3f8ac7445627fca66ba6a Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 15:58:38 +0200 Subject: [PATCH 09/39] Fixed aria-label for progress dots HFJ-1750 --- js/questionset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index b7e4673..abcfa39 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -130,7 +130,7 @@ H5P.QuestionSet = function (options, contentId) { for (var i = 0; i < params.questions.length; i++) { var question = params.questions[i]; - question.jumpAriaLabel = params.text.jumpToQuestion.replace(':num', i + 1); + question.jumpAriaLabel = params.texts.jumpToQuestion.replace('%d', i + 1); if (override) { // Extend subcontent with the overrided settings. $.extend(question.params.behaviour, override); From 308be51132144fc1077450263c24a2a4f665dc54 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 15:59:28 +0200 Subject: [PATCH 10/39] Added description for 'jump to question' field HFJ-1750 --- language/ar.json | 1 + language/de.json | 1 + language/fr.json | 1 + language/it.json | 1 + language/nb.json | 1 + language/nn.json | 1 + semantics.json | 1 + 7 files changed, 7 insertions(+) diff --git a/language/ar.json b/language/ar.json index d30f285..f638767 100644 --- a/language/ar.json +++ b/language/ar.json @@ -77,6 +77,7 @@ }, { "label": "Label for jumping to a certain question", + "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" } ] diff --git a/language/de.json b/language/de.json index 7fa6505..f6149e6 100644 --- a/language/de.json +++ b/language/de.json @@ -82,6 +82,7 @@ }, { "label": "Label for jumping to a certain question", + "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" } ] diff --git a/language/fr.json b/language/fr.json index 03cc866..f08fadb 100644 --- a/language/fr.json +++ b/language/fr.json @@ -77,6 +77,7 @@ }, { "label": "Label for jumping to a certain question", + "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" } ] diff --git a/language/it.json b/language/it.json index 3a59363..aeeb322 100644 --- a/language/it.json +++ b/language/it.json @@ -77,6 +77,7 @@ }, { "label": "Label for jumping to a certain question", + "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" } ] diff --git a/language/nb.json b/language/nb.json index f2fc642..74c82a3 100644 --- a/language/nb.json +++ b/language/nb.json @@ -79,6 +79,7 @@ }, { "label": "Merkelapp ved hopping til spørsmål", + "description": "Du må bruke plassholderen '%d' istedenfor spørsmålsnummeret.", "default": "Hopp til spørsmål %d" } ] diff --git a/language/nn.json b/language/nn.json index b33561d..8c3ab8d 100644 --- a/language/nn.json +++ b/language/nn.json @@ -79,6 +79,7 @@ }, { "label": "Merkelapp ved hopping til spørsmål", + "description": "Du må bruke plassholderen '%d' istedenfor spørsmålstalet.", "default": "Hopp til spørsmål %d" } ] diff --git a/semantics.json b/semantics.json index 49b0cc9..47f1af2 100644 --- a/semantics.json +++ b/semantics.json @@ -157,6 +157,7 @@ "name": "jumpToQuestion", "type": "text", "label": "Label for jumping to a certain question", + "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" } ] From 6537378091a8113cd531029edbf01f5b93376ba8 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 16:02:54 +0200 Subject: [PATCH 11/39] Fixed summary button icons HFJ-1749 --- css/questionset.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/css/questionset.css b/css/questionset.css index e26f47b..71664e3 100644 --- a/css/questionset.css +++ b/css/questionset.css @@ -109,7 +109,7 @@ float: none; } -.questionset-results a.h5p-button.qs-retrybutton:before { +.questionset-results button.h5p-button.qs-retrybutton:before { font-family: 'H5PFontAwesome4'; padding-right: 0.5em; content: "\f01e"; @@ -168,7 +168,7 @@ content: "\f00c"; } -.questionset-results a.h5p-button.qs-solutionbutton:before { +.questionset-results button.h5p-button.qs-solutionbutton:before { font-family: 'H5PFontAwesome4'; content: "\f06e "; /* TODO: Use margin not whitespace, spacing is not content! */ } From c36e31ebf4d8db49f4a21e13ed6cd68ecd881f6f Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 16:06:36 +0200 Subject: [PATCH 12/39] Hooked up the texts for next/prev buttons HFJ-1749 --- js/questionset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index abcfa39..c083213 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -444,7 +444,7 @@ H5P.QuestionSet = function (options, contentId) { _showQuestion(currentQuestion + 1); }, true, { href: '#', // Use href since this is a navigation button - 'aria-label': 'Next Question' // TODO: Translate + 'aria-label': params.texts.nextButton }); } @@ -455,7 +455,7 @@ H5P.QuestionSet = function (options, contentId) { _showQuestion(currentQuestion - 1); }, true, { href: '#', // Use href since this is a navigation button - 'aria-label': 'Previous Question' // TODO: Translate + 'aria-label': params.texts.prevButton }); } From 63f6162ef2685f9814e6bb38f7b6f35493110425 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 8 Apr 2016 16:07:24 +0200 Subject: [PATCH 13/39] Updated the default text --- 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 c083213..a631de2 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -76,8 +76,8 @@ H5P.QuestionSet = function (options, contentId) { startButtonText: 'Start' }, texts: { - prevButton: 'Previous', - nextButton: 'Next', + prevButton: 'Previous question', + nextButton: 'Next question', finishButton: 'Finish', textualProgress: 'Question: @current of @total questions', jumpToQuestion: 'Jump to question %d' diff --git a/semantics.json b/semantics.json index 47f1af2..109153d 100644 --- a/semantics.json +++ b/semantics.json @@ -128,13 +128,13 @@ "name": "prevButton", "type": "text", "label": "Back button", - "default": "Previous" + "default": "Previous question" }, { "name": "nextButton", "type": "text", "label": "Next button", - "default": "Next" + "default": "Next question" }, { "name": "finishButton", From 2745b6b41442f4d3e580f49011d88754eabd5de1 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Mon, 11 Apr 2016 10:35:47 +0200 Subject: [PATCH 14/39] Improved label of copyright dialog label. HFJ-1746 --- language/ar.json | 2 +- language/de.json | 4 ++++ language/fr.json | 2 +- language/it.json | 2 +- language/nb.json | 2 +- language/nn.json | 2 +- semantics.json | 2 +- 7 files changed, 10 insertions(+), 6 deletions(-) diff --git a/language/ar.json b/language/ar.json index f638767..b7b49ef 100644 --- a/language/ar.json +++ b/language/ar.json @@ -172,7 +172,7 @@ ] }, { - "label": "Question label text", + "label": "Copyright dialog question label", "default": "Question" } ] diff --git a/language/de.json b/language/de.json index f6149e6..9db9662 100644 --- a/language/de.json +++ b/language/de.json @@ -185,6 +185,10 @@ ] } ] + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] } diff --git a/language/fr.json b/language/fr.json index f08fadb..084511f 100644 --- a/language/fr.json +++ b/language/fr.json @@ -172,7 +172,7 @@ ] }, { - "label": "Texte de la question", + "label": "Copyright dialog question label", "default": "Question" } ] diff --git a/language/it.json b/language/it.json index aeeb322..9110c82 100644 --- a/language/it.json +++ b/language/it.json @@ -172,7 +172,7 @@ ] }, { - "label": "Question label text", + "label": "Copyright dialog question label", "default": "Question" } ] diff --git a/language/nb.json b/language/nb.json index 74c82a3..a091f7b 100644 --- a/language/nb.json +++ b/language/nb.json @@ -184,7 +184,7 @@ ] }, { - "label": "Spørsmål-etikett", + "label": "Opphavsrett spørsmål-etikett", "default": "Spørsmål" } ] diff --git a/language/nn.json b/language/nn.json index 8c3ab8d..ed50b0a 100644 --- a/language/nn.json +++ b/language/nn.json @@ -184,7 +184,7 @@ ] }, { - "label": "Spørsmål-etikett", + "label": "Opphavsrett spørsmål-etikett", "default": "Spørsmål" } ] diff --git a/semantics.json b/semantics.json index 109153d..75cce84 100644 --- a/semantics.json +++ b/semantics.json @@ -349,7 +349,7 @@ { "name": "questionLabel", "type": "text", - "label": "Question label text", + "label": "Copyright dialog question label", "default": "Question" } ] From c045d440d9d6403761cee27c704f2a30995277e7 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 15 Apr 2016 09:30:27 +0200 Subject: [PATCH 15/39] Set min. height to background image on intro Also, made sure that the image always covers the background. HFJ-1815 --- js/questionset.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index a631de2..a137df5 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -405,13 +405,15 @@ H5P.QuestionSet = function (options, contentId) { if (params.introPage.backgroundImage !== undefined) { var $intro = $myDom.find('.intro-page'); if ($intro.length) { + var bgImg = params.introPage.backgroundImage; + var bgImgRatio = (bgImg.height / bgImg.width); $intro.css({ - background: '#fff url("' + H5P.getPath(params.introPage.backgroundImage.path, contentId) + '") no-repeat 50% 50%', - backgroundSize: '100% auto' + background: '#fff url("' + H5P.getPath(bgImg.path, contentId) + '") no-repeat 50% 50%', + backgroundSize: 'auto 100%', + minHeight: bgImgRatio * +window.getComputedStyle($intro[0]).width.replace('px','') }); } } - var registerImageLoadedListener = function (question) { H5P.on(question, 'imageLoaded', function () { self.trigger('resize'); From 333d3f4161d341cbc16128dc41e1278c82c4f761 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Fri, 15 Apr 2016 09:49:50 +0200 Subject: [PATCH 16/39] Show intro when retrying HFJ-1816 --- js/questionset.js | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index a137df5..cdfde73 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -327,8 +327,19 @@ H5P.QuestionSet = function (options, contentId) { }); hookUpButton('.qs-retrybutton', function () { resetTask(); - $myDom.children().hide().filter('.questionset').show(); - _showQuestion(params.initialQuestion); + $myDom.children().hide(); + + var $intro = $('.intro-page', $myDom); + if ($intro.length) { + // Show intro + $('.intro-page', $myDom).show(); + //$('.questionset', $myDom).show(); + } + else { + // Show first question + $('.questionset', $myDom).show(); + _showQuestion(params.initialQuestion); + } }); if (scoreBar === undefined) { @@ -488,8 +499,8 @@ H5P.QuestionSet = function (options, contentId) { $('.qs-startbutton', $myDom).click(function () { $(this).parents('.intro-page').hide(); - $('.questionset', $myDom).removeClass('hidden'); - _showQuestion(currentQuestion); + $('.questionset', $myDom).show(); + _showQuestion(params.initialQuestion); }); // Set event listeners. From 0e5052385375ed6b180f40ad814d68fedd9a9249 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Fri, 15 Apr 2016 12:49:09 +0200 Subject: [PATCH 17/39] Moved copyright question labels inside the common interface texts. HFJ-1746 --- js/questionset.js | 8 ++++---- language/ar.json | 8 ++++---- language/de.json | 8 ++++---- language/fr.json | 8 ++++---- language/it.json | 8 ++++---- language/nb.json | 8 ++++---- language/nn.json | 8 ++++---- semantics.json | 12 ++++++------ upgrades.js | 10 ++++++++++ 9 files changed, 44 insertions(+), 34 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index cdfde73..0a84928 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -80,7 +80,8 @@ H5P.QuestionSet = function (options, contentId) { nextButton: 'Next question', finishButton: 'Finish', textualProgress: 'Question: @current of @total questions', - jumpToQuestion: 'Jump to question %d' + jumpToQuestion: 'Jump to question %d', + questionLabel: 'Question' }, endGame: { showResultPage: true, @@ -94,8 +95,7 @@ H5P.QuestionSet = function (options, contentId) { solutionButtonText: 'Show solution', retryButtonText: 'Retry', showAnimations: false - }, - questionLabel: 'Question' + } }; var template = new EJS({text: texttemplate}); @@ -574,7 +574,7 @@ H5P.QuestionSet = function (options, contentId) { } // Determine label - var label = (params.questionLabel + ' ' + (i + 1)); + var label = (params.texts.questionLabel + ' ' + (i + 1)); if (qParams.contentName !== undefined) { label += ': ' + qParams.contentName; } diff --git a/language/ar.json b/language/ar.json index b7b49ef..168b643 100644 --- a/language/ar.json +++ b/language/ar.json @@ -79,6 +79,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -170,10 +174,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/de.json b/language/de.json index 9db9662..31b2515 100644 --- a/language/de.json +++ b/language/de.json @@ -84,6 +84,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -185,10 +189,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/fr.json b/language/fr.json index 084511f..5b00c62 100644 --- a/language/fr.json +++ b/language/fr.json @@ -79,6 +79,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -170,10 +174,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/it.json b/language/it.json index 9110c82..14c342f 100644 --- a/language/it.json +++ b/language/it.json @@ -79,6 +79,10 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -170,10 +174,6 @@ ] } ] - }, - { - "label": "Copyright dialog question label", - "default": "Question" } ] } diff --git a/language/nb.json b/language/nb.json index a091f7b..158c440 100644 --- a/language/nb.json +++ b/language/nb.json @@ -81,6 +81,10 @@ "label": "Merkelapp ved hopping til spørsmål", "description": "Du må bruke plassholderen '%d' istedenfor spørsmålsnummeret.", "default": "Hopp til spørsmål %d" + }, + { + "label": "Opphavsrett spørsmål-etikett", + "default": "Spørsmål" } ] }, @@ -182,10 +186,6 @@ ] } ] - }, - { - "label": "Opphavsrett spørsmål-etikett", - "default": "Spørsmål" } ] } diff --git a/language/nn.json b/language/nn.json index ed50b0a..2549dee 100644 --- a/language/nn.json +++ b/language/nn.json @@ -81,6 +81,10 @@ "label": "Merkelapp ved hopping til spørsmål", "description": "Du må bruke plassholderen '%d' istedenfor spørsmålstalet.", "default": "Hopp til spørsmål %d" + }, + { + "label": "Opphavsrett spørsmål-etikett", + "default": "Spørsmål" } ] }, @@ -182,10 +186,6 @@ ] } ] - }, - { - "label": "Opphavsrett spørsmål-etikett", - "default": "Spørsmål" } ] } diff --git a/semantics.json b/semantics.json index 75cce84..2265924 100644 --- a/semantics.json +++ b/semantics.json @@ -159,6 +159,12 @@ "label": "Label for jumping to a certain question", "description": "You must use the placeholder '%d' instead of the question number.", "default": "Jump to question %d" + }, + { + "name": "questionLabel", + "type": "text", + "label": "Copyright dialog question label", + "default": "Question" } ] }, @@ -345,11 +351,5 @@ ] } ] - }, - { - "name": "questionLabel", - "type": "text", - "label": "Copyright dialog question label", - "default": "Question" } ] diff --git a/upgrades.js b/upgrades.js index 210d1ac..03c3b56 100644 --- a/upgrades.js +++ b/upgrades.js @@ -41,6 +41,16 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) { delete parameters.override.overrideShowSolutionButton; delete parameters.override.overrideRetry; + // Move copyright dialog question label + if (parameters.questionLabel) { + parameters.texts = parameters.texts || {}; + parameters.texts.questionLabel = parameters.questionLabel; + } + + // Remove old copyright dialog question label + delete parameters.questionLabel; + + finished(null, parameters); } } From fa7b05f6fe701e03da078d4fdab5413b2aba0786 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 18 Apr 2016 13:14:07 +0200 Subject: [PATCH 18/39] A case of a forgotten bracket --- js/questionset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index 096ccd9..dd81fee 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -475,7 +475,7 @@ H5P.QuestionSet = function (options, contentId) { } // Add previous question button - if (questionInstances[0] !== question) + if (questionInstances[0] !== question) { question.addButton('prev', '', moveQuestion.bind(this, -1), true, { href: '#', // Use href since this is a navigation button 'aria-label': params.texts.prevButton From 001e765ddc08a9a1c71a48cace698f09cedbbb8d Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Thu, 21 Apr 2016 14:45:43 +0200 Subject: [PATCH 19/39] Updated texts [HFJ-1858] --- language/nb.json | 20 ++++++++++---------- language/nn.json | 22 +++++++++++----------- semantics.json | 4 ++-- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/language/nb.json b/language/nb.json index c06aa94..bfe4399 100644 --- a/language/nb.json +++ b/language/nb.json @@ -96,12 +96,12 @@ }, { "label": "Overskrift over tilbakemeldinger", - "default": "Ditt resultat:", + "default": "Resultat:", "description": "Denne overskriften vises over tilbakemeldingene på slutten av spørsmålssettet." }, { "label": "Poengvisningstekst", - "default": "Du fikk @score poeng av @total mulige.", + "default": "@score av @total poeng", "description": "Tekst som viser brukerens oppnådde poeng. \"@score\" blir erstattet med utregnet resultat, \"@total\" blir erstattet med høyest mulige resultat." }, { @@ -111,27 +111,27 @@ }, { "label": "Kommentar ved bestått", - "default": "Du presterte godt!", + "default": "Dette gikk bra.", "description": "Denne kommentaren vises dersom brukeren har bestått spørsmålssettet." }, { "label": "Tittel ved ikke bestått", - "default": "Ikke bestått", + "default": "Dette gikk ikke så bra!", "description": "Denne tittelen vises dersom brukeren ikke har bestått spørsmålssettet." }, { "label": "Kommentar ved ikke bestått", - "default": "Ikke bestått. Prøv igjen!", + "default": "Det er litt mange feil her. Prøv igjen!", "description": "Denne kommentaren vises dersom brukeren ikke har bestått spørsmålssettet." }, { "label": "Tekst til \"Fasit\" knapp", - "default": "Vis fasit", + "default": "Gå gjennom fasit.", "description": "" }, { "label": "Tekst til \"Prøv igjen\" knapp", - "default": "Prøv igjen", + "default": "Prøv igjen!", "description": "" }, { @@ -159,11 +159,11 @@ ] }, { - "label": "Innstillinger for «Vis svar»- og «Prøv igjen»-knapp", + "label": "Innstillinger for «Fasit»- og «Prøv igjen»-knapp", "fields": [ { - "label": "Overstyr «Vis svar»-knapp", - "description": "Dette valget avgjør om «Vis svar»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", + "label": "Overstyr «Fasit»-knapp", + "description": "Dette valget avgjør om «Fasit»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", "options": [ { "label": "Aktivert" diff --git a/language/nn.json b/language/nn.json index 2549dee..5d8cb0c 100644 --- a/language/nn.json +++ b/language/nn.json @@ -61,8 +61,8 @@ "label": "Ledetekster", "fields": [ { - "label": "Forrige-knappen", - "default": "Forrige" + "label": "Førre-knappen", + "default": "Førre" }, { "label": "Neste-knappen", @@ -75,7 +75,7 @@ { "label": "Fremdriftstekst", "description": "Tekst brukt hvis tekstlig angivelse av fremdrift er valgt. Variabler: @current og @total", - "default": "Deloppgave @current av @total" + "default": "Deloppgåve @current av @total" }, { "label": "Merkelapp ved hopping til spørsmål", @@ -96,12 +96,12 @@ }, { "label": "Overskrift over tilbakemeldingar", - "default": "Ditt resultat:", + "default": "Resultat:", "description": "Denne overskriften vises over tilbakemeldingane på slutten av spørsmålssettet." }, { "label": "Poengvisningstekst", - "default": "Du fikk @score poeng av @total mulige.", + "default": "@score av @total poeng", "description": "Tekst som viser brukerens oppnådde poeng. \"@score\" blir erstatta med utregna resultat, \"@total\" blir erstatta med høgest mulig resultat." }, { @@ -111,17 +111,17 @@ }, { "label": "Kommentar ved bestått", - "default": "Du presterte meget godt!", + "default": "Dette gjekk bra.", "description": "Denne kommentaren vises dersom brukaren har bestått spørsmålssettet." }, { "label": "Tittel ved ikkje bestått", - "default": "Ikkje bestått", + "default": "Dette gjekk ikkje så bra!", "description": "Denne tittelen visast dersom brukaren ikkje har bestått spørsmålssettet." }, { "label": "Kommentar ved ikkje bestått", - "default": "Dette er litt mange feil her. Prøv igjen!", + "default": "Det er litt mange feil her. Prøv igjen!", "description": "Denne kommentaren vises dersom brukaren ikkje har bestått spørsmålssettet." }, { @@ -159,11 +159,11 @@ ] }, { - "label": "Innstillinger for «Vis svar»- og «Prøv igjen»-knapp", + "label": "Innstillinger for «Fasit»- og «Prøv igjen»-knapp", "fields": [ { - "label": "Overstyr «Vis svar»-knapp", - "description": "Dette valget avgjør om «Vis svar»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", + "label": "Overstyr «Fasit»-knapp", + "description": "Dette valget avgjør om «Fasit»-knappen vil vises for alle spørsmål, skjules for alle eller konfigureres individuelt for hvert spørsmål.", "options": [ { "label": "Aktivert" diff --git a/semantics.json b/semantics.json index 2265924..f404602 100644 --- a/semantics.json +++ b/semantics.json @@ -196,7 +196,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": "You got @score points of @total possible.", + "default": "@score of @total points", "optional": true }, { @@ -262,7 +262,7 @@ "name": "solutionButtonText", "type": "text", "label": "Solution button label", - "default": "Show solution", + "default": "Solution", "description": "Text for the solution button." }, { From d8c6976aef1a2fe35d511a4a48303d1000a814bb Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Thu, 21 Apr 2016 15:47:13 +0200 Subject: [PATCH 20/39] Using latest version of blanks in QS --- semantics.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/semantics.json b/semantics.json index f404602..b292c54 100644 --- a/semantics.json +++ b/semantics.json @@ -112,7 +112,7 @@ "options": [ "H5P.MultiChoice 1.6", "H5P.DragQuestion 1.5", - "H5P.Blanks 1.4", + "H5P.Blanks 1.5", "H5P.MarkTheWords 1.5", "H5P.DragText 1.4" ] From d441f67b7042b8b9595adc810869715ab207a47d Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Thu, 21 Apr 2016 15:51:43 +0200 Subject: [PATCH 21/39] Override confirmation dialog parent element for interactions. HFJ-1572 --- js/questionset.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/questionset.js b/js/questionset.js index 0a84928..3b4e1f2 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -109,6 +109,7 @@ H5P.QuestionSet = function (options, contentId) { var up; renderSolutions = false; + var $template = $(template.render(params)); // Set overrides for questions var override; if (params.override.showSolutionButton || params.override.retryButton) { @@ -135,6 +136,11 @@ H5P.QuestionSet = function (options, contentId) { // Extend subcontent with the overrided settings. $.extend(question.params.behaviour, override); } + + question.params = question.params || {}; + question.params.overrideSettings = question.params.overrideSettings || {}; + question.params.overrideSettings.$confirmationDialogParent = $template; + var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self}); questionInstance.on('resize', function () { up = true; @@ -404,7 +410,8 @@ H5P.QuestionSet = function (options, contentId) { } // Render own DOM into target. - $myDom.html(template.render(params)); + $myDom.children().remove(); + $myDom.append($template); if (params.backgroundImage !== undefined) { $myDom.css({ overflow: 'hidden', From 35e8dbd92586aae17b338445216f9d0c627b85aa Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Fri, 22 Apr 2016 10:33:07 +0200 Subject: [PATCH 22/39] Updated english strings in code to match semantics [HFJ-1858] --- js/questionset.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/questionset.js b/js/questionset.js index dd81fee..eeac01d 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -95,9 +95,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: 'You got @score points of @total possible.', + scoreString: '@score of @total points', finishButtonText: 'Finish', - solutionButtonText: 'Show solution', + solutionButtonText: 'Solution', retryButtonText: 'Retry', showAnimations: false, skipButtonText: 'Skip video' From e90ef1f831b9aebc9187586d95d6d3fc9d0025c8 Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Mon, 25 Apr 2016 13:28:02 +0200 Subject: [PATCH 23/39] Added functionality for resizing Question Set if it is too small for confirmation dialog. HFJ-1572 --- js/questionset.js | 1 + 1 file changed, 1 insertion(+) diff --git a/js/questionset.js b/js/questionset.js index 3b4e1f2..c4f72ed 100644 --- a/js/questionset.js +++ b/js/questionset.js @@ -140,6 +140,7 @@ H5P.QuestionSet = function (options, contentId) { question.params = question.params || {}; question.params.overrideSettings = question.params.overrideSettings || {}; question.params.overrideSettings.$confirmationDialogParent = $template; + question.params.overrideSettings.instance = this; var questionInstance = H5P.newRunnable(question, contentId, undefined, undefined, {parent: self}); questionInstance.on('resize', function () { From 4c389c89e3cc4f6cca79e90974d5f3bf8433e44b Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 2 May 2016 10:26:55 +0200 Subject: [PATCH 24/39] Bumped patch version --- library.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library.json b/library.json index 4ffc1b5..b50a5f1 100644 --- a/library.json +++ b/library.json @@ -4,7 +4,7 @@ "contentType": "question", "majorVersion": 1, "minorVersion": 8, - "patchVersion": 0, + "patchVersion": 1, "embedTypes": [ "iframe" ], @@ -61,4 +61,4 @@ "minorVersion": 1 } ] -} +} \ No newline at end of file From 9d8a35f807f7efbf07b05cb1c6a33c3bdbe7ea24 Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 2 May 2016 11:05:59 +0200 Subject: [PATCH 25/39] Added extra check to upgrade script --- upgrades.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/upgrades.js b/upgrades.js index a44e08f..dc41328 100644 --- a/upgrades.js +++ b/upgrades.js @@ -28,18 +28,20 @@ H5PUpgrades['H5P.QuestionSet'] = (function ($) { */ 8: function (parameters, finished) { - if (parameters.override.overrideButtons) { - // Set new variables - parameters.override.showSolutionButton = - (parameters.override.overrideShowSolutionButton ? 'on' : 'off'); - parameters.override.retryButton = - (parameters.override.overrideRetry ? 'on' : 'off'); - } + if (parameters.override) { + if (parameters.override.overrideButtons) { + // Set new variables + parameters.override.showSolutionButton = + (parameters.override.overrideShowSolutionButton ? 'on' : 'off'); + parameters.override.retryButton = + (parameters.override.overrideRetry ? 'on' : 'off'); + } - // Remove old field variables - delete parameters.override.overrideButtons; - delete parameters.override.overrideShowSolutionButton; - delete parameters.override.overrideRetry; + // Remove old field variables + delete parameters.override.overrideButtons; + delete parameters.override.overrideShowSolutionButton; + delete parameters.override.overrideRetry; + } // Move copyright dialog question label if (parameters.questionLabel) { From 1177ac68b776859b3cb2c9d44272d3d02a032e7b Mon Sep 17 00:00:00 2001 From: Paal Joergensen Date: Tue, 3 May 2016 11:39:41 +0200 Subject: [PATCH 26/39] 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 27/39] 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 28/39] 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 29/39] 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 30/39] 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 31/39] 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 32/39] 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 33/39] 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 34/39] 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 35/39] 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 36/39] 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 37/39] 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 38/39] 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 39/39] 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; });