# How to build an event RSVP form with a response cap

Short answer: `settings.max_responses` and `settings.close_at`. Set either
(or both) and QuizGen stops taking answers on its own — no manual cutoff.

## Worked example

```json
{
  "schema_version": 1,
  "kind": "registration",
  "title": "RSVP: Summer Rooftop Party",
  "description": "Space is limited to 150 guests.",
  "settings": {
    "collect_respondent": "email_required",
    "max_responses": 150,
    "close_at": "2026-08-20T23:59:00Z",
    "completion": { "message": "See you there! Check your email for details." }
  },
  "sections": [ { "key": "main", "questions": [
    { "id": "attending", "type": "choice", "prompt": "Will you be attending?", "required": true,
      "options": [
        { "value": "yes", "label": "Yes, I'll be there" },
        { "value": "no", "label": "Can't make it" }
      ] },
    { "id": "guests", "type": "number", "prompt": "How many guests total, including you?",
      "min": 1, "max": 4,
      "show_if": { "question": "attending", "op": "eq", "value": "yes" } },
    { "id": "dietary", "type": "long_text", "prompt": "Any dietary restrictions?",
      "show_if": { "question": "attending", "op": "eq", "value": "yes" } }
  ] } ]
}
```

The `guests` and `dietary` questions only appear once someone says they're
attending (`show_if`) — no one who declines has to scroll past irrelevant
fields.

## What happens at the cap

Once the form hits `max_responses` or passes `close_at` — whichever comes
first — the hosted page switches to "no longer accepting responses," and new
`POST`s to `/api/respond` get back a `410 quiz_full` (or `quiz_closed`).
Responses already collected stay fully readable.

## Why `email_required` for RSVPs

`collect_respondent: "email_required"` means every response is tied to a
real email — useful for RSVPs specifically, since you'll usually want to
follow up with event details or a reminder, not just count heads.

---

Full `settings` reference: [quizgen.dev/llms.txt](/llms.txt).
