{
    "$schema" : "http://json-schema.org/schema#",
    "description" : "The question JSON.",
    "type" : "object",
    "id" : "survey_question.json",
    "properties" : {
        "id" : {
            "description" : "The id generated for this question from the source file (for files loaded from csv, this will be q_x_y, where x refers to the row and y refers to the column",
            "type" : "string"
        },
        "qtext" : {
            "description" : "The text of the question to be displayed",
            "type" : "string"
        },
        "options" : {
            "description" : "The list of options associated with this question",
            "type" : "array",
            "items" : {
                "$ref" : "survey_option.json"
            }
        },
        "branchMap" : {
            "$ref" : "survey_branchMap.json"
        },
        "freetext" : {
            "description" : "The freetext object can be a boolean value or a string representing the default value, or a regex",
            "oneOf" : [
                { "type" : "boolean"},
                { "type" : "string"}
            ]
        },
        "answer" : {
            "type" : "string",
            "description" : "The id of the correct answer for this question. It should be a valid Option Id present in the options properties."
        },
        "randomize" : { "type" : "boolean" },
        "correlation" : {
            "oneOf" : [
                {"type" : "string"},
                {"type" : "array", "items" : {"type" : "string"}}
            ]
        },
        "ordered" : {
            "oneOf" : [
                { "type" : "boolean" },
                { "type" : "array", "items" : { "type" : "string" }}
            ]
	},
        "exclusive" : { "type" : "boolean" },
        "permitBreakoff" : { "type" : "boolean"}
    },
    "required" : ["id", "qtext"]
}
