Making a quiz by hand

You need nothing but a text editor and this guide. A quiz lives at content/quizzes/<slug>.json, so:

  1. Pick a slug — lowercase kebab-case, e.g. coffee-order-personality. Create content/quizzes/coffee-order-personality.json.
  2. Write the header — slug (same as filename), title, description, enabled: false while you work.
  3. List the results first. It is much easier to write questions when you know the possible outcomes. Give each result a short id (latte, espresso) and a fun description.
  4. Write 4–8 questions. Each question has an id (q1, q2…), text, and 2–10 options. Convention: option ids are <question-id>-a, -b, -c…
  5. Wire the scoring. Each option’s scores object maps result ids to points. Simple approach: give the matching result 1 point. Spicier approach: spread points, e.g. { "latte": 2, "espresso": 1 }.
  6. Validate. Either paste the JSON into the admin editor (it validates as you type) or run npm run check / open /quiz/<slug> while logged out — broken quizzes show a warning page instead of a quiz.
  7. Enable it. Flip enabled to true (or use the toggle in the admin dashboard, which refuses to enable a quiz that fails validation).

Tips

  • Put every result’s id into at least a few options’ scores, otherwise that outcome can never win (the validator warns you).
  • One point per matching option is fine; the tally just needs a winner.
  • Keep option text short — it reads better on phones.
  • Test every path by clicking through your own quiz once before enabling.