{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quizgen-dev/json-schema/quizgen-dev-quiz-definition-schema.json",
  "title": "QuizDefinition",
  "description": "A quiz/form definition (`schema_version` 1). Generated from the same validator the API enforces; the canonical JSON Schema is also at https://quizgen.dev/schema/v1.json.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quizgen-dev-openapi.json#/components/schemas/QuizDefinition",
  "type": "object",
  "properties": {
    "schema_version": {
      "type": "number",
      "const": 1
    },
    "kind": {
      "type": "string",
      "enum": [
        "quiz",
        "survey",
        "form",
        "email_capture",
        "registration"
      ]
    },
    "title": {
      "type": "string",
      "minLength": 1,
      "maxLength": 300
    },
    "description": {
      "type": "string",
      "maxLength": 2000
    },
    "settings": {
      "type": "object",
      "properties": {
        "collect_respondent": {
          "type": "string",
          "enum": [
            "none",
            "email_optional",
            "email_required"
          ]
        },
        "autosave": {
          "type": "boolean"
        },
        "show_progress": {
          "type": "boolean"
        },
        "one_question_per_page": {
          "type": "boolean"
        },
        "show_branding": {
          "type": "boolean"
        },
        "close_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z))$"
            },
            {
              "type": "null"
            }
          ]
        },
        "max_responses": {
          "anyOf": [
            {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 9007199254740991
            },
            {
              "type": "null"
            }
          ]
        },
        "completion": {
          "type": "object",
          "properties": {
            "message": {
              "type": "string",
              "maxLength": 2000
            },
            "redirect_url": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uri"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "cover": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "maxLength": 300
        },
        "subtitle": {
          "type": "string",
          "maxLength": 1000
        },
        "button_label": {
          "type": "string",
          "maxLength": 60
        },
        "image_url": {
          "type": "string",
          "format": "uri"
        }
      },
      "additionalProperties": false
    },
    "theme": {
      "type": "object",
      "properties": {
        "preset": {
          "type": "string",
          "enum": [
            "warm",
            "midnight",
            "forest",
            "corporate",
            "playful",
            "mono"
          ]
        },
        "accent": {
          "type": "string",
          "pattern": "^#[0-9a-fA-F]{6}$"
        },
        "mode": {
          "type": "string",
          "enum": [
            "light",
            "dark",
            "auto"
          ]
        },
        "background": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "font": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ]
        },
        "logo_url": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "hidden_fields": {
      "maxItems": 10,
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "maxLength": 64,
        "pattern": "^[a-z0-9_]+$"
      }
    },
    "sections": {
      "minItems": 1,
      "maxItems": 30,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[a-z0-9_]+$"
          },
          "title": {
            "type": "string",
            "maxLength": 300
          },
          "blurb": {
            "type": "string",
            "maxLength": 1000
          },
          "one_per_page": {
            "type": "boolean"
          },
          "questions": {
            "minItems": 1,
            "maxItems": 50,
            "type": "array",
            "items": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "short_text"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "placeholder": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "long_text"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "rows": {
                      "type": "integer",
                      "minimum": 2,
                      "maximum": 20
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "choice"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "options": {
                      "minItems": 2,
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64,
                            "pattern": "^[a-z0-9_]+$"
                          },
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "detail": {
                            "type": "string",
                            "maxLength": 500
                          },
                          "image_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "required": [
                          "value",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "follow_up": {
                      "type": "string",
                      "maxLength": 500
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt",
                    "options"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "multi_choice"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "options": {
                      "minItems": 2,
                      "maxItems": 20,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64,
                            "pattern": "^[a-z0-9_]+$"
                          },
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "detail": {
                            "type": "string",
                            "maxLength": 500
                          },
                          "image_url": {
                            "type": "string",
                            "format": "uri"
                          }
                        },
                        "required": [
                          "value",
                          "label"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "min": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "max": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt",
                    "options"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "scale"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "min": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 1
                    },
                    "max": {
                      "type": "integer",
                      "minimum": 2,
                      "maximum": 10
                    },
                    "min_label": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "max_label": {
                      "type": "string",
                      "maxLength": 100
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "email"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "placeholder": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "number"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "min": {
                      "type": "number"
                    },
                    "max": {
                      "type": "number"
                    },
                    "unit": {
                      "type": "string",
                      "maxLength": 30
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "date"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "min": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    },
                    "max": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "time"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "phone"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "placeholder": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "url"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "placeholder": {
                      "type": "string",
                      "maxLength": 200
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "yes_no"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "yes_label": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "no_label": {
                      "type": "string",
                      "maxLength": 100
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "consent"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000
                    },
                    "terms": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 20000
                        },
                        "version": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "required": [
                        "title",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "signature"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 2000
                    },
                    "terms": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 200
                        },
                        "text": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 20000
                        },
                        "version": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100
                        }
                      },
                      "required": [
                        "title",
                        "text"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "rating"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "max": {
                      "type": "integer",
                      "minimum": 2,
                      "maximum": 10
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "slider"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "min": {
                      "type": "number"
                    },
                    "max": {
                      "type": "number"
                    },
                    "step": {
                      "type": "number",
                      "exclusiveMinimum": 0
                    },
                    "min_label": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "max_label": {
                      "type": "string",
                      "maxLength": 100
                    },
                    "unit": {
                      "type": "string",
                      "maxLength": 30
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "payment"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "amount_cents": {
                      "type": "integer",
                      "minimum": 50,
                      "maximum": 1000000
                    },
                    "price_options": {
                      "minItems": 2,
                      "maxItems": 10,
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "value": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 64,
                            "pattern": "^[a-z0-9_]+$"
                          },
                          "label": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 200
                          },
                          "amount_cents": {
                            "type": "integer",
                            "minimum": 50,
                            "maximum": 1000000
                          },
                          "detail": {
                            "type": "string",
                            "maxLength": 500
                          }
                        },
                        "required": [
                          "value",
                          "label",
                          "amount_cents"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "currency": {
                      "type": "string",
                      "pattern": "^[a-z]{3}$"
                    },
                    "button_label": {
                      "type": "string",
                      "maxLength": 60
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "required": {
                      "type": "boolean"
                    },
                    "help": {
                      "type": "string",
                      "maxLength": 1000
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "file_upload"
                    },
                    "prompt": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 1000
                    },
                    "max_files": {
                      "type": "integer",
                      "minimum": 1,
                      "maximum": 5
                    },
                    "accept": {
                      "minItems": 1,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": [
                          "image",
                          "pdf",
                          "document",
                          "spreadsheet"
                        ]
                      }
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "prompt"
                  ],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 64,
                      "pattern": "^[a-z0-9_]+$"
                    },
                    "show_if": {
                      "type": "object",
                      "properties": {
                        "question": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 64,
                          "pattern": "^[a-z0-9_]+$"
                        },
                        "op": {
                          "type": "string",
                          "enum": [
                            "eq",
                            "neq",
                            "in",
                            "gte",
                            "lte",
                            "answered"
                          ]
                        },
                        "value": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "number"
                            },
                            {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          ]
                        }
                      },
                      "required": [
                        "question",
                        "op"
                      ],
                      "additionalProperties": false
                    },
                    "type": {
                      "type": "string",
                      "const": "statement"
                    },
                    "title": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 300
                    },
                    "body": {
                      "minItems": 1,
                      "maxItems": 10,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "maxLength": 2000
                      }
                    }
                  },
                  "required": [
                    "id",
                    "type",
                    "title",
                    "body"
                  ],
                  "additionalProperties": false
                }
              ]
            }
          }
        },
        "required": [
          "key",
          "questions"
        ],
        "additionalProperties": false
      }
    },
    "outcomes": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "method": {
              "type": "string",
              "const": "points"
            },
            "points": {
              "type": "object",
              "propertyNames": {
                "type": "string"
              },
              "additionalProperties": {
                "type": "object",
                "propertyNames": {
                  "type": "string"
                },
                "additionalProperties": {
                  "type": "number"
                }
              }
            },
            "buckets": {
              "minItems": 1,
              "maxItems": 20,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "key": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 64,
                    "pattern": "^[a-z0-9_]+$"
                  },
                  "min": {
                    "type": "number"
                  },
                  "max": {
                    "type": "number"
                  },
                  "title": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 300
                  },
                  "body": {
                    "type": "string",
                    "maxLength": 2000
                  },
                  "redirect_url": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uri"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "key",
                  "title"
                ],
                "additionalProperties": false
              }
            }
          },
          "required": [
            "method",
            "points",
            "buckets"
          ],
          "additionalProperties": false
        },
        {
          "type": "null"
        }
      ]
    }
  },
  "required": [
    "schema_version",
    "title",
    "sections"
  ],
  "additionalProperties": false
}