From 1253b4a99cfe6e774b13791575898c4ab757bff0 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Tue, 29 Oct 2024 12:06:06 +0000 Subject: [PATCH 1/9] testing schema changes --- bower.json | 2 +- package.json | 2 +- properties.schema | 24 +++++++++++++++--------- schema/component.schema.json | 7 +++++++ 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/bower.json b/bower.json index 005b7e2..7d5dbcc 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-textInput", - "version": "7.3.0", + "version": "7.3.1", "framework": ">=5.19.1", "homepage": "https://github.com/adaptlearning/adapt-contrib-textInput", "bugs": "https://github.com/adaptlearning/adapt-contrib-textInput/issues", diff --git a/package.json b/package.json index 005b7e2..7d5dbcc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-textInput", - "version": "7.3.0", + "version": "7.3.1", "framework": ">=5.19.1", "homepage": "https://github.com/adaptlearning/adapt-contrib-textInput", "bugs": "https://github.com/adaptlearning/adapt-contrib-textInput/issues", diff --git a/properties.schema b/properties.schema index 1a45e44..a521d35 100644 --- a/properties.schema +++ b/properties.schema @@ -131,15 +131,6 @@ "validators": [], "help": "Allow the user to view the 'model answer' if they answer the question incorrectly?" }, - "_canShowCorrectness": { - "type": "boolean", - "required": false, - "default": false, - "title": "Display correct answers after submit", - "inputType": "Checkbox", - "validators": [], - "help": "If enabled, this replaces the associated 'model answer' toggle button and a comma separated list of correct options is displayed below the submitted text input." - }, "_canShowFeedback": { "type": "boolean", "required": true, @@ -441,6 +432,21 @@ "validators": [], "help": "Shown when there is one attempt left", "translatable": true + }, + "_answers": { + "type": "array", + "required": false, + "title": "Answers", + "items": { + "type": "string", + "required": true, + "default": "", + "title": "Item", + "inputType": "Text", + "validators": ["required"], + "help": "", + "translatable": true + } } } } diff --git a/schema/component.schema.json b/schema/component.schema.json index 0aa0be1..b002e45 100644 --- a/schema/component.schema.json +++ b/schema/component.schema.json @@ -367,6 +367,13 @@ "_adapt": { "translatable": true } + }, + "_answers": { + "type": "array", + "title": "Answers", + "items": { + "type": "string" + } } } } From ebde0b40701ee7f3588f9b85fcb5109931701d84 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Tue, 29 Oct 2024 12:42:37 +0000 Subject: [PATCH 2/9] more tests --- properties.schema | 30 +++++++++++++++--------------- schema/component.schema.json | 14 +++++++------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/properties.schema b/properties.schema index a521d35..98f2fc8 100644 --- a/properties.schema +++ b/properties.schema @@ -432,23 +432,23 @@ "validators": [], "help": "Shown when there is one attempt left", "translatable": true - }, - "_answers": { - "type": "array", - "required": false, - "title": "Answers", - "items": { - "type": "string", - "required": true, - "default": "", - "title": "Item", - "inputType": "Text", - "validators": ["required"], - "help": "", - "translatable": true - } } } + }, + "_answers": { + "type": "array", + "required": false, + "title": "Answers", + "items": { + "type": "string", + "required": true, + "default": "", + "title": "Item", + "inputType": "Text", + "validators": ["required"], + "help": "", + "translatable": true + } } } } diff --git a/schema/component.schema.json b/schema/component.schema.json index b002e45..e6f34b8 100644 --- a/schema/component.schema.json +++ b/schema/component.schema.json @@ -367,15 +367,15 @@ "_adapt": { "translatable": true } - }, - "_answers": { - "type": "array", - "title": "Answers", - "items": { - "type": "string" - } } } + }, + "_answers": { + "type": "array", + "title": "Answers", + "items": { + "type": "string" + } } } } From ec6eea514726f388d2eb84b805e3dae9b2493684 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Tue, 29 Oct 2024 12:57:58 +0000 Subject: [PATCH 3/9] more testing --- templates/textinput.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/templates/textinput.jsx b/templates/textinput.jsx index e2ff698..ace3452 100644 --- a/templates/textinput.jsx +++ b/templates/textinput.jsx @@ -51,6 +51,8 @@ export default function TextInput (props) { }, index) => { const hasMultipleCorrectAnswers = _correctAnswers.length > 1; + console.log(_correctAnswers) + return (
Date: Tue, 29 Oct 2024 13:04:38 +0000 Subject: [PATCH 4/9] moved _answers to match course example --- properties.schema | 30 +++++++++++++++--------------- schema/component.schema.json | 14 +++++++------- templates/textinput.jsx | 2 -- 3 files changed, 22 insertions(+), 24 deletions(-) diff --git a/properties.schema b/properties.schema index 98f2fc8..1ee173f 100644 --- a/properties.schema +++ b/properties.schema @@ -57,6 +57,21 @@ "help": "This will be read out by screen readers instead of reading the 'Display title', 'Body' & 'Instruction' fields when focusing on the options. To be clear and concise, ensure the text encompasses only the question associated.", "translatable": true }, + "_answers": { + "type": "array", + "required": false, + "title": "Answers", + "items": { + "type": "string", + "required": true, + "default": "", + "title": "Item", + "inputType": "Text", + "validators": ["required"], + "help": "", + "translatable": true + } + }, "_items": { "type": "array", "required": true, @@ -434,21 +449,6 @@ "translatable": true } } - }, - "_answers": { - "type": "array", - "required": false, - "title": "Answers", - "items": { - "type": "string", - "required": true, - "default": "", - "title": "Item", - "inputType": "Text", - "validators": ["required"], - "help": "", - "translatable": true - } } } } diff --git a/schema/component.schema.json b/schema/component.schema.json index e6f34b8..6c427ca 100644 --- a/schema/component.schema.json +++ b/schema/component.schema.json @@ -41,6 +41,13 @@ "translatable": true } }, + "_answers": { + "type": "array", + "title": "Answers", + "items": { + "type": "string" + } + }, "_items": { "type": "array", "title": "Items", @@ -369,13 +376,6 @@ } } } - }, - "_answers": { - "type": "array", - "title": "Answers", - "items": { - "type": "string" - } } } } diff --git a/templates/textinput.jsx b/templates/textinput.jsx index ace3452..e2ff698 100644 --- a/templates/textinput.jsx +++ b/templates/textinput.jsx @@ -51,8 +51,6 @@ export default function TextInput (props) { }, index) => { const hasMultipleCorrectAnswers = _correctAnswers.length > 1; - console.log(_correctAnswers) - return (
Date: Tue, 29 Oct 2024 13:07:57 +0000 Subject: [PATCH 5/9] merged master --- properties.schema | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/properties.schema b/properties.schema index 1ee173f..f989cf2 100644 --- a/properties.schema +++ b/properties.schema @@ -146,6 +146,15 @@ "validators": [], "help": "Allow the user to view the 'model answer' if they answer the question incorrectly?" }, + "_canShowCorrectness": { + "type": "boolean", + "required": false, + "default": false, + "title": "Display correct answers after submit", + "inputType": "Checkbox", + "validators": [], + "help": "If enabled, this replaces the associated 'model answer' toggle button and a comma separated list of correct options is displayed below the submitted text input." + }, "_canShowFeedback": { "type": "boolean", "required": true, From 4f4c076ba266e6e73f79c41e731985c81a7f5ea2 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Tue, 29 Oct 2024 13:23:11 +0000 Subject: [PATCH 6/9] remove version bump --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 7d5dbcc..005b7e2 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-textInput", - "version": "7.3.1", + "version": "7.3.0", "framework": ">=5.19.1", "homepage": "https://github.com/adaptlearning/adapt-contrib-textInput", "bugs": "https://github.com/adaptlearning/adapt-contrib-textInput/issues", diff --git a/package.json b/package.json index 7d5dbcc..005b7e2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "adapt-contrib-textInput", - "version": "7.3.1", + "version": "7.3.0", "framework": ">=5.19.1", "homepage": "https://github.com/adaptlearning/adapt-contrib-textInput", "bugs": "https://github.com/adaptlearning/adapt-contrib-textInput/issues", From cdc738d38677e941e930accee562e75b63188927 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Wed, 30 Oct 2024 15:00:41 +0000 Subject: [PATCH 7/9] Made answers an array of strings --- properties.schema | 18 ++++++++++++------ schema/component.schema.json | 5 ++++- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/properties.schema b/properties.schema index f989cf2..429eabd 100644 --- a/properties.schema +++ b/properties.schema @@ -62,14 +62,20 @@ "required": false, "title": "Answers", "items": { - "type": "string", + "type": "array", "required": true, - "default": "", + "default": [], "title": "Item", - "inputType": "Text", - "validators": ["required"], - "help": "", - "translatable": true + "items": { + "type": "string", + "required": true, + "default": "", + "title": "Item", + "inputType": "Text", + "validators": ["required"], + "help": "", + "translatable": true + } } }, "_items": { diff --git a/schema/component.schema.json b/schema/component.schema.json index 6c427ca..650d8c6 100644 --- a/schema/component.schema.json +++ b/schema/component.schema.json @@ -45,7 +45,10 @@ "type": "array", "title": "Answers", "items": { - "type": "string" + "type": "array", + "items": { + "type": "string" + } } }, "_items": { From f9f344a6bf5a8337ce15d7db33901f9b31929982 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Wed, 30 Oct 2024 15:15:38 +0000 Subject: [PATCH 8/9] updating properties --- properties.schema | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/properties.schema b/properties.schema index 429eabd..4e3f257 100644 --- a/properties.schema +++ b/properties.schema @@ -61,6 +61,7 @@ "type": "array", "required": false, "title": "Answers", + "help": "These are generic answers that apply to every item in the component", "items": { "type": "array", "required": true, @@ -68,12 +69,8 @@ "title": "Item", "items": { "type": "string", - "required": true, "default": "", - "title": "Item", "inputType": "Text", - "validators": ["required"], - "help": "", "translatable": true } } From 9ab74ca1fc65bf4f84b453886a1ddc5e7edef142 Mon Sep 17 00:00:00 2001 From: Lemmy Adams Date: Wed, 30 Oct 2024 15:23:16 +0000 Subject: [PATCH 9/9] Added description --- schema/component.schema.json | 1 + 1 file changed, 1 insertion(+) diff --git a/schema/component.schema.json b/schema/component.schema.json index 650d8c6..9e31c67 100644 --- a/schema/component.schema.json +++ b/schema/component.schema.json @@ -44,6 +44,7 @@ "_answers": { "type": "array", "title": "Answers", + "description": "These are generic answers that apply to every item in the component", "items": { "type": "array", "items": {