Question bank API
Read and write assessment Questions. Every request needs a signed-in user (401 otherwise). Only aztec_staff can write (403 otherwise) and only aztec_staff receives answer keys. teacher and admin can read Published Versions and read Retired Versions by ID; a Draft Version is 404 for them. student gets 403 on every route.
Hierarchy: a Question has Versions, and a Version holds variants (one per locale and optional brand). The Question id stays the same across Versions. A Version is Draft, Published or Retired as a whole.
| Operation | Route | Notes |
|---|---|---|
| List types | GET /api/questions/types | The registry: key, displayName, version, enabled, scoringMode. |
| List | GET /api/questions?tag&lessonId&type | Non-staff see only Questions with a Published Version. |
| Create | POST /api/questions | Body: type, ownerType, ownerOrganizationId, difficulty, standardsTags (at least one), skills, lessonIds, variants. Creates Version 1 as Draft. |
| Read | GET /api/questions/{id} | The Question with its Versions and variants. |
| Update | PATCH /api/questions/{id} | Body: rowVersion and any of difficulty, standardsTags, skills, lessonIds. |
| Read a Version | GET /api/questions/{id}/versions/{versionId} | |
| Create a Version | POST /api/questions/{id}/versions | A new Draft that copies the latest Version's variants. |
| Add a variant | POST /api/questions/{id}/versions/{versionId}/variants | Draft Versions only. Body: locale (en-US or es-US), brand, stem, payload, feedback, rationale. |
| Update a variant | PUT /api/questions/{id}/versions/{versionId}/variants/{variantId} | Draft Versions only. Needs rowVersion. |
| Publish | POST /api/questions/{id}/versions/{versionId}/publish | Needs an en-US variant without a brand. The response has missingTranslations. |
| Retire | POST /api/questions/{id}/versions/{versionId}/retire | Published Versions only. |
The route shapes are not fixed by the specification and may change. There is no delete; retire a Version instead.
Payload
payload is { "options": [{ "id", "text", "correct", "feedback" }] }. Option counts: multiple_choice 2–6 with exactly 1 correct, multi_select 2–8 with at least 1 correct, true_false exactly 2 with 1 correct. Non-staff responses keep only each option's id and text.
Errors
401 not signed in, 403 not aztec_staff (writes) or a learner (reads), 404 not found or not visible (including another organization's Question), 409 stale rowVersion, or a change to a Published or Retired Version, 422 validation (unknown or disabled type, payload breaks the type's rules, no standards tag, unsupported locale, publish without an en-US variant).
Telemetry
Meter Aztec.Platform.QuestionBank: write audit events, a variant-added counter and a version-published counter.