{
  "type": "object",
  "$schema": "http://json-schema.org/draft-04/schema",
  "id": "http://jsonschema.net",
  "$ref": "http://localhost/plugins/content/component/model.schema",
  "globals": {
    "ariaRegion": {
      "type": "string",
      "required": true,
      "default": "Multiple choice question. Select your option and then submit.",
      "inputType": "Text",
      "validators": [],
      "translatable": true
    }
  },
  "properties": {
    "_supportedLayout": {
      "type": "string",
      "required": true,
      "enum": ["full-width", "half-width", "both"],
      "default": "both",
      "editorOnly": true
    },
    "instruction": {
      "type": "string",
      "required": false,
      "default": "",
      "inputType": "Text",
      "validators": [],
      "help": "This is the instruction text",
      "translatable": true
    },
    "_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"
              },
              "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 the image",
                "translatable": true
              },
              "attribution": {
                "type": "string",
                "required": false,
                "default": "",
                "inputType": "Text",
                "validators": [],
                "help": "Text to be displayed as an attribution",
                "translatable": true
              }
            }
          },
          "text": {
            "type": "string",
            "required": false,
            "default": "",
            "title": "Item Text",
            "inputType": "Text",
            "validators": [],
            "help": "Text that will be displayed with the image",
            "translatable": true
          },
          "_shouldBeSelected": {
            "type": "boolean",
            "required": true,
            "default": false,
            "title": "Correct answer?",
            "inputType": "Checkbox",
            "validators": []
          },
          "feedback": {
            "type": "string",
            "required": false,
            "default": "",
            "title": "Answer-specific feedback",
            "inputType": "Text",
            "validators": [],
            "help": "When 'Selectable Items' is set to 1, this can be used to give the user feedback specific to the answer they selected",
            "translatable": true
          }
        }
      }
    },
    "_attempts": {
      "type": "number",
      "required": true,
      "default": 1,
      "title": "Attempts",
      "inputType": "Number",
      "validators": ["required", "number"],
      "help": "How many attempts the learner is allowed"
    },
    "_canShowModelAnswer": {
      "type": "boolean",
      "required": true,
      "default": true,
      "title": "Display Model Answer",
      "inputType": "Checkbox",
      "validators": [],
      "help": "Allow the user to view the 'model answer' if they answer the question incorrectly?"
    },
    "_canShowFeedback": {
      "type": "boolean",
      "required": true,
      "default": true,
      "title": "Display Feedback",
      "inputType": "Checkbox",
      "validators": []
    },
    "_canShowMarking": {
      "type": "boolean",
      "default": true,
      "title": "Display Marking",
      "inputType": "Checkbox",
      "validators": []
    },
    "_shouldDisplayAttempts": {
      "type": "boolean",
      "required": false,
      "default": false,
      "title": "Display Attempts",
      "inputType": "Checkbox",
      "validators": [],
      "help": "Display the number of attempts remaining?"
    },
    "_isRandom": {
      "type": "boolean",
      "required": false,
      "default": false,
      "title": "Randomise answers",
      "inputType": "Checkbox",
      "validators": []
    },
    "_questionWeight": {
      "type": "number",
      "required": false,
      "default": 1,
      "title": "Question Weight",
      "inputType": "Number",
      "validators": ["number"],
      "help": "How much this question is worth"
    },
    "_recordInteraction": {
      "type": "boolean",
      "required": false,
      "default": true,
      "title": "Record interaction",
      "inputType": "Checkbox",
      "validators": [],
      "help": "If disabled, recording the user's answer(s) to this question to cmi.interactions on the LMS will be disabled for this component only."
    },
    "_columns": {
      "type": "number",
      "required": false,
      "default": 0,
      "title": "Columns",
      "inputType": "Number",
      "validators": ["number"],
      "help": "Set the number of columns. If value is '0', component uses the default layout."
    },
    "_selectable": {
      "type": "number",
      "required": true,
      "default": 1,
      "title": "Selectable Items",
      "inputType": "Number",
      "validators": ["number", "required"],
      "help": "How many items are selectable"
    },
    "_feedback": {
      "type": "object",
      "required": false,
      "title": "Feedback",
      "properties": {
        "title": {
          "type": "string",
          "required": false,
          "default": "",
          "title": "Feedback Title",
          "inputType": "Text",
          "validators": [],
          "help": "Leave blank to have the component's title shown instead.",
          "translatable": true
        },
        "correct": {
          "type": "string",
          "required": false,
          "default": "",
          "title": "Correct",
          "inputType": "TextArea",
          "validators": [],
          "help": "Correct answer feedback for this question",
          "translatable": true
        },
        "_incorrect": {
          "type": "object",
          "required": false,
          "title": "Incorrect Feedback",
          "properties": {
            "final": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "Incorrect Final",
              "inputType": "TextArea",
              "validators": [],
              "help": "Incorrect answer feedback for the final attempt",
              "translatable": true
            },
            "notFinal": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "Incorrect Not Final",
              "inputType": "TextArea",
              "validators": [],
              "help": "Incorrect answer feedback for any attempt apart from the last attempt. If you leave this blank, the 'Incorrect Final' feedback will be used instead.",
              "translatable": true
            }
          }
        },
        "_partlyCorrect": {
          "type": "object",
          "required": false,
          "properties": {
            "final": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "Partly Correct Final",
              "inputType": "TextArea",
              "validators": [],
              "help": "Partly correct answer feedback for the final attempt. If you leave this blank, the 'Incorrect Final' feedback will be used instead.",
              "translatable": true
            },
            "notFinal": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "Partly Correct Not Final",
              "inputType": "TextArea",
              "validators": [],
              "help": "Partly correct answer feedback for any attempt apart from the last attempt. If you leave this blank, the 'Partly Correct Final' feedback will be used instead.",
              "translatable": true
            }
          }
        }
      }
    },
    "_buttons": {
      "type": "object",
      "title": "Buttons",
      "required": false,
      "properties": {
        "_submit": {
          "type": "object",
          "title": "Submit",
          "properties": {
            "buttonText": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Button label text for the submit button",
              "translatable": true
            },
            "ariaLabel": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Aria label for the submit button",
              "translatable": true
            }
          }
        },
        "_reset": {
          "type": "object",
          "title": "Reset",
          "properties": {
            "buttonText": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Button label text for the reset button",
              "translatable": true
            },
            "ariaLabel": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Aria label for the reset button",
              "translatable": true
            }
          }
        },
        "_showCorrectAnswer": {
          "type": "object",
          "title": "Show Correct Answer",
          "properties": {
            "buttonText": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Button label text to show the model answer",
              "translatable": true
            },
            "ariaLabel": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Aria label for the show model answer button",
              "translatable": true
            }
          }
        },
        "_hideCorrectAnswer": {
          "type": "object",
          "title": "Hide Correct Answer",
          "properties": {
            "buttonText": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Button label text to hide the model answer",
              "translatable": true
            },
            "ariaLabel": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Aria label for the hide model answer button",
              "translatable": true
            }
          }
        },
        "_showFeedback": {
          "type": "object",
          "title": "Show Feedback",
          "properties": {
            "buttonText": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Button label text to show feedback",
              "translatable": true
            },
            "ariaLabel": {
              "type": "string",
              "required": false,
              "default": "",
              "title": "",
              "inputType": "QuestionButton",
              "validators": [],
              "help": "Aria label for the show feedback button",
              "translatable": true
            }
          }
        },
        "remainingAttemptsText": {
          "type": "string",
          "required": false,
          "default": "",
          "title": "Attempts Remaining Text",
          "inputType": "QuestionButton",
          "validators": [],
          "help": "Shown when there are multiple attempts left",
          "translatable": true
        },
        "remainingAttemptText": {
          "type": "string",
          "required": false,
          "default": "",
          "title": "Final Attempt Text",
          "inputType": "QuestionButton",
          "validators": [],
          "help": "Shown when there is one attempt left",
          "translatable": true
        }
      }
    }
  }
}
