diff --git a/schema/items-question-component.schema.json b/schema/items-question-component.schema.json new file mode 100644 index 00000000..d9ef76f7 --- /dev/null +++ b/schema/items-question-component.schema.json @@ -0,0 +1,28 @@ +{ + "$anchor": "items-question-component", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$merge": { + "source": { + "$ref": "question-component" + }, + "with": { + "required": [ + ], + "properties": { + "_items": { + "type": "array", + "title": "Items", + "items": { + "type": "object" + } + }, + "_isRandom": { + "type": "boolean", + "title": "Randomise answers", + "default": false + } + } + } + } +} diff --git a/schema/question-component.schema.json b/schema/question-component.schema.json new file mode 100644 index 00000000..a6fdddd9 --- /dev/null +++ b/schema/question-component.schema.json @@ -0,0 +1,307 @@ +{ + "$anchor": "question-component", + "$schema": "https://json-schema.org/draft/2020-12/schema", + "type": "object", + "$merge": { + "source": { + "$ref": "component" + }, + "with": { + "required": [ + "_attempts" + ], + "properties": { + "instruction": { + "type": "string", + "title": "Instruction", + "default": "Choose {{#if _isRadio}}one option{{else}}one or more options{{/if}} then select Submit.", + "_adapt": { + "translatable": true + } + }, + "ariaQuestion": { + "type": "string", + "title": "ARIA question", + "description": "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.", + "default": "", + "_adapt": { + "translatable": true + } + }, + "_attempts": { + "type": "number", + "title": "Allowed attempts", + "description": "How many attempts the learner is allowed", + "default": 1 + }, + "_canShowModelAnswer": { + "type": "boolean", + "title": "Enable correct answer toggle", + "description": "Allow the user to view the 'model answer' if they answer the question incorrectly", + "default": true + }, + "_canShowCorrectness": { + "type": "boolean", + "title": "Enable items to display correctness", + "description": "If enabled, this replaces the associated 'model answer' toggle button and displays correctness directly on the component items.", + "default": false + }, + "_canShowFeedback": { + "type": "boolean", + "title": "Enable feedback", + "default": true + }, + "_canShowMarking": { + "type": "boolean", + "title": "Enable marking", + "default": true + }, + "_shouldDisplayAttempts": { + "type": "boolean", + "title": "Show number of remaining attempts", + "default": false + }, + "_questionWeight": { + "type": "number", + "title": "Question weight", + "description": "When item scoring is disabled, this is the question score for a correct response", + "default": 1 + }, + "_recordInteraction": { + "type": "boolean", + "title": "Record interaction", + "description": "If disabled, recording the user's answer(s) to this question to cmi.interactions on the LMS will be disabled for this component only", + "default": true + }, + "_feedback": { + "type": "object", + "title": "Feedback", + "default": {}, + "properties": { + "title": { + "type": "string", + "title": "Title", + "description": "Title text for the feedback", + "default": "", + "_adapt": { + "translatable": true + } + }, + "altTitle": { + "type": "string", + "title": "Alternative Feedback Title", + "description": "Text read out by screen readers if no visual title is included", + "default": "", + "_adapt": { + "translatable": true + } + }, + "correct": { + "type": "string", + "title": "Correct", + "description": "Correct answer feedback for this question", + "default": "", + "_adapt": { + "translatable": true + }, + "_backboneForms": "TextArea" + }, + "_incorrect": { + "type": "object", + "title": "Incorrect", + "default": {}, + "properties": { + "final": { + "type": "string", + "title": "Default incorrect feedback", + "description": "Incorrect answer feedback for the final attempt", + "default": "", + "_adapt": { + "translatable": true + }, + "_backboneForms": "TextArea" + }, + "notFinal": { + "type": "string", + "title": "Retry feedback", + "description": "Incorrect answer feedback for any attempt apart from the last attempt. If you leave this blank, the default incorrect feedback will be used instead", + "default": "", + "_adapt": { + "translatable": true + }, + "_backboneForms": "TextArea" + } + } + }, + "_partlyCorrect": { + "type": "object", + "title": "Partly correct", + "default": {}, + "properties": { + "final": { + "type": "string", + "title": "Default partly correct feedback", + "description": "Partly correct answer feedback for the final attempt. If you leave this blank, the default incorrect feedback will be used instead", + "default": "", + "_adapt": { + "translatable": true + }, + "_backboneForms": "TextArea" + }, + "notFinal": { + "type": "string", + "title": "Retry feedback", + "description": "Partly correct answer feedback for any attempt apart from the last attempt. If you leave this blank, the default partly correct feedback will be used instead", + "default": "", + "_adapt": { + "translatable": true + }, + "_backboneForms": "TextArea" + } + } + } + } + }, + "_buttons": { + "type": "object", + "title": "Button overrides", + "default": {}, + "properties": { + "_submit": { + "type": "object", + "title": "Submit", + "default": {}, + "properties": { + "buttonText": { + "type": "string", + "title": "Button text", + "default": "", + "_adapt": { + "translatable": true + } + }, + "ariaLabel": { + "type": "string", + "title": "ARIA label", + "default": "", + "_adapt": { + "translatable": true + } + } + } + }, + "_reset": { + "type": "object", + "title": "Reset", + "default": {}, + "properties": { + "buttonText": { + "type": "string", + "title": "Button text", + "default": "", + "_adapt": { + "translatable": true + } + }, + "ariaLabel": { + "type": "string", + "title": "ARIA label", + "default": "", + "_adapt": { + "translatable": true + } + } + } + }, + "_showCorrectAnswer": { + "type": "object", + "title": "Show correct answer", + "default": {}, + "properties": { + "buttonText": { + "type": "string", + "title": "Button text", + "default": "", + "_adapt": { + "translatable": true + } + }, + "ariaLabel": { + "type": "string", + "title": "ARIA label", + "default": "", + "_adapt": { + "translatable": true + } + } + } + }, + "_hideCorrectAnswer": { + "type": "object", + "title": "Hide correct answer", + "default": {}, + "properties": { + "buttonText": { + "type": "string", + "title": "Button text", + "default": "", + "_adapt": { + "translatable": true + } + }, + "ariaLabel": { + "type": "string", + "title": "ARIA label", + "default": "", + "_adapt": { + "translatable": true + } + } + } + }, + "_showFeedback": { + "type": "object", + "title": "Show feedback", + "default": {}, + "properties": { + "buttonText": { + "type": "string", + "title": "Button text", + "default": "", + "_adapt": { + "translatable": true + } + }, + "ariaLabel": { + "type": "string", + "title": "ARIA label", + "default": "", + "_adapt": { + "translatable": true + } + } + } + }, + "remainingAttemptsText": { + "type": "string", + "title": "Remaining attempts label", + "default": "", + "_adapt": { + "translatable": true + } + }, + "remainingAttemptText": { + "type": "string", + "title": "Final attempt label", + "default": "", + "_adapt": { + "translatable": true + } + } + } + } + } + } + } +} +