SCHOOL EXAMINATION QUESTION SETTER
==================================

Requirements
------------
- PHP 8.0 or later (PHP 8.1+ recommended)
- MySQL 5.7+ or MariaDB 10.4+
- PHP PDO MySQL extension enabled

Installation on cPanel
----------------------
1. Create a MySQL database and database user in cPanel.
2. Assign the user to the database with ALL PRIVILEGES.
3. Open phpMyAdmin, select the database and import database.sql.
   (The SQL creates/uses a database named school_exam_system. If your cPanel
   database has a prefixed name, select it and remove the CREATE DATABASE/USE
   lines at the top of database.sql before importing.)
4. Upload all project files and the assets folder into a folder on your website.
5. Edit config.php and enter the actual database host, database name, username,
   password and school details.
6. Visit https://your-domain.com/your-folder/setup.php and create the first
   administrator account. Use a strong password of at least 10 characters.
7. IMPORTANT: delete setup.php from the server after creating the administrator.
8. Sign in at login.php.

Features
--------
- Separate teacher accounts (created by an administrator directly in the
  teachers table for now).
- Each teacher sees and manages only their own papers.
- Examination information: class, subject, session, term, type, date,
  duration, total marks and instructions.
- Objective questions with four options and optional correct answer.
- Theory / essay questions with writing space on the printed paper.
- Add/remove questions dynamically.
- Draft and published statuses.
- Search examination papers.
- Preview and print using A4 portrait dimensions; browser print dialog can
  save the paper as PDF.
- Responsive dashboard and editor for mobile, tablet and desktop.
- CSRF-protected forms, prepared SQL statements and password hashing.

School branding
---------------
In config.php, update $schoolName, $schoolAddress, $schoolPhone, $schoolEmail.
To display a logo, upload it to the project (for example assets/school-logo.png)
and set $schoolLogo = 'assets/school-logo.png';

Teacher accounts
----------------
The first account created by setup.php is an administrator. Additional teacher
accounts can be added through phpMyAdmin in the teachers table. Generate the
password hash with PHP:
  echo password_hash('A-strong-password', PASSWORD_DEFAULT);
Insert the returned hash into password_hash, along with full_name, email and
role='teacher'. Do not store plain-text passwords.

Printing notes
--------------
Use the Preview / Print link and choose A4 paper, Portrait, and default scale
(100%) in the browser print dialog. Disable browser headers and footers for a
clean examination paper. Actual pagination can vary slightly by browser/printer.
The correct answer field is stored for teacher reference and is NOT displayed
on the student printout.

Important
---------
This is a standalone starter application. It does not include student accounts,
automatic marking, question-bank imports, or a public teacher self-registration
workflow. Back up the database regularly and use HTTPS on the live website.
