# AZ-104 Quiz — Data Schema

## Overview

Each question is stored as JSON with **bilingual** fields (`en` / `vi`). Vietnamese (`vi`) is filled by the translation pipeline; `null` means not translated yet.

## Question object

```json
{
  "id": 1,
  "exam": "AZ-104",
  "type": "single_choice",
  "source": {
    "pdfPage": 4,
    "certyiqUrl": "https://certyiq.com/papers/microsoft/az-104/1"
  },
  "stem": { "en": "...", "vi": "..." },
  "options": [
    { "key": "A", "text": { "en": "...", "vi": "..." } }
  ],
  "answer": {
    "keys": ["C"],
    "text": { "en": null, "vi": null }
  },
  "explanation": { "en": "...", "vi": "..." },
  "references": ["https://learn.microsoft.com/..."],
  "boxes": [
    { "id": 1, "label": "Box 1", "answer": { "en": "dataActions", "vi": "..." } }
  ],
  "media": {
    "required": false,
    "images": ["assets/questions/1/img-0.png"],
    "pageRender": "assets/questions/1/page.png"
  },
  "tags": ["resource-manager", "tags"],
  "meta": {
    "note": "Optional: shared scenario with other questions",
    "translatedAt": "2026-05-24T00:00:00Z"
  }
}
```

## `type` values

| Type | Description |
|------|-------------|
| `single_choice` | One correct option (A–D) |
| `multi_select` | Two or more correct options |
| `yes_no` | "Does the solution meet the goal?" (Yes/No) |
| `hotspot` | Hot area / multiple boxes |
| `drag_drop` | Drag and drop / select and place |
| `dropdown` | Drop-down menus completing statements |
| `unknown` | Parser could not classify; review manually |

## `answer` by type

- **single_choice / yes_no**: `keys: ["C"]` or `["Yes"]`
- **multi_select**: `keys: ["A", "C"]`
- **hotspot / dropdown / drag_drop**: use `boxes[]` when answer is split; `keys` may be empty

## Media strategy

1. **Embedded images** from PDF page → `assets/questions/{id}/img-{n}.png`
2. **Full page render** (for diagram-heavy items) → `assets/questions/{id}/page.png`
3. `media.required: true` when stem mentions "graphic", "image", "hot area", or type is hotspot/dropdown/drag_drop

## Quiz session (API)

- Pool: all questions in `data/questions.json`
- Draw: **60–70** random IDs without replacement
- Optional filters: `type`, `translatedOnly`, `excludeIds`

## Files

```
data/
  questions.json      # array of question objects
  manifest.json       # counts, extraction date, version
assets/
  questions/{id}/     # per-question images
```
