# OAT Quiz

A quiz application for testing knowledge about Ormiston Academies Trust (OAT).

## Overview

This application provides an interactive quiz system with questions, timers, and a scoreboard. It includes an admin interface for managing quiz questions.

## Features

- Interactive quiz with timer
- Question management (CRUD operations)
- Scoreboard tracking
- Admin mode for question management

## Installation

1. Install dependencies:
```bash
pip install -r requirements.txt
```

2. Ensure data files are in place:
- `quiz_questions.json` - Quiz questions database
- `quiz_scoreboard.json` - Scoreboard data

## Running

Using uvicorn:
```bash
uvicorn app:app --host 0.0.0.0 --port 8000
```

Or using WSGI (for production):
- Configure your WSGI server to use `app.wsgi`

## Routes

- `/oat_quiz` - Quiz page
- `/api/quiz/questions` - Get all questions
- `/api/admin/quiz/questions` - Manage questions (POST, PUT, DELETE)
- `/api/quiz/scoreboard` - Scoreboard endpoints (GET, POST)

## Data Structure

- `quiz_questions.json` - Stores all quiz questions
- `quiz_scoreboard.json` - Stores scoreboard entries
- `templates/quiz.html` - Quiz interface
- `static/js/quiz.js` - Quiz logic
- `static/css/quiz.css` - Quiz styling

## Admin Mode

Access admin mode from the quiz page to manage questions. Questions can have 2-8 options and must include a correct answer.

