# Quiz Application Setup

## Environment Configuration

To use the AI explanation feature, you need to configure your OpenAI API key.

### Option 1: Environment Variable (Recommended)

Create a `.env` file in the root directory with the following content:

```
OPENAI_API_KEY=your_openai_api_key_here
```

Replace `your_openai_api_key_here` with your actual OpenAI API key from https://platform.openai.com/api-keys

### Option 2: System Environment Variable

Set the `OPENAI_API_KEY` environment variable in your system or WAMP configuration.

## Security Note

- Never commit the `.env` file to version control
- The `.env` file is already included in `.gitignore`
- Keep your API key secure and never share it

## Testing

1. Start your WAMP server
2. Navigate to `http://localhost/quiz/quiz.html`
3. Select an exam and load questions
4. Select an answer to see immediate feedback (green for correct, red for incorrect)
5. Click the "Explain" button next to any answer to get an AI-powered explanation
