# Setup — Google Form Template

## 1. Create the Google Form
1. https://forms.google.com → blank form.
2. Questions:
   - **Candidate / Rating** (Multiple choice or Scale 1–5, Required)
   - **Feedback** (Paragraph), **Suggestions** (Paragraph), **Name** (Short answer)
   - **Device ID** (Short answer, Required) — hidden via prefill trick below
3. Hide Device ID: use pre-filled link trick — voter never types it; site fills via URL.
4. Get pre-fill IDs: ⋮ → **Get pre-filled link** → fill Device ID `TEST123` → Get link → Copy.
   URL: `https://docs.google.com/forms/d/e/XXXXXXXX/viewform?entry.123456789=TEST123`
   - `XXXXXXXX` → `GOOGLE_FORM_BASE` / `FORM_ID`
   - `123456789` → `DEVICE_FIELD_ENTRY_ID` → set `DEVICE_ENTRY_ID` in `index.html` CONFIG
5. Paste values into `CONFIG` at top of `index.html`.

Live IDs in this repo: `FORM_ID=1FAIpQLSe0ejV6r7WZ3JC5lp8qnLbetOy2L0_XabemdPrsTceXAOgShQ`,
`RATING=1591633300`, `FEEDBACK=326955045`, `SUGGESTIONS=1696159737`, `NAME=485428648`.

## 2. Deploy
- `python3 -m http.server 8080` or Netlify / Vercel / GitHub Pages (static).
- Embed requires https; if iframe blocked, use `/viewform` link, disable domain restriction.

## 3. Real backend (optional)
```js
VERIFY_ENDPOINT: "https://your-api.example.com/verify-device"
```
Endpoint: receive `{deviceId}`, check allowlist + not-voted DB, return `{allowed:true/false}`.
Note: ballot still posts to Google — cannot validate atomically. For that use Typeform/Jotform webhooks or custom backend.
