diff --git a/properties.schema b/properties.schema index fa74d11..6dc73b7 100644 --- a/properties.schema +++ b/properties.schema @@ -4,219 +4,161 @@ "id": "http://jsonschema.net", "$ref": "http://localhost/plugins/content/component/model.schema", "properties":{ - "instruction": { - "type": "string", - "required": false, - "default": "", - "inputType": "Text", - "validators": [], - "help": "This is the instruction text" + "instruction": { + "type":"string", + "title": "Instruction text" }, - "_attempts": { + "_attempts": { "type":"number", "required":true, "default":1, - "title": "Attempts", - "inputType":"Number", - "validators": ["required", "number"], - "help": "How many attempts the learner is allow" + "minimum": 1, + "title": "Number of attempts" }, "_isRandom": { "type":"boolean", "required":true, - "default": true, - "title": "Randomised Items", - "inputType": {"type": "Boolean", "options": [true, false]}, - "validators": [], - "help": "If set to 'true', all items will be randomised" + "default":false, + "title": "Random order" }, "_questionWeight": { "type":"number", "required":false, - "default": 1, - "title": "Question Weight", - "inputType": "Number", - "validators": ["number"], - "help": "How much this question is worth" + "title":"Question weight" }, "_selectable": { "type":"number", "required":true, - "default": 1, - "title": "Selectable Items", - "inputType": "Number", - "validators": ["number"], - "help": "How many items are selectable" + "minimum": 1, + "default":1, + "title": "Number of items to select" }, - "_items": { - "type":"array", - "required":true, - "title": "Items", - "items": { - "type":"object", - "required":true, - "properties":{ - "_graphic": { - "type":"object", - "required":true, - "title": "Graphic", - "properties":{ - "large": { - "type":"string", - "required":true, - "default": "", - "inputType": "Asset:image", - "validators": [], - "help": "Large image for this item - used on desktop" - }, - "medium": { - "type":"string", - "required":true, - "default": "", - "inputType": "Asset:image", - "validators": [], - "help": "Medium image for this item - used on tablets" - }, - "small": { - "type":"string", - "required":true, - "default": "", - "inputType": "Asset:image", - "validators": [], - "help": "Small image for this item - used on mobiles" - }, - "alt": { - "type":"string", - "required":false, - "default": "", - "inputType": "Text", - "validators": [], - "help": "Alternative text for this items image" - } - } - }, - "text": { - "type":"string", - "required":false, - "default": "", - "title": "Item Text", - "inputType": "Text", - "validators": [], - "help": "This text will display with the image" - }, - "_shouldBeSelected": { - "type":"boolean", - "required":true, - "default": true, - "title": "Should Be Selected", - "inputType": {"type": "Boolean", "options": [true, false]}, - "validators": [], - "help": "Set this item to 'true' if this is one of the correct answers" - } + "_buttons": { + "type":"object", + "title": "Buttons", + "properties":{ + "hideCorrectAnswer": { + "type":"string", + "title": "Hide correct answer button label" + }, + "reset": { + "type":"string", + "title": "Reset button label" + }, + "showCorrectAnswer": { + "type":"string", + "title": "Show correct answer button label" + }, + "submit": { + "type":"string", + "title": "Submit button label" } } }, "_feedback": { "type":"object", "required":true, - "title": "Feedback", + "title": "Feedback text", "properties":{ - "correct": { - "type":"string", - "required":true, - "default": "", - "title": "Correct", - "inputType": "TextArea", - "validators": ["required"], - "help": "Correct feedback for this question" - }, "_incorrect": { "type":"object", "required":true, - "title": "Incorrect Feedback", + "title": "Feedback for incorrect answers", "properties":{ "final": { "type":"string", - "required": true, - "default": "", - "title": "Incorrect Final", - "inputType": "TextArea", - "validators": ["required"], - "help": "Incorrect feedback for the final attempt" + "required":true, + "minLength": 1, + "title": "Incorrect final answer" }, "notFinal": { "type":"string", - "required": true, - "default": "", - "title": "Incorrect Not Final", - "inputType": "TextArea", - "validators": ["required"], - "help": "Incorrect feedback for any attempt apart from the last attempt" + "title": "Incorrect non final answer" } } }, "_partlyCorrect": { "type":"object", "required":true, + "title": "Feedback when answer is partly correct", "properties":{ "final": { "type":"string", - "required": true, - "default": "", - "title": "Partly Correct Final", - "inputType": "TextArea", - "validators": ["required"], - "help": "Partly correct feedback for the final attempt" + "required":true, + "title": "Partially correct final answer", + "minLength": 1 }, "notFinal": { "type":"string", - "required": true, - "default": "", - "title": "Partly Correct Not Final", - "inputType": "TextArea", - "validators": ["required"], - "help": "Partly correct feedback for any attempt apart from the last attempt" + "title": "Partially correct non final answer" } } + }, + "correct": { + "type":"string", + "required":true, + "title": "Feedback for correct answer", + "minLength": 1 } } }, - "_buttons": { - "type":"object", - "title": "Buttons", - "required": false, - "properties":{ - "submit": { - "type":"string", - "required": false, - "default": "", - "inputType": "QuestionButton", - "validators": [], - "help": "Button label text for the submit button" - }, - "reset": { - "type":"string", - "required": false, - "default": "", - "inputType": "QuestionButton", - "validators": [], - "help": "Button label text for the reset button" - }, - "showCorrectAnswer": { - "type":"string", - "required": false, - "default": "", - "inputType": "QuestionButton", - "validators": [], - "help": "Button label text so show the model answer" - }, - "hideCorrectAnswer": { - "type":"string", - "required": false, - "default": "", - "inputType": "QuestionButton", - "validators": [], - "help": "Button label text so hide the model answer" + "_items": { + "type":"array", + "required":true, + "minItems": 1, + "maxItems": 8, + "title": "Answers", + "items": { + "type":"object", + "required":true, + "properties":{ + "_graphic": { + "type":"object", + "required":true, + "title": "Graphic", + "properties":{ + "alt": { + "type":"string", + "required":false, + "title": "Alternative text" + }, + "large": { + "type":"string", + "required":true, + "title": "Large graphic asset", + "minLength": 1 + }, + "medium": { + "type":"string", + "required":true, + "title": "Medium size graphic asset", + "minLength": 1 + }, + "small": { + "type":"string", + "required":true, + "title": "Small graphic asset", + "minLength": 1 + }, + "title": { + "type":"string", + "required":true, + "title": "Graphic title", + "minLength": 1 + } + } + }, + "_shouldBeSelected": { + "type":"boolean", + "required":true, + "default":false, + "title": "Correct answer" + }, + "text": { + "type":"string", + "required":false, + "title": "Answer text" + } } } }