{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/training_attempts.schema.json",
  "title": "tables/training_attempts.json",
  "description": "The rows of the table training_attempts that belong to the workspace, one object per row, keyed by the database's column names.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "organization_id": {
        "type": "string",
        "format": "uuid"
      },
      "personnel_id": {
        "type": "string",
        "format": "uuid"
      },
      "course_id": {
        "type": "string"
      },
      "course_version": {
        "type": "string"
      },
      "content_hash": {
        "type": "string"
      },
      "pass_percent": {
        "type": "integer"
      },
      "drawn": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "answers": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "correct": {
        "type": [
          "integer",
          "null"
        ]
      },
      "total": {
        "type": "integer"
      },
      "score": {
        "type": [
          "integer",
          "null"
        ]
      },
      "passed": {
        "type": [
          "boolean",
          "null"
        ]
      },
      "objectives": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "via": {
        "type": "string",
        "enum": [
          "member",
          "link"
        ]
      },
      "started_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "submitted_at": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "answers_purge_after": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      }
    },
    "required": [
      "id",
      "organization_id",
      "personnel_id",
      "course_id",
      "course_version",
      "content_hash",
      "pass_percent",
      "drawn",
      "answers",
      "correct",
      "total",
      "score",
      "passed",
      "objectives",
      "via",
      "started_at",
      "submitted_at",
      "answers_purge_after"
    ],
    "additionalProperties": false
  }
}
