{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "AliveformsSchemaRanked Quiz",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "question": {
        "type": "string"
      },
      "questionType": {
        "type": "string",
        "enum": [
          "Information Screen",
          "Multiple Choice",
          "Dropdown List",
          "Text Input",
          "Rating",
          "File Upload",
          "NPS",
          "Address",
          "Contact Information",
          "Compound Inputs",
          "Drawing Pad",
          "Dynamic List Input",
          "Matrix Input",
          "Hidden Input"
        ]
      },
      "photo": {
        "type": "string"
      },
      "collect": {
        "type": "boolean",
        "if": {
          "not": {
            "properties": {
              "questionType": {
                "const": "Information Screen"
              }
            }
          }
        }
      },
      "required": {
        "type": "boolean",
        "if": {
          "not": {
            "properties": {
              "questionType": {
                "enum": [
                  "Information Screen",
                  "Address",
                  "Compound Inputs",
                  "Contact Information"
                ]
              }
            }
          }
        }
      },
      "inputType": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Text Input"
            }
          }
        },
        "then": {
          "enum": [
            "Any Text",
            "Multiline Text",
            "Date",
            "DateTime",
            "Email",
            "Number",
            "Person Name",
            "Phone",
            "Password",
            "Time",
            "Week",
            "Month",
            "Url",
            "Custom Regex"
          ]
        }
      },
      "uploadType": {
        "if": {
          "properties": {
            "questionType": {
              "const": "File Upload"
            }
          }
        },
        "then": {
          "type": "string"
        }
      },
      "screenTitleLayout": {
        "type": "string",
        "enum": [
          "Row",
          "Stack"
        ]
      },
      "optionsLayout": {
        "type": "string",
        "enum": [
          "Row",
          "Column"
        ]
      },
      "screenLayout": {
        "type": "string",
        "enum": [
          "Row",
          "Column"
        ]
      },
      "timer": {
        "anyOf": [
          {
            "type": "boolean"
          },
          {
            "type": "number"
          }
        ]
      },
      "nextScreen": {
        "type": "number",
        "default": -1
      },
      "options": {
        "type": "array",
        "if": {
          "properties": {
            "questionType": {
              "enum": [
                "Multiple Choice",
                "Dropdown List"
              ]
            }
          }
        },
        "then": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "correct": {
                "type": "boolean"
              },
              "nextQuestion": {
                "type": "number"
              },
              "photo": {
                "type": "string"
              },
              "option": {
                "type": "string"
              }
            }
          }
        }
      },
      "answerableQuestion": {
        "type": "boolean"
      },
      "backable": {
        "type": "boolean"
      },
      "correctAnswer": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Text Input"
            }
          }
        },
        "then": {
          "type": "string"
        }
      },
      "multiline": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Text Input"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "changeNextScreen": {
        "type": "boolean"
      },
      "disableNextButton": {
        "type": "boolean"
      },
      "makeSubmitScreen": {
        "type": "boolean"
      },
      "invalidInputMessage": {
        "if": {
          "not": {
            "properties": {
              "questionType": {
                "const": "Information Screen"
              }
            }
          }
        },
        "then": {
          "type": "string"
        }
      },
      "inputRegex": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Text Input"
            },
            "inputType": {
              "const": "Custom Regex"
            }
          }
        },
        "then": {
          "type": "string"
        }
      },
      "multiple": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Multiple Choice"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "asButton": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Multiple Choice"
            },
            "multiple": {
              "const": false
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "nativeControls": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Multiple Choice"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "allowMultipleUploads": {
        "if": {
          "properties": {
            "questionType": {
              "const": "File Upload"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "previousScreenIndex": {
        "type": "number",
        "default": -1
      },
      "score": {
        "type": "number"
      },
      "maximumItems": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Dynamic List Input"
            }
          }
        },
        "then": {
          "type": "number"
        }
      },
      "minimumItems": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Dynamic List Input"
            }
          }
        },
        "then": {
          "type": "number"
        }
      },
      "list": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "option": {
              "type": "string"
            },
            "required": {
              "type": "boolean"
            },
            "inputType": {
              "type": "string"
            }
          }
        }
      },
      "requireAddressLine1": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Address"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireAddressLine2": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Address"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireCity": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Address"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireState": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Address"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireZip": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Address"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireCountry": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Address"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireFirstName": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Contact Information"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireLastName": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Contact Information"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requirePhoneNumber": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Contact Information"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "requireEmail": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Contact Information"
            }
          }
        },
        "then": {
          "type": "boolean"
        }
      },
      "rows": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Matrix Input"
            }
          }
        },
        "then": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "option": {
                "type": "string"
              }
            }
          }
        }
      },
      "columns": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Matrix Input"
            }
          }
        },
        "then": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "option": {
                "type": "string"
              }
            }
          }
        }
      },
      "hiddenValue": {
        "if": {
          "properties": {
            "questionType": {
              "const": "Hidden Input"
            }
          }
        },
        "then": {
          "type": "string"
        }
      },
      "transitionInName": {
        "type": "string",
        "enum": [
          "fly",
          "fade",
          "slide",
          "scale",
          "blur"
        ]
      },
      "transitionInFrom": {
        "type": "string",
        "enum": [
          "top",
          "left",
          "bottom",
          "right",
          "center"
        ]
      },
      "transitionInSpeed": {
        "type": "string",
        "enum": [
          "slow",
          "medium",
          "fast"
        ]
      },
      "transitionOutName": {
        "type": "string",
        "enum": [
          "fly",
          "fade",
          "slide",
          "scale",
          "blur"
        ]
      },
      "transitionOutTo": {
        "type": "string",
        "enum": [
          "top",
          "left",
          "bottom",
          "right",
          "center"
        ]
      },
      "transitionOutSpeed": {
        "type": "string",
        "enum": [
          "slow",
          "medium",
          "fast"
        ]
      }
    }
  }
}