# InstantQuestions

InstantQuestions is a lightweight PHP app to generate Nigerian-style examination papers (WAEC/NECO formatting) using the OpenAI API.

Quick setup (cPanel/XAMPP):

1. Copy files to your web root (this repo root). Ensure `index.php` is reachable.
2. Install dependencies with Composer:

```bash
composer install
```

3. Copy `.env.example` to `.env` and set `OPENAI_API_KEY` and optionally `OPENAI_MODEL`.

4. Ensure `vendor` folder is readable by PHP and restart server if needed.

5. Visit `/` to use the form.

Notes and security:
- Inputs are sanitized and trimmed; keep API key in environment only.
- Free mode indicators are in UI; to implement paid features, add DB and payment flow.

Export options:
- PDF: requires `dompdf/dompdf` (installed via Composer). Free mode includes a visible watermark.
- DOCX: requires `phpoffice/phpword`. DOCX export is restricted to Premium mode in this scaffold.

Generation history:
- Each generated exam is saved locally to `data/history.sqlite`. You can inspect this SQLite DB or extend the service to persist to MySQL.
