# Quiz

A quiz block lets a slide pose a question and capture the visitor's answer. Common uses: pre-qualifying leads, gating slide advancement on correct answers (corporate training), and personalizing follow-up.

## Authoring a quiz

In the slide editor, click **Quiz** in the top toolbar to insert a quiz element. The right-pane inspector exposes:

- **Question** — the prompt shown to the visitor
- **Options** — up to 8 answer options. Each has a **Label** field and a **Correct** toggle. Multiple options can be marked correct when "Allow multiple selections" is on.
- **Allow multiple selections** — let the visitor pick more than one option (renders as checkboxes instead of radios)
- **Feedback when correct** — text shown after a correct answer
- **Feedback when incorrect** — text shown after an incorrect answer

The agent receives the visitor's answer as a structured event and can branch its script accordingly (e.g., "Great, you picked Quality — let me show you our premium tier").

## Display modes

```json title="quiz.json"
{
  "type": "quiz",
  "display": "expanded",
  "question": "Which is more important to you?",
  "options": [
    { "id": "speed",   "label": "Speed" },
    { "id": "quality", "label": "Quality", "correct": true }
  ]
}
```

The schema supports two display modes:

- **`expanded`** *(default)* — full question + options render inline at the slide's authored position. The mode you'll use 99% of the time.
- **`collapsible`** — compact "QUIZ · N questions" card that expands on click. Useful when the slide already has a primary visual and you don't want the quiz to dominate.

> [!INFO]
> **`collapsible` is set via JSON only today.** The schema and runtime support it (PR [#94](https://github.com/Fusion-Studios-Code/live-layer/pull/94) shipped the renderer), but the inspector doesn't expose a toggle yet — you can flip it via PPTX import or by editing the slide's raw schema. A UI toggle is on the roadmap.

## Quiz badge

When a slide carries a quiz, the published view surfaces a small "Quiz" badge in the top-right of the content card to give visitors a heads-up. The badge is suppressed on V2 slides where the quiz renders at its authored position inside the canvas (the badge would visually overlap the quiz itself).

## Schema reference

<ParamsTable params={[
  { name: "type",                 type: "\"quiz\"",                                                                              required: true,  description: "Discriminator" },
  { name: "question",             type: "string",                                                                                required: true,  description: "The prompt shown to the visitor" },
  { name: "options",              type: "Array<{ id: string; label: string; correct?: boolean }>",                              required: true,  description: "2–8 options. `correct: true` marks the right answer(s)." },
  { name: "multiSelect",          type: "boolean",                                                                               required: false, description: "Allow multiple selections (default: false)" },
  { name: "feedbackOnCorrect",    type: "string",                                                                                required: false, description: "Text shown after a correct answer" },
  { name: "feedbackOnIncorrect",  type: "string",                                                                                required: false, description: "Text shown after an incorrect answer" },
  { name: "display",              type: "\"expanded\" | \"collapsible\"",                                                        required: false, description: "Render as full block (default) or collapsible card. UI toggle pending." },
]} />

## Read next

- [Buttons](/docs/build/slides/elements/button) — call-to-action that can advance the slide on quiz completion
- [Script and AI instructions](/docs/build/slides/script-and-instructions) — how the agent reacts to quiz answers
