# Private quiz

A two-phone party quiz with custom answer pads, private receipts, reveal and scores. Everyone chooses Forest or River on their own phone. Once connected players have answered, any phone can reveal. A correct answer earns one point. NEXT starts another question; scores stay with each player ID.

From the SDK root, with Node 22 or newer:

```sh
node examples/private-choice/server.mjs
```

Open [the quiz and QR lobby](http://127.0.0.1:49703/). There is no extra dependency or build. For real phones on the same Wi-Fi, replace this example IP with the computer's reachable address:

```sh
PUBLIC_ORIGIN=http://192.168.1.20:49703 node examples/private-choice/server.mjs
```

Open that LAN URL on the display, then scan its QR with both phones. Answers and the correct result stay on the server until reveal. Each phone receives only its own receipt. A round ID, allowed-answer check and server-side answer lock reject stale or repeated submissions.

```sh
node --test examples/private-choice/test.mjs
```

The test **reuses and extends** [the original private-choice test](../testing/private-choice.test.mjs). That original test remains runnable against its original game. Both use the SDK driver by relative path. The quiz test adds reveal, scoring, another round and stale-event rejection to real canvas taps, separate phone contexts, feedback receipts, rotation, reload/resume, leave/removal, QR rotation and cleanup.

Read [shared setup](../local-common/README.md) for phone-reachable addresses, the five lifecycle events, shutdown, and trusted local HTTPS for iPhone motion. This quiz requires no sensors. Headless receipts do not prove physical output. Type `remove p1` in the server terminal to free a seat; Ctrl+C stops the host and server.
