{
  "openapi": "3.0.1",
  "info": {
    "title": "QuizMachine Quiz API",
    "description": "The public quiz-creation, question-editing, and Topics API (schema version 3).",
    "version": "v1"
  },
  "servers": [
    {
      "url": "/",
      "description": "Current host"
    }
  ],
  "paths": {
    "/api/v1/auth/token": {
      "post": {
        "tags": [
          "ApiToken"
        ],
        "summary": "Obtains a short-lived bearer token for API authentication.",
        "description": "Authenticates with account email and password, returning a short-lived JWT bearer token.\r\nSupports adaptive human verification via `humanVerificationToken`.\r\nRate-limited per IP and account; outages or locked challenges return 503 with `Retry-After`.",
        "operationId": "ApiToken_Token",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiTokenRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiTokenRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ApiTokenRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTokenResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTokenResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTokenResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/api/v1/media": {
      "post": {
        "tags": [
          "MediaApi"
        ],
        "summary": "Uploads an image file to the organization media library.",
        "description": "Requires `media:write`. Accepts multipart form data with image file up to 5 MB. Idempotent via\r\noptional `Idempotency-Key` header. Deduplicates identical files automatically.",
        "operationId": "MediaApi_Upload",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "File": {
                    "type": "string",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "File": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "media:write"
        ]
      },
      "get": {
        "tags": [
          "MediaApi"
        ],
        "summary": "Lists media assets in the caller's organization library.",
        "description": "Requires `quiz:read`. Supports pagination and optional search query across asset file names.",
        "operationId": "MediaApi_List",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetListApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetListApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetListApiResponse"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:read"
        ]
      }
    },
    "/api/v1/media/{id}": {
      "delete": {
        "tags": [
          "MediaApi"
        ],
        "summary": "Deletes an organization media asset nothing uses any more and returns its bytes to the\r\nstorage quota (issue #2080), answering with the deleted asset's metadata. Media still in use\r\nis refused with 409.",
        "description": "Requires `media:write`. Returns the deleted asset metadata. Assets currently referenced by any\r\nquiz question, feedback, option, or block return 409 Conflict.",
        "operationId": "MediaApi_Delete",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "media:write"
        ]
      },
      "get": {
        "tags": [
          "MediaApi"
        ],
        "summary": "Retrieves metadata for a single organization media asset.",
        "description": "Requires `quiz:read`. The media asset must belong to the caller's organization; returns 404\r\nif not found or belongs to another organization.",
        "operationId": "MediaApi_Get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/MediaAssetApiDto"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:read"
        ]
      }
    },
    "/api/v1/organization/members": {
      "get": {
        "tags": [
          "OrganizationMembersApi"
        ],
        "summary": "Lists the members of the caller's organization.",
        "description": "Requires `members:read`.",
        "operationId": "OrganizationMembersApi_GetMembers",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationMemberDto"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationMemberDto"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/OrganizationMemberDto"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "members:read"
        ]
      },
      "post": {
        "tags": [
          "OrganizationMembersApi"
        ],
        "summary": "Creates a managed learner member in the caller's organization.",
        "description": "Requires `members:write`.",
        "operationId": "OrganizationMembersApi_CreateMember",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemberApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemberApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateMemberApiRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedMemberApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedMemberApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedMemberApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "members:write"
        ]
      }
    },
    "/api/v1/organization/members/{id}/reset-password": {
      "post": {
        "tags": [
          "OrganizationMembersApi"
        ],
        "summary": "Resets a member's password or generates an invitation email.",
        "description": "Requires `members:write`.",
        "operationId": "OrganizationMembersApi_ResetPassword",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordApiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ResetPasswordApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetPasswordApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResetPasswordApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "members:write"
        ]
      }
    },
    "/api/v1/organization/members/{id}": {
      "delete": {
        "tags": [
          "OrganizationMembersApi"
        ],
        "summary": "Deletes a member from the caller's organization.",
        "description": "Requires `members:write`.",
        "operationId": "OrganizationMembersApi_DeleteMember",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "members:write"
        ]
      }
    },
    "/api/v1/organization/class-codes": {
      "get": {
        "tags": [
          "OrganizationMembersApi"
        ],
        "summary": "Lists active class codes for the caller's organization.",
        "description": "Requires `members:read`.",
        "operationId": "OrganizationMembersApi_GetClassCodes",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClassCodeItem"
                  }
                }
              },
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClassCodeItem"
                  }
                }
              },
              "text/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ClassCodeItem"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "members:read"
        ]
      },
      "post": {
        "tags": [
          "OrganizationMembersApi"
        ],
        "summary": "Creates a temporary class code for learners to join the organization.",
        "description": "Requires `members:write`.",
        "operationId": "OrganizationMembersApi_CreateClassCode",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClassCodeApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClassCodeApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClassCodeApiRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ClassCodeItem"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClassCodeItem"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClassCodeItem"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "members:write"
        ]
      }
    },
    "/api/v1/organization/class-codes/{code}": {
      "delete": {
        "tags": [
          "OrganizationMembersApi"
        ],
        "summary": "Revokes an active class code.",
        "description": "Requires `members:write`.",
        "operationId": "OrganizationMembersApi_RevokeClassCode",
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "members:write"
        ]
      }
    },
    "/api/v1/quizzes": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Creates a quiz from the same versioned JSON package produced by quiz export.",
        "description": "Requires `quiz:write`. When the package assigns topics via `topicIds` or `topicNames`,\r\n`topic:write` is also required. When embedded library media or Tiles images are included,\r\n`media:write` is required. Idempotent via optional `Idempotency-Key` header.",
        "operationId": "Quiz_Create",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuizExportPackage"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizWriteApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizWriteApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizWriteApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      },
      "get": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Lists the quizzes owned by the caller's organisation, newest change first. Quizzes owned by\r\nany other organisation are never returned, whichever member of this one is asking.",
        "description": "Requires `quiz:read`. Returns lightweight projections sorted newest change first. Quizzes owned by\r\nany other organisation are never returned.",
        "operationId": "Quiz_List",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          },
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "modified-desc"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizApiListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizApiListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizApiListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:read"
        ]
      }
    },
    "/api/v1/quizzes/{id}": {
      "get": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Returns one quiz as the current versioned package, byte-for-byte the shape\r\nM:QuizMachine.Web.Controllers.Api.V1.QuizCreationController.Create(QuizMachine.Core.DTOs.QuizExportPackage,System.Threading.CancellationToken,System.String) and M:QuizMachine.Web.Controllers.Api.V1.QuizCreationController.Replace(System.Guid,QuizMachine.Core.DTOs.QuizExportPackage,System.Threading.CancellationToken) accept, so fetch-edit-put round-trips.",
        "description": "Requires `quiz:read`. Only the quiz owner or RootAdmin may export the complete definition. Set\r\n`media=references` to omit embedded base64 image bytes and retain library asset IDs. The response\r\nincludes an `ETag` header containing the current quiz revision.",
        "operationId": "Quiz_Get",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "media",
            "in": "query",
            "description": "`embedded` (default) inlines every image as base64, matching M:QuizMachine.Web.Controllers.Api.V1.QuizCreationController.Create(QuizMachine.Core.DTOs.QuizExportPackage,System.Threading.CancellationToken,System.String) and\r\n            M:QuizMachine.Web.Controllers.Api.V1.QuizCreationController.Replace(System.Guid,QuizMachine.Core.DTOs.QuizExportPackage,System.Threading.CancellationToken)'s input shape. `references` (issue #1566) omits embedded image\r\n            bytes so a lightweight read does not pay for media it does not need; an image already\r\n            backed by an organization media asset still reports its `mediaAssetId`, but one that\r\n            only has embedded bytes reports neither — request `embedded` for those until a\r\n            dedicated media API exists.",
            "schema": {
              "enum": [
                "embedded",
                "references"
              ],
              "type": "string",
              "default": "embedded"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizExportPackage"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizExportPackage"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizExportPackage"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:read"
        ]
      },
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Replaces an existing quiz's definition with the supplied versioned package. The quiz keeps\r\nits id, owner, publication status, custom slug, AI provider configuration, paywall, folder,\r\nand collected responses — only the authored definition is replaced.",
        "description": "Requires `quiz:write`. Completely replaces an existing quiz's authored definition with the\r\nsupplied export package, overwriting all existing questions, options, media, and topic assignments.\r\nThe quiz keeps its ID, owner, publication status, and responses. Idempotent via optional `Idempotency-Key`.",
        "operationId": "Quiz_Replace",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuizExportPackage"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizWriteApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizWriteApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizWriteApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      },
      "patch": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Applies a JSON Merge Patch (RFC 7396) to quiz-level settings without touching child questions,\r\noptions, blocks, pages, or IDs (issue #2426). Requires `If-Match` naming the quiz revision last read;\r\na stale value fails with `412`.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header naming\r\nthe quiz revision last read; a stale value fails with 412. Omitted properties retain their current value.",
        "operationId": "Quiz_PatchQuiz",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/QuizMergePatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{id}/status": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Publishes or closes a quiz after applying the same entitlement gates as the editor.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.\r\nReturns the updated status and revision.",
        "operationId": "Quiz_SetStatus",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuizStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizStatusApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizStatusApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizStatusApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{id}/slug": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Sets and normalizes a quiz's globally unique custom link.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.\r\nThe custom slug must be globally unique across all organizations.",
        "operationId": "Quiz_SetSlug",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuizSlugRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizSlugApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizSlugApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizSlugApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      },
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Clears a quiz's custom link and returns its GUID-based take URL.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.\r\nReverts the share URL to the default GUID-based link.",
        "operationId": "Quiz_ClearSlug",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizSlugApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizSlugApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizSlugApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Adds one question without replacing existing questions or their child ids.",
        "description": "Requires `quiz:write`. If `topicIds` or `topicNames` are specified, `topic:write` is also\r\nrequired. Enforces optimistic concurrency via the required `If-Match` header. Set `newPage: true`\r\nto append or insert a page atomically.",
        "operationId": "Quiz_CreateQuestion",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuizExportQuestionDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/pages": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Appends a page, or inserts one and shifts all later page content atomically.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.",
        "operationId": "Quiz_CreatePage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateQuizPageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPageApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPageApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPageApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/pages/{pageNumber}": {
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Deletes an empty page; deleteContents=true explicitly removes its content too.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.\r\nNon-empty pages return 400 unless `deleteContents=true` is sent.",
        "operationId": "Quiz_DeletePage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pageNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "deleteContents",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPageApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPageApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizPageApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}": {
      "patch": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Applies a JSON Merge Patch (RFC 7396) to shared scalar fields and the documented\r\nFreeText/DiagramUpload, Code, and Math AI-evaluation configuration fields, without touching\r\nthe question's id, options, images, topics, or page placement (issues #1566 and #1911).\r\nRequires `If-Match` naming the quiz revision the caller last read; a stale value fails\r\nwith `412` rather than silently overwriting a concurrent change.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.\r\nOnly specified properties are updated; omitted properties retain their current values.",
        "operationId": "Quiz_PatchQuestion",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/QuestionMergePatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      },
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Deletes a single question from a quiz using optimistic concurrency (issue #2605). Requires If-Match.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header\r\n(412 Precondition Failed if stale). Cascades removal to child options, images, and topic assignments.\r\nReturns QuizMachine.Core.DTOs.DeleteQuestionApiResponse with the bumped revision ETag.",
        "operationId": "Quiz_DeleteQuestion",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteQuestionApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteQuestionApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteQuestionApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/options/{optionId}": {
      "patch": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Applies a JSON Merge Patch to an existing option while preserving its stable id. For\r\nMatchingText options, `hint` sets the optional answer-box placeholder and\r\n`hint: null` clears it. Hints are rejected for all other question types.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.\r\nPass `null` to clear `hint` or `overridePoints`.",
        "operationId": "Quiz_PatchOption",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "optionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/OptionMergePatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/topics": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Atomically replaces a question's ordinary Question-Bank topic assignment (issue #1566) —\r\ndistinct from `RandomSourceTopicId`, which names the pool a `RandomFromTopic`\r\nselector draws from. Requires `If-Match`, exactly like M:QuizMachine.Web.Controllers.Api.V1.QuizCreationController.PatchQuestion(System.Guid,System.Guid,System.Threading.CancellationToken).",
        "description": "Requires `quiz:write` and `topic:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. All existing topic assignments for the question are replaced with the provided list.",
        "operationId": "Quiz_ReplaceQuestionTopics",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceQuestionTopicsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionTopicsApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionTopicsApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionTopicsApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "topic:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/images": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Attaches a media asset image to a question.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header.",
        "operationId": "Quiz_AttachQuestionImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachQuestionImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/images/{imageId}": {
      "patch": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Updates an existing question image's alignment or alt text.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header.",
        "operationId": "Quiz_UpdateQuestionImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateQuestionImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      },
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Removes an attached image from a question.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. Detaches the image from the question without deleting the underlying media asset.",
        "operationId": "Quiz_DetachQuestionImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/images/order": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Reorders all images attached to a question.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. The request must supply all existing image IDs for the question in their new order.",
        "operationId": "Quiz_ReorderQuestionImages",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderQuestionImagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/feedback-images": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Attaches an image to a question's post-answer feedback explanation.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header.",
        "operationId": "Quiz_AttachFeedbackImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AttachFeedbackImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/feedback-images/{imageId}": {
      "patch": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Updates an existing feedback image's alignment or alt text.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header.",
        "operationId": "Quiz_UpdateFeedbackImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFeedbackImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      },
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Removes an attached feedback image from a question.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. Detaches the image without deleting the underlying media asset.",
        "operationId": "Quiz_DetachFeedbackImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "imageId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/feedback-images/order": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Reorders all feedback images on a question.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. The request must supply all existing feedback image IDs in their new order.",
        "operationId": "Quiz_ReorderFeedbackImages",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReorderFeedbackImagesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionFeedbackImagesApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/options/{optionId}/image": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Sets one answer option's image from the media library. `side` (\"left\"/\"right\") is\r\nrequired for a `Matching` option and must be omitted for every other type — see\r\n`OptionImagePlacementPolicy` for the full matrix, enforced identically here and in\r\nthe batch `setOptionImage` operation.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. For `Matching` questions, `side` (\"left\" or \"right\") is required.",
        "operationId": "Quiz_SetOptionImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "optionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetOptionImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      },
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Removes an option's image.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. For `Matching` questions, pass `side` to identify which side's image to remove.",
        "operationId": "Quiz_DetachOptionImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "optionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "side",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/questions/{questionId}/diagram-reference-image": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Sets or replaces a diagram question's reference solution image.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. Supported only for `DiagramUpload` questions.",
        "operationId": "Quiz_SetDiagramReferenceImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetDiagramReferenceImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      },
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Removes a diagram question's reference solution image.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. Supported only for `DiagramUpload` questions.",
        "operationId": "Quiz_DetachDiagramReferenceImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "questionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuestionPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/text-media-blocks/{blockId}/image": {
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Sets or replaces an image on a text/media canvas block.",
        "description": "Requires `quiz:write` and `media:write`. Enforces optimistic concurrency via the required\r\n`If-Match` header. Supported only for `Image` blocks.",
        "operationId": "Quiz_SetBlockImage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetBlockImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockImageApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockImageApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockImageApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write",
          "media:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/operations": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Executes up to 50 ordered granular operations under one quiz lock and transaction. A\r\nsuccessful non-dry-run batch advances the quiz revision exactly once. Repeating the same\r\nrequest and Idempotency-Key returns the stored response without applying it again.",
        "description": "Requires `quiz:write`. If any operation in the batch mutates topics or media, `topic:write`\r\nor `media:write` is also required. Enforces optimistic concurrency via `If-Match`.\r\nRequires `Idempotency-Key` header for mutating batches (`dryRun=false`, the default).",
        "operationId": "Quiz_ExecuteOperations",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "dryRun",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "description": "Caller-generated key required for a mutating batch (dryRun=false, the default); validation-only dry runs do not consume it.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuizBatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted revision represented by this batch response. An idempotent replay can return a historical revision; fetch the quiz before a subsequent write.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ],
        "x-operation-scopes": {
          "replaceTopics": [
            "topic:write"
          ],
          "createQuestion": [
            "topic:write"
          ],
          "attachImage": [
            "media:write"
          ],
          "updateImage": [
            "media:write"
          ],
          "reorderImages": [
            "media:write"
          ],
          "detachImage": [
            "media:write"
          ],
          "attachFeedbackImage": [
            "media:write"
          ],
          "updateFeedbackImage": [
            "media:write"
          ],
          "reorderFeedbackImages": [
            "media:write"
          ],
          "detachFeedbackImage": [
            "media:write"
          ],
          "setOptionImage": [
            "media:write"
          ],
          "setDiagramReferenceImage": [
            "media:write"
          ],
          "createBlock": [
            "media:write"
          ],
          "patchBlock": [
            "media:write"
          ]
        }
      }
    },
    "/api/v1/quizzes/{quizId}/validate": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Runs the same validators and ordered in-memory mutations as the batch endpoint, but never\r\nsaves, commits, advances the revision, or consumes an idempotency key.",
        "description": "Requires `quiz:write`. Dry-run validation against the current quiz revision specified in `If-Match`.\r\nDoes not require or consume an idempotency key.",
        "operationId": "Quiz_ValidateOperations",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/QuizBatchRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizValidationResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizValidationResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizValidationResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuizBatchResponse"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ],
        "x-operation-scopes": {
          "replaceTopics": [
            "topic:write"
          ],
          "createQuestion": [
            "topic:write"
          ],
          "attachImage": [
            "media:write"
          ],
          "updateImage": [
            "media:write"
          ],
          "reorderImages": [
            "media:write"
          ],
          "detachImage": [
            "media:write"
          ],
          "attachFeedbackImage": [
            "media:write"
          ],
          "updateFeedbackImage": [
            "media:write"
          ],
          "reorderFeedbackImages": [
            "media:write"
          ],
          "detachFeedbackImage": [
            "media:write"
          ],
          "setOptionImage": [
            "media:write"
          ],
          "setDiagramReferenceImage": [
            "media:write"
          ],
          "createBlock": [
            "media:write"
          ],
          "patchBlock": [
            "media:write"
          ]
        }
      }
    },
    "/api/v1/quizzes/{quizId}/pages/{pageNumber}/order": {
      "get": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Retrieves the display order of questions and text/media blocks on a page.",
        "description": "Requires `quiz:read`. Returns the ordered list of items on the page with their stable IDs and types.",
        "operationId": "Quiz_GetPageOrder",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pageNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PageItemOrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageItemOrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageItemOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:read"
        ]
      },
      "put": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Reorders questions and text/media blocks on a page.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.\r\nThe request must contain all current item IDs on the page.",
        "operationId": "Quiz_ReorderPage",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "pageNumber",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PageItemOrderRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PageItemOrderResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageItemOrderResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/PageItemOrderResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/text-media-blocks": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Creates a text or media canvas block on a page.",
        "description": "Requires `quiz:write`, and `media:write` if creating an `Image` block. Enforces\r\noptimistic concurrency via the required `If-Match` header.",
        "operationId": "Quiz_CreateTextMediaBlock",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTextMediaBlockRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/text-media-blocks/{blockId}": {
      "patch": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Updates a text or media block using JSON Merge Patch.",
        "description": "Requires `quiz:write`, and `media:write` if patching `mediaAssetId`. Enforces\r\noptimistic concurrency via the required `If-Match` header.",
        "operationId": "Quiz_PatchTextMediaBlock",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/TextMediaBlockMergePatchRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TextMediaBlockApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      },
      "delete": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Deletes a text or media block from a quiz.",
        "description": "Requires `quiz:write`. Enforces optimistic concurrency via the required `If-Match` header.",
        "operationId": "Quiz_DeleteTextMediaBlock",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "blockId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Quoted quiz revision from the latest ETag response, for example \"3\".",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "ETag": {
                "description": "Quoted current quiz revision for a subsequent If-Match header.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteTextMediaBlockApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteTextMediaBlockApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeleteTextMediaBlockApiResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "412": {
            "description": "Precondition Failed",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/text-media-blocks/latex-preview": {
      "post": {
        "tags": [
          "QuizCreation"
        ],
        "summary": "Renders a preview of a LaTeX article block.",
        "description": "Requires `quiz:write`. Generates PNG page images or a compiled PDF from LaTeX source. Format can\r\nbe specified via query parameter `format=images` (default) or `format=pdf`.",
        "operationId": "Quiz_PreviewLatexArticle",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "format",
            "in": "query",
            "schema": {
              "type": "string",
              "default": "images"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LatexArticlePreviewRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "byte"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Content",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "quiz:write"
        ]
      }
    },
    "/api/v1/topics": {
      "get": {
        "tags": [
          "TopicsApi"
        ],
        "summary": "Lists (optionally, substring-searches) the caller's organisation's Topics.",
        "description": "Requires `topic:read`. Supports pagination and case-insensitive substring search across topic names.",
        "operationId": "TopicsApi_List",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "pageSize",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TopicApiListResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopicApiListResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopicApiListResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "topic:read"
        ]
      },
      "post": {
        "tags": [
          "TopicsApi"
        ],
        "summary": "Creates a Topic in the caller's organisation.",
        "description": "Requires `topic:write`. Topic names are trimmed and normalized; duplicate names within the organization return 409 Conflict.",
        "operationId": "TopicsApi_Create",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTopicApiRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TopicApiDto"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopicApiDto"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TopicApiDto"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "topic:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/assignments": {
      "get": {
        "tags": [
          "TrainingAssignmentsApi"
        ],
        "summary": "Lists training assignments for a quiz in the caller's organization.",
        "description": "Requires `training:read`.",
        "operationId": "TrainingAssignmentsApi_GetAssignments",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32",
              "default": 1
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentsListApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentsListApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentsListApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "training:read"
        ]
      },
      "post": {
        "tags": [
          "TrainingAssignmentsApi"
        ],
        "summary": "Assigns training to internal users/groups, external logins, and/or email invitees.",
        "description": "Requires `training:write`.",
        "operationId": "TrainingAssignmentsApi_CreateAssignments",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentsCreateApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentsCreateApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentsCreateApiRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentsCreateApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentsCreateApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentsCreateApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "training:write"
        ]
      }
    },
    "/api/v1/quizzes/{quizId}/assignments/{assignmentId}": {
      "patch": {
        "tags": [
          "TrainingAssignmentsApi"
        ],
        "summary": "Updates due date and expiration settings for an active training assignment.",
        "description": "Requires `training:write`.",
        "operationId": "TrainingAssignmentsApi_PatchAssignment",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "assignmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentPatchApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentPatchApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/TrainingAssignmentPatchApiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentPatchApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentPatchApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/TrainingAssignmentPatchApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "training:write"
        ]
      },
      "delete": {
        "tags": [
          "TrainingAssignmentsApi"
        ],
        "summary": "Revokes an active training assignment.",
        "description": "Requires `training:write`.",
        "operationId": "TrainingAssignmentsApi_RevokeAssignment",
        "parameters": [
          {
            "name": "quizId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "assignmentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "training:write"
        ]
      }
    },
    "/api/v1/logins/check": {
      "post": {
        "tags": [
          "TrainingAssignmentsApi"
        ],
        "summary": "Checks whether an external user exists by exact login without disclosing sensitive data.",
        "description": "Requires `training:read` or `training:write`.",
        "operationId": "TrainingAssignmentsApi_CheckLogin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckLoginApiRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckLoginApiRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/CheckLoginApiRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/CheckLoginApiResponse"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckLoginApiResponse"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/CheckLoginApiResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        },
        "x-required-scopes": [
          "training:read",
          "training:write"
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "ApiTokenRequest": {
        "required": [
          "email",
          "password"
        ],
        "type": "object",
        "properties": {
          "email": {
            "maxLength": 320,
            "minLength": 1,
            "type": "string",
            "description": "The account email address.",
            "format": "email"
          },
          "password": {
            "maxLength": 1024,
            "minLength": 1,
            "type": "string",
            "description": "The account password."
          },
          "humanVerificationToken": {
            "maxLength": 2048,
            "type": "string",
            "description": "Optional Cloudflare Turnstile token when adaptive human verification is required.",
            "nullable": true
          },
          "scopes": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Optional requested scopes, for example [\"quiz:read\", \"quiz:write\"].",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ApiTokenResponse": {
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string",
            "description": "The short-lived JWT bearer token.",
            "nullable": true
          },
          "token_type": {
            "type": "string",
            "description": "Token type, always 'Bearer'.",
            "nullable": true
          },
          "expires_in": {
            "type": "integer",
            "description": "Token validity lifetime in seconds.",
            "format": "int64"
          },
          "scope": {
            "type": "string",
            "description": "Space-delimited list of granted scopes.",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AttachFeedbackImageRequest": {
        "type": "object",
        "properties": {
          "mediaAssetId": {
            "type": "string",
            "format": "uuid"
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Body used to attach an organization media asset to a question's feedback text."
      },
      "AttachQuestionImageRequest": {
        "type": "object",
        "properties": {
          "mediaAssetId": {
            "type": "string",
            "format": "uuid"
          },
          "alignment": {
            "enum": [
              "Left",
              "Center",
              "Right"
            ],
            "type": "string",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Body used to attach an organization media asset to a question."
      },
      "CheckLoginApiRequest": {
        "type": "object",
        "properties": {
          "login": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CheckLoginApiResponse": {
        "type": "object",
        "properties": {
          "exists": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "ClassCodeItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "organizationId": {
            "type": "string",
            "format": "uuid"
          },
          "groupId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "createdAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "isRevoked": {
            "type": "boolean"
          },
          "createdByUserId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "CreateClassCodeApiRequest": {
        "type": "object",
        "properties": {
          "groupId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "durationMinutes": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "CreateImageBlockRequest": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "newPage": {
            "type": "boolean"
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "blockType": {
            "type": "string",
            "nullable": true
          },
          "textContent": {
            "type": "string",
            "nullable": true
          },
          "textAllowMarkdown": {
            "type": "boolean"
          },
          "isHeader": {
            "type": "boolean"
          },
          "mediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "youTubeVideoId": {
            "type": "string",
            "nullable": true
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "presentation": {
            "type": "string",
            "nullable": true
          },
          "tone": {
            "type": "string",
            "nullable": true
          },
          "joinWithPrevious": {
            "type": "boolean"
          },
          "isIntroImage": {
            "type": "boolean"
          },
          "layoutColumns": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "OpenAPI variant for an Image block."
      },
      "CreateLatexArticleBlockRequest": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "newPage": {
            "type": "boolean"
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "blockType": {
            "type": "string",
            "nullable": true
          },
          "textContent": {
            "maxLength": 4000,
            "type": "string",
            "nullable": true
          },
          "textAllowMarkdown": {
            "type": "boolean"
          },
          "isHeader": {
            "type": "boolean"
          },
          "mediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "youTubeVideoId": {
            "type": "string",
            "nullable": true
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "presentation": {
            "type": "string",
            "nullable": true
          },
          "tone": {
            "type": "string",
            "nullable": true
          },
          "joinWithPrevious": {
            "type": "boolean"
          },
          "isIntroImage": {
            "type": "boolean"
          },
          "layoutColumns": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "OpenAPI variant for a LaTeX article block."
      },
      "CreateMemberApiRequest": {
        "type": "object",
        "properties": {
          "username": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "passwordMode": {
            "type": "string",
            "nullable": true
          },
          "isMinor": {
            "type": "boolean"
          },
          "groupId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "CreateMermaidBlockRequest": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "newPage": {
            "type": "boolean"
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "blockType": {
            "type": "string",
            "nullable": true
          },
          "textContent": {
            "type": "string",
            "nullable": true
          },
          "textAllowMarkdown": {
            "type": "boolean"
          },
          "isHeader": {
            "type": "boolean"
          },
          "mediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "youTubeVideoId": {
            "type": "string",
            "nullable": true
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "presentation": {
            "type": "string",
            "nullable": true
          },
          "tone": {
            "type": "string",
            "nullable": true
          },
          "joinWithPrevious": {
            "type": "boolean"
          },
          "isIntroImage": {
            "type": "boolean"
          },
          "layoutColumns": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "OpenAPI variant for a Mermaid block."
      },
      "CreateQuizPageRequest": {
        "type": "object",
        "properties": {
          "position": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "timeLimitSeconds": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Body of `POST /api/v1/quizzes/{quizId}/pages`."
      },
      "CreateTextBlockRequest": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "newPage": {
            "type": "boolean"
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "blockType": {
            "type": "string",
            "nullable": true
          },
          "textContent": {
            "type": "string",
            "nullable": true
          },
          "textAllowMarkdown": {
            "type": "boolean"
          },
          "isHeader": {
            "type": "boolean"
          },
          "mediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "youTubeVideoId": {
            "type": "string",
            "nullable": true
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "presentation": {
            "type": "string",
            "nullable": true
          },
          "tone": {
            "type": "string",
            "nullable": true
          },
          "joinWithPrevious": {
            "type": "boolean"
          },
          "isIntroImage": {
            "type": "boolean"
          },
          "layoutColumns": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "OpenAPI variant for a Text block."
      },
      "CreateTextMediaBlockRequest": {
        "type": "object",
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateTextBlockRequest"
          },
          {
            "$ref": "#/components/schemas/CreateImageBlockRequest"
          },
          {
            "$ref": "#/components/schemas/CreateYouTubeBlockRequest"
          },
          {
            "$ref": "#/components/schemas/CreateMermaidBlockRequest"
          },
          {
            "$ref": "#/components/schemas/CreateLatexArticleBlockRequest"
          }
        ],
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "newPage": {
            "type": "boolean"
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "blockType": {
            "enum": [
              "Text",
              "Image",
              "YouTube",
              "Mermaid",
              "LatexArticle"
            ],
            "type": "string",
            "nullable": true
          },
          "textContent": {
            "type": "string",
            "nullable": true
          },
          "textAllowMarkdown": {
            "type": "boolean"
          },
          "isHeader": {
            "type": "boolean"
          },
          "mediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "youTubeVideoId": {
            "type": "string",
            "nullable": true
          },
          "alignment": {
            "enum": [
              "Left",
              "Center",
              "Right"
            ],
            "type": "string",
            "nullable": true
          },
          "presentation": {
            "type": "string",
            "nullable": true
          },
          "tone": {
            "type": "string",
            "nullable": true
          },
          "joinWithPrevious": {
            "type": "boolean"
          },
          "isIntroImage": {
            "type": "boolean"
          },
          "layoutColumns": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Base contract for a granular canvas block creation.",
        "discriminator": {
          "propertyName": "blockType",
          "mapping": {
            "Text": "#/components/schemas/CreateTextBlockRequest",
            "Image": "#/components/schemas/CreateImageBlockRequest",
            "YouTube": "#/components/schemas/CreateYouTubeBlockRequest",
            "Mermaid": "#/components/schemas/CreateMermaidBlockRequest",
            "LatexArticle": "#/components/schemas/CreateLatexArticleBlockRequest"
          }
        }
      },
      "CreateTopicApiRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Body of `POST /api/v1/topics`."
      },
      "CreateYouTubeBlockRequest": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "newPage": {
            "type": "boolean"
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "blockType": {
            "type": "string",
            "nullable": true
          },
          "textContent": {
            "type": "string",
            "nullable": true
          },
          "textAllowMarkdown": {
            "type": "boolean"
          },
          "isHeader": {
            "type": "boolean"
          },
          "mediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "youTubeVideoId": {
            "type": "string",
            "nullable": true
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "presentation": {
            "type": "string",
            "nullable": true
          },
          "tone": {
            "type": "string",
            "nullable": true
          },
          "joinWithPrevious": {
            "type": "boolean"
          },
          "isIntroImage": {
            "type": "boolean"
          },
          "layoutColumns": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "OpenAPI variant for a YouTube block."
      },
      "CreatedMemberApiResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid"
          },
          "username": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "temporaryPassword": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "DeleteQuestionApiResponse": {
        "type": "object",
        "properties": {
          "questionId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Response of question delete operation."
      },
      "DeleteTextMediaBlockApiResponse": {
        "type": "object",
        "properties": {
          "blockId": {
            "type": "string",
            "format": "uuid"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "JsonNode": {
        "type": "object",
        "properties": {
          "options": {
            "$ref": "#/components/schemas/JsonNodeOptions"
          },
          "parent": {
            "$ref": "#/components/schemas/JsonNode"
          },
          "root": {
            "$ref": "#/components/schemas/JsonNode"
          }
        },
        "additionalProperties": false
      },
      "JsonNodeOptions": {
        "type": "object",
        "properties": {
          "propertyNameCaseInsensitive": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "LatexArticlePreviewRequest": {
        "type": "object",
        "properties": {
          "textContent": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "MediaAssetApiDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "mimeType": {
            "type": "string",
            "nullable": true
          },
          "sizeBytes": {
            "type": "integer",
            "description": "Null for legacy content whose stored size is not yet known.",
            "format": "int64",
            "nullable": true
          },
          "sha256": {
            "type": "string",
            "nullable": true
          },
          "originalFileName": {
            "type": "string",
            "nullable": true
          },
          "createdAtUtc": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Organization-scoped reusable media metadata; binary content is never returned here."
      },
      "MediaAssetListApiResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MediaAssetApiDto"
            },
            "nullable": true
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "OptionMergePatchRequest": {
        "type": "object",
        "properties": {
          "text": {
            "maxLength": 1000,
            "type": "string",
            "example": "[\"Norway\",\"Oslo\"]"
          },
          "hint": {
            "maxLength": 150,
            "type": "string",
            "nullable": true,
            "example": "Capital city"
          },
          "isCorrect": {
            "type": "boolean"
          },
          "overridePoints": {
            "type": "number",
            "format": "double",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Machine-readable shape of the JSON Merge Patch accepted by the option patch endpoint.\r\nEvery property is optional; `null` clears QuizMachine.Core.DTOs.OptionMergePatchRequest.Hint or\r\nQuizMachine.Core.DTOs.OptionMergePatchRequest.OverridePoints."
      },
      "OrganizationMemberDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "userId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "username": {
            "type": "string",
            "nullable": true
          },
          "displayName": {
            "type": "string",
            "nullable": true
          },
          "email": {
            "type": "string",
            "nullable": true
          },
          "isSuspended": {
            "type": "boolean"
          },
          "createdAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "lastLoginAtUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "PageItemOrderEntry": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "nullable": true
          },
          "id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false,
        "description": "A question or text/media block in the explicit visual order of a quiz page."
      },
      "PageItemOrderRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageItemOrderEntry"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "The complete ordered item list for one quiz page."
      },
      "PageItemOrderResponse": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageItemOrderEntry"
            },
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "nullable": true
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "detail": {
            "type": "string",
            "nullable": true
          },
          "instance": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": { }
      },
      "QuestionFeedbackImagesApiResponse": {
        "type": "object",
        "properties": {
          "questionId": {
            "type": "string",
            "format": "uuid"
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportQuestionImageDto"
            },
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Response shared by feedback-image attach, update, reorder, and detach operations."
      },
      "QuestionImagesApiResponse": {
        "type": "object",
        "properties": {
          "questionId": {
            "type": "string",
            "format": "uuid"
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportQuestionImageDto"
            },
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Response shared by question-image attach, update, reorder, and detach operations."
      },
      "QuestionMergePatchRequest": {
        "type": "object",
        "properties": {
          "body": {
            "maxLength": 65536,
            "type": "string",
            "description": "Question prompt HTML or Markdown source. Limited to 65,536 characters."
          },
          "bodyAllowMarkdown": {
            "type": "boolean"
          },
          "points": {
            "type": "number",
            "format": "double"
          },
          "isRequired": {
            "type": "boolean"
          },
          "isDisabled": {
            "type": "boolean"
          },
          "randomizeOptions": {
            "type": "boolean"
          },
          "allowNegativeScore": {
            "type": "boolean",
            "description": "Allows negative scoring. Supported only for MultipleChoice questions; rejected with 400 for other question types."
          },
          "difficulty": {
            "type": "integer",
            "format": "int32"
          },
          "caseSensitiveMatch": {
            "type": "boolean",
            "description": "Requires exact case matching. Supported for FillInTheBlanks and text match questions."
          },
          "matchingImmediateFeedback": {
            "type": "boolean",
            "description": "Legacy alias for immediateFeedback. Supported only for Matching, MatchingText, FillInTheBlanks, PictureChoice, Math, and HierarchyGraph questions; rejected with 400 for other question types.",
            "example": true
          },
          "immediateFeedback": {
            "type": "boolean",
            "description": "Enables immediate feedback before submission. Supported only for Matching, MatchingText, FillInTheBlanks, PictureChoice, Math, and HierarchyGraph questions; rejected with 400 for other question types."
          },
          "immediateFeedbackMaxAttempts": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "description": "Maximum attempts for immediate feedback (1 to 3, or null to clear). Supported only for Math and HierarchyGraph questions; rejected with 400 for other question types.",
            "format": "int32",
            "nullable": true
          },
          "showFeedback": {
            "type": "boolean"
          },
          "feedbackText": {
            "maxLength": 65536,
            "type": "string",
            "description": "Explanation shown after question completion. Limited to 65,536 characters.",
            "example": "The best move maximizes the minimum score.\n\n```mermaid\nflowchart TD\n    A[Your move] --> B[Opponent response]\n```"
          },
          "feedbackAllowMarkdown": {
            "type": "boolean",
            "example": true
          },
          "aiEvaluationEnabled": {
            "type": "boolean",
            "description": "Enables AI evaluation. Supported only for FreeText and DiagramUpload questions; rejected with 400 for other question types.",
            "example": true
          },
          "modelAnswer": {
            "type": "string",
            "description": "Model answer for AI evaluation. Supported only for FreeText and DiagramUpload questions; rejected with 400 for other question types.",
            "example": "Expected answer"
          },
          "rubric": {
            "type": "string",
            "description": "Evaluation rubric. Supported only for FreeText, DiagramUpload, and Code questions; rejected with 400 for other question types.",
            "example": "Key concepts and reasoning"
          },
          "aiOnlyCodeEvaluation": {
            "type": "boolean",
            "description": "Enables AI-only code evaluation. Supported only for Code questions; rejected with 400 for other question types."
          },
          "codeStarterCode": {
            "maxLength": 16000,
            "type": "string",
            "description": "Starter code for code questions. Supported only for Code questions; rejected with 400 for other question types."
          },
          "codeReferenceSolution": {
            "maxLength": 16000,
            "type": "string",
            "description": "Reference solution for code questions. Supported only for Code questions; rejected with 400 for other question types.",
            "example": "return result;"
          },
          "codeTestCasesJson": {
            "maxLength": 16000,
            "type": "string",
            "description": "Test cases JSON for code questions. Supported only for Code questions; rejected with 400 for other question types."
          },
          "mathWorkingAiFeedbackEnabled": {
            "type": "boolean",
            "description": "Enables AI feedback on math working. Supported only for Math questions; rejected with 400 for other question types."
          },
          "mathExpectedWorking": {
            "maxLength": 12000,
            "type": "string",
            "description": "Expected working steps. Supported only for Math questions; rejected with 400 for other question types.",
            "example": "1 + 1 = 2"
          },
          "mathWorkingRubric": {
            "maxLength": 6000,
            "type": "string",
            "description": "Rubric for math working evaluation. Supported only for Math questions; rejected with 400 for other question types."
          },
          "childPictureChoiceResponseMode": {
            "type": "string",
            "description": "Response mode ('Assessment' or 'GuidedPractice'). Supported only for ChildPictureChoice questions; rejected with 400 for other question types."
          },
          "childPictureChoiceMaxAttempts": {
            "minimum": 1,
            "type": "integer",
            "description": "Maximum attempts for ChildPictureChoice questions. Supported only for ChildPictureChoice questions; rejected with 400 for other question types.",
            "format": "int32"
          },
          "tilesShuffleDepth": {
            "type": "integer",
            "description": "Shuffle depth for Tiles questions. Supported only for Tiles questions; rejected with 400 for other question types.",
            "format": "int32"
          },
          "tilesMaximumMoves": {
            "type": "integer",
            "description": "Maximum allowed moves for Tiles questions (or null for unlimited). Supported only for Tiles questions; rejected with 400 for other question types.",
            "format": "int32",
            "nullable": true
          },
          "tilesConfigurationVersion": {
            "type": "integer",
            "description": "Configuration version for Tiles questions. Supported only for Tiles questions; rejected with 400 for other question types.",
            "format": "int32"
          },
          "tilesEngineVersion": {
            "type": "integer",
            "description": "Engine version for Tiles questions. Supported only for Tiles questions; rejected with 400 for other question types.",
            "format": "int32"
          },
          "graphSearchDraftJson": {
            "type": "string",
            "description": "Draft graph search trace in serialized JSON form. GraphSearchTrace uses the legacy graph draft; GraphSearchTraceV2 requires interactionVersion=2, graph, immediateFeedback (default false), and maxAttemptsPerDecision (default 2, range 1-3). Points are server-owned. Rejected with 400 for other question types."
          }
        },
        "additionalProperties": false,
        "description": "Machine-readable shape of the JSON Merge Patch accepted by the question patch endpoint.\r\nEvery property is optional; omitted properties keep their current value."
      },
      "QuestionPatchApiResponse": {
        "type": "object",
        "properties": {
          "question": {
            "$ref": "#/components/schemas/QuizExportQuestionDto"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Response of question create and scalar patch operations."
      },
      "QuestionTopicsApiResponse": {
        "type": "object",
        "properties": {
          "questionId": {
            "type": "string",
            "format": "uuid"
          },
          "topicIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Response of `PATCH .../questions/{id}` and the topics-replace endpoint."
      },
      "QuizApiListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizApiSummaryDto"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "One page of quiz summaries plus the metadata a client needs to walk the rest."
      },
      "QuizApiSummaryDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "ownerId": {
            "type": "string",
            "format": "uuid"
          },
          "pageCount": {
            "type": "integer",
            "format": "int32"
          },
          "responseCount": {
            "type": "integer",
            "format": "int32"
          },
          "requiresLogin": {
            "type": "boolean"
          },
          "slug": {
            "type": "string",
            "nullable": true
          },
          "createdAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "modifiedAtUtc": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "Lightweight quiz projection returned by the public quiz API's list endpoint (issue #842).\r\nDeliberately excludes questions and embedded media: listing is a directory of what the\r\norganisation owns, and the full current-version package is fetched one quiz at a time."
      },
      "QuizBatchOperationRequest": {
        "type": "object",
        "properties": {
          "type": {
            "enum": [
              "patchQuestion",
              "replaceTopics",
              "attachImage",
              "updateImage",
              "reorderImages",
              "detachImage",
              "attachFeedbackImage",
              "updateFeedbackImage",
              "reorderFeedbackImages",
              "detachFeedbackImage",
              "setOptionImage",
              "setDiagramReferenceImage",
              "addPage",
              "createQuestion",
              "createBlock",
              "patchBlock",
              "deleteBlock",
              "reorderPage",
              "patchQuiz"
            ],
            "type": "string",
            "nullable": true
          },
          "questionId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "blockId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "imageId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "mediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "patch": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/JsonNode"
            },
            "nullable": true
          },
          "topicIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "imageIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "position": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PageItemOrderEntry"
            },
            "nullable": true
          },
          "pageType": {
            "type": "string",
            "nullable": true
          },
          "timeLimitSeconds": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "question": {
            "$ref": "#/components/schemas/QuizExportQuestionDto"
          },
          "block": {
            "$ref": "#/components/schemas/CreateTextMediaBlockRequest"
          },
          "optionId": {
            "type": "string",
            "description": "The option `setOptionImage` targets.",
            "format": "uuid",
            "nullable": true
          },
          "side": {
            "type": "string",
            "description": "\"left\" or \"right\"; required for a Matching option's `setOptionImage`, omitted for every other type.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "One operation in a quiz batch. Only fields used by QuizMachine.Core.DTOs.QuizBatchOperationRequest.Type are accepted; the\r\nservice reports unused or missing fields with stable JSON paths."
      },
      "QuizBatchOperationResult": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "imageId": {
            "type": "string",
            "description": "The stable image ID created by an attachImage operation.",
            "format": "uuid",
            "nullable": true
          },
          "questionId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "blockId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizBatchRequest": {
        "type": "object",
        "properties": {
          "operations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizBatchOperationRequest"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Ordered granular operations submitted to the issue #1577 batch workflow."
      },
      "QuizBatchResponse": {
        "type": "object",
        "properties": {
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "dryRun": {
            "type": "boolean"
          },
          "replayed": {
            "type": "boolean"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizBatchOperationResult"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizBatchValidationError"
            },
            "nullable": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizBatchValidationWarning"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizBatchValidationError": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "path": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizBatchValidationWarning": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "nullable": true
          },
          "path": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizExportAiProviderProfileDto": {
        "type": "object",
        "properties": {
          "providerType": {
            "type": "string",
            "nullable": true
          },
          "modelId": {
            "type": "string",
            "nullable": true
          },
          "endpointUrl": {
            "type": "string",
            "nullable": true
          },
          "priority": {
            "type": "integer",
            "format": "int32"
          },
          "isEnabled": {
            "type": "boolean"
          },
          "configurationVersion": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Non-secret AI provider metadata. API keys are deliberately never part of an export package."
      },
      "QuizExportDto": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "welcomeMessage": {
            "type": "string",
            "nullable": true
          },
          "passingScorePercent": {
            "type": "integer",
            "format": "int32"
          },
          "showFeedbackToTakers": {
            "type": "boolean"
          },
          "randomizeQuestionOrder": {
            "type": "boolean"
          },
          "allowMultipleAttempts": {
            "type": "boolean"
          },
          "retakeOnlyIfFailed": {
            "type": "boolean"
          },
          "allowDetailedTrainingRetakes": {
            "type": "boolean"
          },
          "allowSaveQuestionsForLater": {
            "type": "boolean",
            "nullable": true
          },
          "allowSaveAndResume": {
            "type": "boolean",
            "nullable": true
          },
          "allowQuestionSharing": {
            "type": "boolean",
            "nullable": true
          },
          "allowLiveSessions": {
            "type": "boolean",
            "nullable": true
          },
          "allowHardestQuestionTraining": {
            "type": "boolean"
          },
          "maxAttempts": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "timeLimitMinutes": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "awardCompletionCertificate": {
            "type": "boolean"
          },
          "allowLoggedInResultOptOut": {
            "type": "boolean"
          },
          "hideQuizMachineBrandingOverride": {
            "type": "boolean",
            "nullable": true
          },
          "kind": {
            "type": "string",
            "nullable": true
          },
          "allowSearchEngineIndexing": {
            "type": "boolean"
          },
          "mode": {
            "type": "string",
            "nullable": true
          },
          "dynamicStrategy": {
            "type": "string",
            "nullable": true
          },
          "adaptiveEscalationStep": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "dynamicMinimumQuestionCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "dynamicMaximumQuestionCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "dynamicTopicIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "allowDynamicQuizAiSummary": {
            "type": "boolean"
          },
          "allowAiFeedbackDuringQuiz": {
            "type": "boolean"
          },
          "audienceMayIncludeChildren": {
            "type": "boolean",
            "nullable": true
          },
          "colorTheme": {
            "type": "string",
            "nullable": true
          },
          "allowTakerPersonalTheme": {
            "type": "boolean",
            "nullable": true
          },
          "aiEvaluationDailyCallCap": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "aiProviderType": {
            "type": "string",
            "nullable": true
          },
          "aiEndpointUrl": {
            "type": "string",
            "nullable": true
          },
          "aiProviderProfiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportAiProviderProfileDto"
            },
            "nullable": true
          },
          "analyticsColumnsJson": {
            "type": "string",
            "nullable": true
          },
          "requiresAccessCode": {
            "type": "boolean"
          },
          "requiresPayment": {
            "type": "boolean"
          },
          "paywallPriceAmount": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "paywallCurrency": {
            "type": "string",
            "nullable": true
          },
          "paywallDescription": {
            "type": "string",
            "nullable": true
          },
          "paywallButtonText": {
            "type": "string",
            "nullable": true
          },
          "paywallMode": {
            "type": "string",
            "nullable": true
          },
          "paywallFreeAttemptsForLoggedInUsers": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "sendWelcomeEmail": {
            "type": "boolean"
          },
          "welcomeEmailBody": {
            "type": "string",
            "nullable": true
          },
          "backgroundMediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "backgroundImageData": {
            "type": "string",
            "nullable": true
          },
          "backgroundImageMimeType": {
            "type": "string",
            "nullable": true
          },
          "certificateLogoMediaAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "certificateLogoImageData": {
            "type": "string",
            "nullable": true
          },
          "certificateLogoImageMimeType": {
            "type": "string",
            "nullable": true
          },
          "allowCut": {
            "type": "boolean"
          },
          "allowCopy": {
            "type": "boolean"
          },
          "allowPaste": {
            "type": "boolean"
          },
          "allowRightClick": {
            "type": "boolean"
          },
          "allowPrint": {
            "type": "boolean"
          },
          "showAnswersDuringQuiz": {
            "type": "boolean"
          },
          "allowAiChatDuringQuiz": {
            "type": "boolean"
          },
          "preventAiChatDirectAnswers": {
            "type": "boolean"
          },
          "showResultsOnSubmit": {
            "type": "boolean"
          },
          "allowBackNavigation": {
            "type": "boolean"
          },
          "requiresLogin": {
            "type": "boolean"
          },
          "scheduledOpenAtUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "scheduledCloseAtUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "daysOpenAfterPublish": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "pages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportPageDto"
            },
            "nullable": true
          },
          "textMediaBlocks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportTextMediaBlockDto"
            },
            "nullable": true
          },
          "questions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportQuestionDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizExportOptionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Output-only stable id (issue #1566); ignored if sent back on write.",
            "format": "uuid",
            "nullable": true
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "text": {
            "maxLength": 1000,
            "type": "string",
            "nullable": true
          },
          "isCorrect": {
            "type": "boolean"
          },
          "overridePoints": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "hint": {
            "maxLength": 150,
            "type": "string",
            "description": "Optional MatchingText placeholder hint; rejected for other question types.",
            "nullable": true
          },
          "imageData": {
            "type": "string",
            "nullable": true
          },
          "imageMimeType": {
            "type": "string",
            "nullable": true
          },
          "mediaAssetId": {
            "type": "string",
            "description": "The organization media asset backing QuizMachine.Core.DTOs.QuizExportOptionDto.ImageData, when library-backed\r\n(issue #1566). Populated whenever known; QuizMachine.Core.DTOs.QuizExportOptionDto.ImageData is omitted only under\r\n`media=references`.",
            "format": "uuid",
            "nullable": true
          },
          "leftMediaAssetId": {
            "type": "string",
            "description": "The media asset on the left (prompt) side of a Matching pair, when set. Full-package writes\r\naccept valid same-organization references; portable packages carry QuizMachine.Core.DTOs.QuizExportOptionDto.LeftImageData.\r\nUse the granular option-image endpoint with `side=left` for identity-preserving edits.",
            "format": "uuid",
            "nullable": true
          },
          "rightMediaAssetId": {
            "type": "string",
            "description": "The QuizMachine.Core.DTOs.QuizExportOptionDto.LeftMediaAssetId equivalent for the right (answer) side.",
            "format": "uuid",
            "nullable": true
          },
          "leftImageData": {
            "type": "string",
            "nullable": true
          },
          "leftImageMimeType": {
            "type": "string",
            "nullable": true
          },
          "rightImageData": {
            "type": "string",
            "nullable": true
          },
          "rightImageMimeType": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizExportPackage": {
        "type": "object",
        "properties": {
          "schemaVersion": {
            "type": "string",
            "nullable": true
          },
          "exportedAtUtc": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "description": "Current publication state. Output-only; package writes preserve server state.",
            "nullable": true
          },
          "slug": {
            "type": "string",
            "description": "Current custom-link slug. Output-only; use the dedicated slug endpoint to change it.",
            "nullable": true
          },
          "shareUrl": {
            "type": "string",
            "description": "Canonical URL respondents can use to take this quiz. Output-only.",
            "nullable": true
          },
          "quiz": {
            "$ref": "#/components/schemas/QuizExportDto"
          }
        },
        "additionalProperties": false
      },
      "QuizExportPageDto": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "timeLimitSeconds": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "type": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizExportQuestionDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The question's stable id (issue #1566). Output-only: present on every read, ignored if sent\r\nback on `POST`/`PUT` — full-package replace still recreates every question with a\r\nfresh id. Use `PATCH /api/v1/quizzes/{quizId}/questions/{id}` to edit a question in\r\nplace and keep this id (and its options/images/topics) stable.",
            "format": "uuid",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "newPage": {
            "type": "boolean",
            "description": "Write-only granular-create instruction. When true, the API appends a page when\r\nQuizMachine.Core.DTOs.QuizExportQuestionDto.PageNumber is zero, or inserts one at that position before creating the\r\nquestion. Full-package create and replace ignore this flag."
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "enum": [
              "SingleChoiceRadio",
              "SingleChoiceDropdown",
              "MultipleChoice",
              "PictureChoice",
              "FillInTheBlanks",
              "Matching",
              "MatchingText",
              "FreeText",
              "FileUpload",
              "Code",
              "DiagramUpload",
              "HierarchyGraph",
              "Math",
              "RandomFromTopic",
              "ChildPictureChoice",
              "Tiles",
              "GraphSearchTrace",
              "GraphSearchTraceV2",
              "FirstOrderResolutionRefutation"
            ],
            "type": "string",
            "nullable": true
          },
          "body": {
            "maxLength": 65536,
            "type": "string",
            "description": "Question prompt HTML or Markdown source. Limited to 65,536 characters.",
            "nullable": true
          },
          "bodyAllowMarkdown": {
            "type": "boolean"
          },
          "points": {
            "type": "number",
            "format": "double"
          },
          "isRequired": {
            "type": "boolean"
          },
          "isDisabled": {
            "type": "boolean"
          },
          "randomizeOptions": {
            "type": "boolean"
          },
          "allowNegativeScore": {
            "type": "boolean"
          },
          "difficulty": {
            "type": "integer",
            "format": "int32"
          },
          "showFeedback": {
            "type": "boolean"
          },
          "feedbackText": {
            "maxLength": 65536,
            "type": "string",
            "description": "Explanation shown after question completion. Limited to 65,536 characters.",
            "nullable": true,
            "example": "The best move maximizes the minimum score.\n\n```mermaid\nflowchart TD\n    A[Your move] --> B[Opponent response]\n```"
          },
          "feedbackAllowMarkdown": {
            "type": "boolean",
            "description": "When true, QuizMachine.Core.DTOs.QuizExportQuestionDto.FeedbackText is raw Markdown source rather than\r\nQuill rich-text HTML (issue #598).",
            "example": true
          },
          "caseSensitiveMatch": {
            "type": "boolean"
          },
          "matchingImmediateFeedback": {
            "type": "boolean",
            "description": "Legacy name for immediate feedback on supported question types. Matching,\r\nMatchingText, FillInTheBlanks and PictureChoice highlight correct selections;\r\nMath and HierarchyGraph use a limited check that locks the answer.",
            "example": true
          },
          "immediateFeedback": {
            "type": "boolean",
            "description": "Neutral alias for the legacy matchingImmediateFeedback field.",
            "nullable": true
          },
          "immediateFeedbackMaxAttempts": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "options": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportOptionDto"
            },
            "nullable": true
          },
          "childPictureChoiceResponseMode": {
            "type": "string",
            "nullable": true
          },
          "childPictureChoiceMaxAttempts": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tilesGridSize": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tilesBlankTargetPosition": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tilesShuffleDepth": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tilesMaximumMoves": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tilesConfigurationVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tilesEngineVersion": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "tiles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportTileDto"
            },
            "nullable": true
          },
          "narrationTranscript": {
            "type": "string",
            "description": "Required visible transcript whenever the question carries narration.",
            "nullable": true
          },
          "narrationMediaAssetId": {
            "type": "string",
            "description": "Destination-organization narration asset. Imports accept it only when the asset is already\r\nsanitized narration in the destination organization; otherwise send the audio bytes.",
            "format": "uuid",
            "nullable": true
          },
          "narrationAudioData": {
            "type": "string",
            "description": "Base64 MP3 or WAV bytes in `media=embedded` mode; re-sanitized on import.",
            "nullable": true
          },
          "narrationAudioMimeType": {
            "type": "string",
            "nullable": true
          },
          "aiEvaluationEnabled": {
            "type": "boolean"
          },
          "modelAnswer": {
            "type": "string",
            "nullable": true
          },
          "rubric": {
            "type": "string",
            "nullable": true
          },
          "images": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportQuestionImageDto"
            },
            "nullable": true
          },
          "feedbackImages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizExportQuestionImageDto"
            },
            "description": "Images shown alongside QuizMachine.Core.DTOs.QuizExportQuestionDto.FeedbackText rather than the question body (issue\r\n#1771). Portable package import recreates embedded or referenced rows and remaps any\r\n`feedback-image:{id}` destinations to their new stable ids. Granular question writes\r\nstill use the feedback-image endpoints to attach, update, reorder, or detach one.",
            "nullable": true
          },
          "diagramReferenceImageData": {
            "type": "string",
            "nullable": true
          },
          "diagramReferenceImageMimeType": {
            "type": "string",
            "nullable": true
          },
          "diagramReferenceImageAssetId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "topicIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Organization Topic ids to assign during question/package creation or replacement. Requires topic:write.",
            "nullable": true,
            "example": [
              "11111111-1111-1111-1111-111111111111"
            ]
          },
          "topicNames": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Input-only create-time names; existing Topics are reused case-insensitively and missing Topics are created. Requires topic:write. Not returned on export/read.",
            "nullable": true,
            "writeOnly": true,
            "example": [
              "Minimax"
            ]
          },
          "randomSourceTopicId": {
            "type": "string",
            "description": "The organization Topic whose Question Bank pool a `RandomFromTopic` selector draws\r\nfrom. Emitted only for that type so an organization backup can be restored into the same\r\norganization; on import it is bound only when a topic with this id still exists for the\r\nimporting organization.",
            "format": "uuid",
            "nullable": true
          },
          "codeLanguage": {
            "type": "string",
            "nullable": true
          },
          "codeStarterCode": {
            "maxLength": 16000,
            "type": "string",
            "nullable": true
          },
          "codeReferenceSolution": {
            "maxLength": 16000,
            "type": "string",
            "nullable": true
          },
          "codeTestCasesJson": {
            "maxLength": 16000,
            "type": "string",
            "nullable": true
          },
          "aiOnlyCodeEvaluation": {
            "type": "boolean"
          },
          "hierarchyGraphLayers": {
            "type": "integer",
            "format": "int32"
          },
          "hierarchyGraphNodePoolJson": {
            "type": "string",
            "nullable": true
          },
          "hierarchyGraphCorrectEdgesJson": {
            "type": "string",
            "nullable": true
          },
          "hierarchyGraphValidationMode": {
            "type": "string",
            "nullable": true
          },
          "hierarchyGraphExplanationRequired": {
            "type": "boolean",
            "description": "Whether the taker must write an explanation for a hierarchy graph (issue #2033). Defaults to\r\nrequired, so a package or API payload that omits the field keeps the original behaviour."
          },
          "graphSearchDraftJson": {
            "type": "string",
            "description": "Portable graph draft: editor-local node keys and no persistent IDs, so an import always\r\ncreates fresh question-owned nodes and edges. Validated by the same codec as the editor.",
            "nullable": true
          },
          "resolutionProblemJson": {
            "type": "string",
            "nullable": true
          },
          "mathExpectedAnswer": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "mathToleranceMode": {
            "type": "string",
            "nullable": true
          },
          "mathToleranceValue": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "mathSignificantFigures": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "mathDecimalPlaces": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "mathNumberFormatOverride": {
            "type": "string",
            "nullable": true
          },
          "mathUnitRequirement": {
            "type": "string",
            "nullable": true
          },
          "mathExpectedUnit": {
            "type": "string",
            "nullable": true
          },
          "mathWorkingRequirement": {
            "type": "string",
            "nullable": true
          },
          "mathWorkingAiFeedbackEnabled": {
            "type": "boolean",
            "nullable": true
          },
          "mathExpectedWorking": {
            "maxLength": 12000,
            "type": "string",
            "nullable": true
          },
          "mathWorkingRubric": {
            "maxLength": 6000,
            "type": "string",
            "nullable": true
          },
          "mathResponseKind": {
            "type": "string",
            "nullable": true
          },
          "mathSymbolicExpectedAnswer": {
            "type": "string",
            "nullable": true
          },
          "mathDeclaredVariables": {
            "type": "string",
            "nullable": true
          },
          "mathDomainAssumptions": {
            "type": "string",
            "nullable": true
          },
          "mathSymbolicEquivalencePolicy": {
            "type": "string",
            "nullable": true
          },
          "mathRequiredForm": {
            "type": "string",
            "nullable": true
          },
          "mathForbiddenForm": {
            "type": "string",
            "nullable": true
          },
          "mathParameterContractJson": {
            "type": "string",
            "nullable": true
          },
          "mathExpectedAnswerTemplate": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizExportQuestionImageDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Output stable id (issue #1566). Ordinary writes cannot select the persisted id. During a\r\nportable package import it is used only as the source key for remapping feedback-image\r\nplaceholders to the newly generated row id.",
            "format": "uuid",
            "nullable": true
          },
          "data": {
            "type": "string",
            "nullable": true
          },
          "mimeType": {
            "type": "string",
            "nullable": true
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "mediaAssetId": {
            "type": "string",
            "description": "The organization media asset backing this image, when library-backed (issue #1566).\r\nPopulated whenever known; QuizMachine.Core.DTOs.QuizExportQuestionImageDto.Data is omitted only under `media=references`.",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizExportTextMediaBlockDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The block's stable id (issue #1566). Output-only: present on every read, ignored if sent\r\nback on `POST`/`PUT` — full-package replace still recreates every block.",
            "format": "uuid",
            "nullable": true
          },
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "linkedQuestionId": {
            "type": "string",
            "format": "uuid",
            "nullable": true
          },
          "blockType": {
            "enum": [
              "Text",
              "Image",
              "YouTube",
              "Mermaid",
              "LatexArticle"
            ],
            "type": "string",
            "nullable": true
          },
          "textContent": {
            "type": "string",
            "nullable": true
          },
          "imageData": {
            "type": "string",
            "nullable": true
          },
          "imageMimeType": {
            "type": "string",
            "nullable": true
          },
          "mediaAssetId": {
            "type": "string",
            "description": "The organization media asset backing this block's image, when library-backed (issue #1566).\r\nPopulated whenever known, regardless of `media` read mode; QuizMachine.Core.DTOs.QuizExportTextMediaBlockDto.ImageData is\r\nomitted only when the API read was requested with `media=references`.",
            "format": "uuid",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          },
          "youTubeVideoId": {
            "type": "string",
            "nullable": true
          },
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "isHeader": {
            "type": "boolean"
          },
          "textAllowMarkdown": {
            "type": "boolean"
          },
          "presentation": {
            "type": "string",
            "nullable": true
          },
          "tone": {
            "type": "string",
            "nullable": true
          },
          "joinWithPrevious": {
            "type": "boolean"
          },
          "layoutColumns": {
            "type": "integer",
            "description": "Responsive column count: 1 is full width; 2 and 3 share a row when space permits.",
            "format": "int32"
          },
          "isIntroImage": {
            "type": "boolean",
            "description": "True for the single page-one image selected as the public listing thumbnail."
          }
        },
        "additionalProperties": false
      },
      "QuizExportTileDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Output-only stable id. Imports always create destination-owned tile identities.",
            "format": "uuid",
            "nullable": true
          },
          "order": {
            "type": "integer",
            "format": "int32"
          },
          "label": {
            "type": "string",
            "nullable": true
          },
          "targetPosition": {
            "type": "integer",
            "format": "int32"
          },
          "imageData": {
            "type": "string",
            "nullable": true
          },
          "imageMimeType": {
            "type": "string",
            "nullable": true
          },
          "mediaAssetId": {
            "type": "string",
            "description": "Source reference for API reads and same-organization reference-mode writes. Portable\r\nimports prefer embedded bytes and remap them to a destination-owned media asset.",
            "format": "uuid",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizMergePatchRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "nullable": true
          },
          "welcomeMessage": {
            "type": "string",
            "nullable": true
          },
          "passingScorePercent": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "showFeedbackToTakers": {
            "type": "boolean",
            "nullable": true
          },
          "randomizeQuestionOrder": {
            "type": "boolean",
            "nullable": true
          },
          "allowMultipleAttempts": {
            "type": "boolean",
            "nullable": true
          },
          "retakeOnlyIfFailed": {
            "type": "boolean",
            "nullable": true
          },
          "allowDetailedTrainingRetakes": {
            "type": "boolean",
            "nullable": true
          },
          "allowSaveQuestionsForLater": {
            "type": "boolean",
            "nullable": true
          },
          "allowSaveAndResume": {
            "type": "boolean",
            "nullable": true
          },
          "allowQuestionSharing": {
            "type": "boolean",
            "nullable": true
          },
          "allowLiveSessions": {
            "type": "boolean",
            "nullable": true
          },
          "allowHardestQuestionTraining": {
            "type": "boolean",
            "nullable": true
          },
          "maxAttempts": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "timeLimitMinutes": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "allowCut": {
            "type": "boolean",
            "nullable": true
          },
          "allowCopy": {
            "type": "boolean",
            "nullable": true
          },
          "allowPaste": {
            "type": "boolean",
            "nullable": true
          },
          "allowRightClick": {
            "type": "boolean",
            "nullable": true
          },
          "allowPrint": {
            "type": "boolean",
            "nullable": true
          },
          "showAnswersDuringQuiz": {
            "type": "boolean",
            "nullable": true
          },
          "allowAiChatDuringQuiz": {
            "type": "boolean",
            "nullable": true
          },
          "preventAiChatDirectAnswers": {
            "type": "boolean",
            "nullable": true
          },
          "showResultsOnSubmit": {
            "type": "boolean",
            "nullable": true
          },
          "allowBackNavigation": {
            "type": "boolean",
            "nullable": true
          },
          "requiresLogin": {
            "type": "boolean",
            "nullable": true
          },
          "allowAiFeedbackDuringQuiz": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Machine-readable shape of the JSON Merge Patch accepted by the quiz patch endpoint.\r\nEvery property is optional; omitted properties keep their current value."
      },
      "QuizPageApiResponse": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "format": "int32"
          },
          "pageCount": {
            "type": "integer",
            "format": "int32"
          },
          "type": {
            "type": "string",
            "nullable": true
          },
          "timeLimitSeconds": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Result of a granular page create or delete operation."
      },
      "QuizPatchApiResponse": {
        "type": "object",
        "properties": {
          "quiz": {
            "$ref": "#/components/schemas/QuizExportDto"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Response of a successful quiz-level scalar patch operation."
      },
      "QuizSlugApiResponse": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "nullable": true
          },
          "shareUrl": {
            "type": "string",
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Custom-link state after a successful set or clear operation."
      },
      "QuizStatusApiResponse": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "nullable": true
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Publication state after a successful status mutation."
      },
      "QuizValidationResponse": {
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          },
          "results": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizBatchOperationResult"
            },
            "nullable": true
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizBatchValidationError"
            },
            "nullable": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/QuizBatchValidationWarning"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "QuizWriteApiResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "editUrl": {
            "type": "string",
            "nullable": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Post-import actions for intentionally excluded secrets or plan-gated settings.",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Response returned after a full-package quiz create or replace."
      },
      "ReorderFeedbackImagesRequest": {
        "type": "object",
        "properties": {
          "imageIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Complete stable-ID order accepted by the feedback-image reorder endpoint."
      },
      "ReorderQuestionImagesRequest": {
        "type": "object",
        "properties": {
          "imageIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Complete stable-ID order accepted by the question-image reorder endpoint."
      },
      "ReplaceQuestionTopicsRequest": {
        "type": "object",
        "properties": {
          "topicIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Body of `PUT /api/v1/quizzes/{quizId}/questions/{questionId}/topics` (issue #1566)."
      },
      "ResetPasswordApiRequest": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ResetPasswordApiResponse": {
        "type": "object",
        "properties": {
          "temporaryPassword": {
            "type": "string",
            "nullable": true
          },
          "message": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SetBlockImageRequest": {
        "type": "object",
        "properties": {
          "mediaAssetId": {
            "type": "string",
            "format": "uuid"
          },
          "altText": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Body used to set a canvas Image block's image from the media library."
      },
      "SetDiagramReferenceImageRequest": {
        "type": "object",
        "properties": {
          "mediaAssetId": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": false,
        "description": "Body used to set a DiagramUpload question's reference image from the media library."
      },
      "SetOptionImageRequest": {
        "type": "object",
        "properties": {
          "mediaAssetId": {
            "type": "string",
            "format": "uuid"
          },
          "side": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Body used to set an answer option's image. QuizMachine.Core.DTOs.SetOptionImageRequest.Side (\"left\" or \"right\") is required\r\nfor a `Matching` option and must be omitted for every other supported type — see\r\n`OptionImagePlacementPolicy` for the full type/placement matrix."
      },
      "TextMediaBlockApiResponse": {
        "type": "object",
        "properties": {
          "block": {
            "$ref": "#/components/schemas/QuizExportTextMediaBlockDto"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false
      },
      "TextMediaBlockImageApiResponse": {
        "type": "object",
        "properties": {
          "blockId": {
            "type": "string",
            "format": "uuid"
          },
          "block": {
            "$ref": "#/components/schemas/QuizExportTextMediaBlockDto"
          },
          "revision": {
            "type": "integer",
            "format": "int64"
          }
        },
        "additionalProperties": false,
        "description": "Response of the text/media block image endpoint (quiz-scoped, not question-scoped)."
      },
      "TextMediaBlockMergePatchRequest": {
        "type": "object",
        "properties": {
          "pageNumber": {
            "type": "integer",
            "description": "Page placement for the block. Supported for all block types.",
            "format": "int32"
          },
          "order": {
            "type": "integer",
            "description": "Visual display order on the page. Supported for all block types.",
            "format": "int32"
          },
          "textContent": {
            "type": "string",
            "description": "Body text, Mermaid diagram source, or LaTeX source. Supported only for Text, Mermaid, and LatexArticle blocks."
          },
          "textAllowMarkdown": {
            "type": "boolean",
            "description": "Whether textContent is parsed as Markdown. Supported only for Text blocks."
          },
          "isHeader": {
            "type": "boolean",
            "description": "Render textContent as a page heading. Supported only for Text blocks."
          },
          "mediaAssetId": {
            "type": "string",
            "description": "Organization media asset ID. Supported only for Image blocks. Requires media:write.",
            "format": "uuid"
          },
          "altText": {
            "type": "string",
            "description": "Alternative text for accessibility. Supported only for Image blocks."
          },
          "youTubeVideoId": {
            "type": "string",
            "description": "YouTube 11-character video ID. Supported only for YouTube blocks."
          },
          "alignment": {
            "enum": [
              "Left",
              "Center",
              "Right"
            ],
            "type": "string",
            "description": "Horizontal alignment ('Left', 'Center', 'Right'). Supported for all block types."
          },
          "presentation": {
            "enum": [
              "Note",
              "Article",
              "Banner",
              "Callout",
              "Plain",
              "Card"
            ],
            "type": "string",
            "description": "Visual container style ('Note', 'Article', 'Banner', 'Callout', 'Plain', 'Card'). Supported only for Text and Image blocks."
          },
          "tone": {
            "enum": [
              "info",
              "tip",
              "important",
              "warning"
            ],
            "type": "string",
            "description": "Callout tone ('info', 'tip', 'important', 'warning'). Supported only for Text and Image blocks."
          },
          "joinWithPrevious": {
            "type": "boolean",
            "description": "Visually joins container with the previous block. Supported only for Text and Image blocks."
          },
          "isIntroImage": {
            "type": "boolean",
            "description": "Marks the block as the quiz intro image. Supported only for Image blocks on page 1."
          },
          "layoutColumns": {
            "maximum": 3,
            "minimum": 1,
            "type": "integer",
            "description": "Number of columns (1 to 3). Supported only for Text, Image, and YouTube blocks.",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "Documented shape of the RFC 7396 block patch body.\r\nEvery property is optional; omitted properties keep their existing value.\r\nAllowed properties depend on the block's `BlockType`."
      },
      "TopicApiDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "createdAtUtc": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false,
        "description": "One organization Topic as the public quiz API returns it (issue #1566)."
      },
      "TopicApiListResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TopicApiDto"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "pageSize": {
            "type": "integer",
            "format": "int32"
          },
          "totalPages": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false,
        "description": "One page of Topics plus the metadata a client needs to walk the rest."
      },
      "TrainingAssignmentDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "recipient": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "dueDateUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "attemptsCount": {
            "type": "integer",
            "format": "int32",
            "nullable": true
          },
          "bestScorePercent": {
            "type": "number",
            "format": "double",
            "nullable": true
          },
          "completedAtUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "certificateIssued": {
            "type": "boolean",
            "nullable": true
          },
          "dismissReason": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TrainingAssignmentPatchApiRequest": {
        "type": "object",
        "properties": {
          "dueDateUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expireAfterDueDate": {
            "type": "boolean",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TrainingAssignmentPatchApiResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "dueDateUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expireAfterDueDate": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TrainingAssignmentsCreateApiRequest": {
        "type": "object",
        "properties": {
          "userIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "groupIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "nullable": true
          },
          "externalLogins": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "recipientEmails": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "dueDateUtc": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "expireAfterDueDate": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "completionRule": {
            "$ref": "#/components/schemas/TrainingCompletionRule"
          },
          "priorCompletionPolicy": {
            "$ref": "#/components/schemas/TrainingPriorCompletionPolicy"
          },
          "allowReassignment": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "TrainingAssignmentsCreateApiResponse": {
        "type": "object",
        "properties": {
          "internalAssignedCount": {
            "type": "integer",
            "format": "int32"
          },
          "externalInvitedCount": {
            "type": "integer",
            "format": "int32"
          },
          "emailInvitedCount": {
            "type": "integer",
            "format": "int32"
          },
          "alreadyInvitedCount": {
            "type": "integer",
            "format": "int32"
          },
          "skippedCount": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "TrainingAssignmentsListApiResponse": {
        "type": "object",
        "properties": {
          "quizId": {
            "type": "string",
            "format": "uuid"
          },
          "page": {
            "type": "integer",
            "format": "int32"
          },
          "count": {
            "type": "integer",
            "format": "int32"
          },
          "hasMore": {
            "type": "boolean"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrainingAssignmentDto"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "TrainingCompletionRule": {
        "enum": [
          1,
          2
        ],
        "type": "integer",
        "description": "Defines when a training assignment is considered completed (issue #2432).",
        "format": "int32"
      },
      "TrainingPriorCompletionPolicy": {
        "enum": [
          1,
          2,
          3
        ],
        "type": "integer",
        "description": "How a group chooses whether eligible prior completions should count.",
        "format": "int32"
      },
      "UpdateFeedbackImageRequest": {
        "type": "object",
        "properties": {
          "alignment": {
            "type": "string",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Author-controlled metadata accepted by a feedback-image update."
      },
      "UpdateQuestionImageRequest": {
        "type": "object",
        "properties": {
          "alignment": {
            "enum": [
              "Left",
              "Center",
              "Right"
            ],
            "type": "string",
            "nullable": true
          },
          "altText": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Author-controlled metadata accepted by a question-image update."
      },
      "UpdateQuizSlugRequest": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Requested custom share-link segment."
      },
      "UpdateQuizStatusRequest": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false,
        "description": "Requested public availability for a quiz."
      }
    },
    "securitySchemes": {
      "Bearer": {
        "type": "http",
        "description": "JWT Authorization header using the Bearer scheme.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      }
    }
  },
  "security": [
    {
      "Bearer": [ ]
    }
  ],
  "tags": [
    {
      "name": "MediaApi",
      "description": "Organization-scoped reusable image upload and metadata API (issue #1576)."
    },
    {
      "name": "QuizCreation",
      "description": "The public quiz API. Creates, reads, and replaces quiz definitions with the same\r\ncurrent versioned package the dashboard export produces. Lists are scoped to the authenticated\r\ncaller's organisation, while complete-definition reads and writes require the quiz owner (or a\r\nRootAdmin recovery operation). Ownership and organisation are trusted server state and are never\r\ntaken from the request body."
    },
    {
      "name": "TopicsApi",
      "description": "The public Topics API (issue #1566): lists, searches, and creates the organization-private\r\nQuestion-Bank Topics the quiz API's question-topics endpoint assigns. Strictly organisation-\r\nscoped — there is no RootAdmin cross-organisation override for Topics, matching the browser\r\neditor's `TopicsController`."
    },
    {
      "name": "TrainingAssignmentsApi",
      "description": "REST API endpoints for managing training assignments."
    }
  ]
}