From ccafd8e3b933d39b00e1b90b1eb14b38b58edb37 Mon Sep 17 00:00:00 2001 From: otacke Date: Tue, 14 Jan 2020 12:06:12 +0100 Subject: [PATCH 1/2] Add option to always display solution texts below content --- language/.en.json | 6 +++++- language/af.json | 6 +++++- language/ar.json | 6 +++++- language/bg.json | 6 +++++- language/bs.json | 6 +++++- language/ca.json | 6 +++++- language/cs.json | 6 +++++- language/da.json | 6 +++++- language/de.json | 4 ++++ language/el.json | 6 +++++- language/es.json | 6 +++++- language/et.json | 6 +++++- language/eu.json | 6 +++++- language/fi.json | 6 +++++- language/fr.json | 4 ++++ language/he.json | 6 +++++- language/hu.json | 6 +++++- language/it.json | 4 ++++ language/ja.json | 6 +++++- language/ko.json | 6 +++++- language/nb.json | 6 +++++- language/nl.json | 6 +++++- language/nn.json | 6 +++++- language/pl.json | 6 +++++- language/pt-br.json | 6 +++++- language/pt.json | 6 +++++- language/ro.json | 6 +++++- language/ru.json | 4 ++++ language/sl.json | 6 +++++- language/sma.json | 6 +++++- language/sme.json | 6 +++++- language/smj.json | 6 +++++- language/sr.json | 6 +++++- language/sv.json | 4 ++++ language/tr.json | 6 +++++- language/uk.json | 6 +++++- language/vi.json | 6 +++++- language/zh-tw.json | 6 +++++- semantics.json | 9 +++++++++ src/scripts/drag-text.js | 5 +++-- 40 files changed, 197 insertions(+), 35 deletions(-) diff --git a/language/.en.json b/language/.en.json index 0e712cfe..d3583543 100644 --- a/language/.en.json +++ b/language/.en.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/af.json b/language/af.json index 0e712cfe..d3583543 100644 --- a/language/af.json +++ b/language/af.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/ar.json b/language/ar.json index 4a19f63d..e2bdcf63 100644 --- a/language/ar.json +++ b/language/ar.json @@ -125,6 +125,10 @@ }, { "label": "تلميح" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/bg.json b/language/bg.json index 9c4c03a3..612564bc 100644 --- a/language/bg.json +++ b/language/bg.json @@ -125,6 +125,10 @@ }, { "label": "Незабавна обратна връзка" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/bs.json b/language/bs.json index 429d30e6..97c578c2 100644 --- a/language/bs.json +++ b/language/bs.json @@ -125,6 +125,10 @@ }, { "label": "Instantna povratna informacija" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/ca.json b/language/ca.json index 57edfa39..e790163f 100644 --- a/language/ca.json +++ b/language/ca.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/cs.json b/language/cs.json index ba9b1ba2..83fc78bc 100644 --- a/language/cs.json +++ b/language/cs.json @@ -125,6 +125,10 @@ }, { "label": "Okamžitá zpětná vazba" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/da.json b/language/da.json index 0e712cfe..d3583543 100644 --- a/language/da.json +++ b/language/da.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/de.json b/language/de.json index 595e5ff7..c11e42a9 100644 --- a/language/de.json +++ b/language/de.json @@ -125,6 +125,10 @@ }, { "label": "Sofortige Rückmeldung" + }, + { + "label": "Lösungen unterhalb des Inhalts", + "description": "Wenn gesetzt, werden Lösungstexte immer unterhalb des Inhalts angezeigt." } ] }, diff --git a/language/el.json b/language/el.json index 4c1d0c06..b5c69f33 100644 --- a/language/el.json +++ b/language/el.json @@ -125,6 +125,10 @@ }, { "label": "Άμεση ανατροφοδότηση" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/es.json b/language/es.json index 7543ab6e..62a1654d 100644 --- a/language/es.json +++ b/language/es.json @@ -125,6 +125,10 @@ }, { "label": "Retroalimentacion instantanea" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/et.json b/language/et.json index bade834d..528191c3 100644 --- a/language/et.json +++ b/language/et.json @@ -125,6 +125,10 @@ }, { "label": "Kohene tagasiside" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/eu.json b/language/eu.json index 28e2ceb1..c6eca462 100644 --- a/language/eu.json +++ b/language/eu.json @@ -125,6 +125,10 @@ }, { "label": "Berehalako feedbacka" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/fi.json b/language/fi.json index bcb51bae..4bc71aa4 100644 --- a/language/fi.json +++ b/language/fi.json @@ -125,6 +125,10 @@ }, { "label": "Pikapalaute" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/fr.json b/language/fr.json index d594c090..6f98bb7e 100644 --- a/language/fr.json +++ b/language/fr.json @@ -125,6 +125,10 @@ }, { "label": "Correction instantanée" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, diff --git a/language/he.json b/language/he.json index 0e712cfe..d3583543 100644 --- a/language/he.json +++ b/language/he.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/hu.json b/language/hu.json index 0e712cfe..d3583543 100644 --- a/language/hu.json +++ b/language/hu.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/it.json b/language/it.json index cdb3ad75..ed66062a 100644 --- a/language/it.json +++ b/language/it.json @@ -125,6 +125,10 @@ }, { "label": "Feedback istantaneo" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, diff --git a/language/ja.json b/language/ja.json index 55e7900c..d777d191 100644 --- a/language/ja.json +++ b/language/ja.json @@ -125,6 +125,10 @@ }, { "label": "即時フィードバック" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/ko.json b/language/ko.json index 0e712cfe..d3583543 100644 --- a/language/ko.json +++ b/language/ko.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/nb.json b/language/nb.json index e947e966..486f8162 100644 --- a/language/nb.json +++ b/language/nb.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/nl.json b/language/nl.json index 1ed57e31..9399c024 100644 --- a/language/nl.json +++ b/language/nl.json @@ -125,6 +125,10 @@ }, { "label": "Geef direct feedback (Antwoorden)" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/nn.json b/language/nn.json index 8b507332..0cba2195 100644 --- a/language/nn.json +++ b/language/nn.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/pl.json b/language/pl.json index cab21317..69ee9d13 100644 --- a/language/pl.json +++ b/language/pl.json @@ -125,6 +125,10 @@ }, { "label": "Natychmiastowy komentarz" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/pt-br.json b/language/pt-br.json index d38272e0..06e80fa9 100644 --- a/language/pt-br.json +++ b/language/pt-br.json @@ -125,6 +125,10 @@ }, { "label": "Feedback instantâneo" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/pt.json b/language/pt.json index 2f16ede8..72663b2f 100644 --- a/language/pt.json +++ b/language/pt.json @@ -125,6 +125,10 @@ }, { "label": "Feedback instantâneo" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/ro.json b/language/ro.json index 0e712cfe..d3583543 100644 --- a/language/ro.json +++ b/language/ro.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/ru.json b/language/ru.json index e3a69a8d..b5931b49 100644 --- a/language/ru.json +++ b/language/ru.json @@ -125,6 +125,10 @@ }, { "label": "Мгновенная обратная связь" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, diff --git a/language/sl.json b/language/sl.json index 1d640495..e07e4a55 100644 --- a/language/sl.json +++ b/language/sl.json @@ -125,6 +125,10 @@ }, { "label": "Sprotno preverjaj odgovore" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/sma.json b/language/sma.json index 0e712cfe..d3583543 100644 --- a/language/sma.json +++ b/language/sma.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/sme.json b/language/sme.json index 0e712cfe..d3583543 100644 --- a/language/sme.json +++ b/language/sme.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/smj.json b/language/smj.json index 0e712cfe..d3583543 100644 --- a/language/smj.json +++ b/language/smj.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/sr.json b/language/sr.json index 0e712cfe..d3583543 100644 --- a/language/sr.json +++ b/language/sr.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/sv.json b/language/sv.json index 5778cfef..e2e8b065 100644 --- a/language/sv.json +++ b/language/sv.json @@ -125,6 +125,10 @@ }, { "label": "Omedelbar feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, diff --git a/language/tr.json b/language/tr.json index ffef298d..2f78a65f 100644 --- a/language/tr.json +++ b/language/tr.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/uk.json b/language/uk.json index e85de6e6..4155b22e 100644 --- a/language/uk.json +++ b/language/uk.json @@ -125,6 +125,10 @@ }, { "label": "Миттєвий зворотній зв'язок" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/vi.json b/language/vi.json index 0e712cfe..d3583543 100644 --- a/language/vi.json +++ b/language/vi.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/zh-tw.json b/language/zh-tw.json index f0e9f9e6..68b11dea 100644 --- a/language/zh-tw.json +++ b/language/zh-tw.json @@ -125,6 +125,10 @@ }, { "label": "即時回饋" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/semantics.json b/semantics.json index df137de1..615ece50 100644 --- a/semantics.json +++ b/semantics.json @@ -264,6 +264,15 @@ "type": "boolean", "default": false, "optional": true + }, + { + "name": "noWideScreenLayout", + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content.", + "importance": "low", + "type": "boolean", + "default": false, + "optional": true } ] }, diff --git a/src/scripts/drag-text.js b/src/scripts/drag-text.js index cdb47d31..0dd71396 100644 --- a/src/scripts/drag-text.js +++ b/src/scripts/drag-text.js @@ -85,7 +85,8 @@ H5P.DragText = (function ($, Question, ConfirmationDialog) { enableRetry: true, enableSolutionsButton: true, enableCheckButton: true, - instantFeedback: false + instantFeedback: false, + noWideScreenLayout: false }, showSolution : "Show solution", dropZoneIndex: "Drop Zone @index.", @@ -368,7 +369,7 @@ H5P.DragText = (function ($, Question, ConfirmationDialog) { self.addDropzoneWidth(); //Find ratio of width to em, and make sure it is less than the predefined ratio, make sure widest draggable is less than a third of parent width. - if ((self.$inner.width() / parseFloat(self.$inner.css("font-size"), 10) > 43) && (self.widestDraggable <= (self.$inner.width() / 3))) { + if (!self.params.behaviour.noWideScreenLayout && (self.$inner.width() / parseFloat(self.$inner.css("font-size"), 10) > 43) && (self.widestDraggable <= (self.$inner.width() / 3))) { // Adds a class that floats the draggables to the right. self.$draggables.addClass(DRAGGABLES_WIDE_SCREEN); From 128951ad3929710de5a4aa6c406c80fb072d5b29 Mon Sep 17 00:00:00 2001 From: Oliver Tacke Date: Tue, 1 Sep 2020 15:16:23 +0200 Subject: [PATCH 2/2] Update translations to match after rebase --- language/de.json | 2 +- language/es-mx.json | 6 +++++- language/fr.json | 2 +- language/ga.json | 6 +++++- language/it.json | 2 +- language/km.json | 6 +++++- language/ru.json | 2 +- language/sv.json | 2 +- 8 files changed, 20 insertions(+), 8 deletions(-) diff --git a/language/de.json b/language/de.json index c11e42a9..bee602c6 100644 --- a/language/de.json +++ b/language/de.json @@ -149,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/es-mx.json b/language/es-mx.json index 7543ab6e..62a1654d 100644 --- a/language/es-mx.json +++ b/language/es-mx.json @@ -125,6 +125,10 @@ }, { "label": "Retroalimentacion instantanea" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/fr.json b/language/fr.json index 6f98bb7e..7db1b88c 100644 --- a/language/fr.json +++ b/language/fr.json @@ -149,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/ga.json b/language/ga.json index 44067391..aa675bfa 100644 --- a/language/ga.json +++ b/language/ga.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/it.json b/language/it.json index ed66062a..7a45c7ae 100644 --- a/language/it.json +++ b/language/it.json @@ -149,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/km.json b/language/km.json index 142cc4e4..90e843f5 100644 --- a/language/km.json +++ b/language/km.json @@ -125,6 +125,10 @@ }, { "label": "Instant feedback" + }, + { + "label": "Solutions below content", + "description": "If set, will force solution texts to be displayed below the content." } ] }, @@ -145,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/ru.json b/language/ru.json index b5931b49..62ef9319 100644 --- a/language/ru.json +++ b/language/ru.json @@ -149,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +} diff --git a/language/sv.json b/language/sv.json index e2e8b065..1c61c68f 100644 --- a/language/sv.json +++ b/language/sv.json @@ -149,4 +149,4 @@ "default": "Retry" } ] -} \ No newline at end of file +}