# nshoron/online_quiz_system architecture

> Architecture diagram of the GitHub repository nshoron/online_quiz_system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nshoron/online_quiz_system
- Repository: https://github.com/nshoron/online_quiz_system

## Overview

Online Quiz System is a PHP/MySQL web application for teacher-managed assessments and student quiz attempts. The main workflow is role-based sign-in, teacher quiz authoring and management, student quiz discovery and timed attempts, server-side scoring and persistence, then student and teacher result review. The README also describes quiz assignment and availability controls, but the sampled code does not establish their implementation. Arrows reflect explicit excerpts or README statements; unsampled components are retained where the tree and README establish their role.

Main entry points: [`config.php`](https://github.com/nshoron/online_quiz_system/blob/master/config.php) (DB and session setup), [`auth.php`](https://github.com/nshoron/online_quiz_system/blob/master/auth.php) (Sign-in handler), [`student/take_quiz.php`](https://github.com/nshoron/online_quiz_system/blob/master/student/take_quiz.php) (Timed quiz attempt), [`student/my_results.php`](https://github.com/nshoron/online_quiz_system/blob/master/student/my_results.php) (Attempt history)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity"]
  node_login["Login screen<br/>[index.php]"]
  node_authentication["Sign-in handler<br/>[auth.php]"]
  node_registration["Registration form<br/>[register.php]"]
  node_registration_handler["Registration handler"]
  node_session_exit["Logout<br/>[logout.php]"]
end

subgraph group_teacher["Teacher workflow"]
  node_teacher_dashboard["Teacher dashboard<br/>[dashboard.php]"]
  node_quiz_authoring["Quiz authoring form<br/>[create_quiz.php]"]
  node_quiz_creation["Quiz creation handler<br/>[process_quiz.php]"]
  node_quiz_management["Quiz management<br/>[manage_quizzes.php]"]
  node_teacher_results["Teacher results<br/>[view_results.php]"]
end

subgraph group_student["Student workflow"]
  node_student_dashboard["Student dashboard<br/>[dashboard.php]"]
  node_quiz_discovery["Available quizzes"]
  node_quiz_attempt["Timed quiz attempt<br/>[take_quiz.php]"]
  node_attempt_processing["Attempt validation and scoring"]
  node_student_results["Attempt history<br/>[my_results.php]"]
  node_result_detail["Attempt detail<br/>[quiz_results.php]"]
end

subgraph group_data["Shared data"]
  node_database_config["DB and session setup<br/>[config.php]"]
  node_schema["Quiz data schema<br/>[database.sql]"]
  node_mysql[("MySQL database")]
end

node_browser(("Teacher or student"))

node_browser -->|"opens"| node_login
node_browser -->|"registers"| node_registration
node_login -->|"submits credentials"| node_authentication
node_registration -->|"submits registration"| node_registration_handler
node_authentication -->|"queries users"| node_database_config
node_registration_handler -->|"checks and stores user"| node_database_config
node_authentication -->|"redirects teacher"| node_teacher_dashboard
node_authentication -->|"redirects student"| node_student_dashboard
node_browser -->|"logs out"| node_session_exit
node_teacher_dashboard -->|"queries activity"| node_database_config
node_browser -->|"authors quiz"| node_quiz_authoring
node_quiz_authoring -->|"submits quiz"| node_quiz_creation
node_quiz_creation -->|"stores quiz"| node_database_config
node_browser -->|"manages quizzes"| node_quiz_management
node_quiz_management -->|"deletes and reads quizzes"| node_database_config
node_browser -->|"reviews results"| node_teacher_results
node_teacher_results -->|"queries attempts"| node_database_config
node_browser -->|"views overview"| node_student_dashboard
node_student_dashboard -->|"queries performance"| node_database_config
node_browser -->|"finds quizzes"| node_quiz_discovery
node_quiz_discovery -->|"reads available quizzes"| node_database_config
node_browser -->|"takes quiz"| node_quiz_attempt
node_quiz_attempt -->|"loads quiz"| node_database_config
node_quiz_attempt -->|"submits answers"| node_attempt_processing
node_attempt_processing -->|"validates and stores attempt"| node_database_config
node_browser -->|"reviews history"| node_student_results
node_student_results -->|"queries attempts"| node_database_config
node_student_results -->|"opens details"| node_result_detail
node_result_detail -->|"queries answers"| node_database_config
node_database_config -->|"connects"| node_mysql
node_schema -->|"defines tables"| node_mysql

click node_login "https://github.com/nshoron/online_quiz_system/blob/master/index.php"
click node_authentication "https://github.com/nshoron/online_quiz_system/blob/master/auth.php"
click node_registration "https://github.com/nshoron/online_quiz_system/blob/master/register.php"
click node_registration_handler "https://github.com/nshoron/online_quiz_system/blob/master/register_process.php"
click node_session_exit "https://github.com/nshoron/online_quiz_system/blob/master/logout.php"
click node_database_config "https://github.com/nshoron/online_quiz_system/blob/master/config.php"
click node_schema "https://github.com/nshoron/online_quiz_system/blob/master/database.sql"
click node_teacher_dashboard "https://github.com/nshoron/online_quiz_system/blob/master/teacher/dashboard.php"
click node_quiz_authoring "https://github.com/nshoron/online_quiz_system/blob/master/teacher/create_quiz.php"
click node_quiz_creation "https://github.com/nshoron/online_quiz_system/blob/master/teacher/process_quiz.php"
click node_quiz_management "https://github.com/nshoron/online_quiz_system/blob/master/teacher/manage_quizzes.php"
click node_teacher_results "https://github.com/nshoron/online_quiz_system/blob/master/teacher/view_results.php"
click node_student_dashboard "https://github.com/nshoron/online_quiz_system/blob/master/student/dashboard.php"
click node_quiz_discovery "https://github.com/nshoron/online_quiz_system/blob/master/student/available_quizzes.php"
click node_quiz_attempt "https://github.com/nshoron/online_quiz_system/blob/master/student/take_quiz.php"
click node_attempt_processing "https://github.com/nshoron/online_quiz_system/blob/master/student/process_quiz_attempt.php"
click node_student_results "https://github.com/nshoron/online_quiz_system/blob/master/student/my_results.php"
click node_result_detail "https://github.com/nshoron/online_quiz_system/blob/master/student/quiz_results.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_login,node_authentication,node_registration,node_registration_handler,node_session_exit toneBlue
class node_teacher_dashboard,node_quiz_authoring,node_quiz_creation,node_quiz_management,node_teacher_results toneAmber
class node_student_dashboard,node_quiz_discovery,node_quiz_attempt,node_attempt_processing,node_student_results,node_result_detail toneMint
class node_database_config,node_schema,node_mysql toneRose
class node_browser toneIndigo
```

## Components

### Identity

- [Login screen](https://github.com/nshoron/online_quiz_system/blob/master/index.php): `index.php`
- [Sign-in handler](https://github.com/nshoron/online_quiz_system/blob/master/auth.php): `auth.php`
- [Registration form](https://github.com/nshoron/online_quiz_system/blob/master/register.php): `register.php`
- [Registration handler](https://github.com/nshoron/online_quiz_system/blob/master/register_process.php): `register_process.php`
- [Logout](https://github.com/nshoron/online_quiz_system/blob/master/logout.php): `logout.php`

### Teacher workflow

- [Teacher dashboard](https://github.com/nshoron/online_quiz_system/blob/master/teacher/dashboard.php): `teacher/dashboard.php`
- [Quiz authoring form](https://github.com/nshoron/online_quiz_system/blob/master/teacher/create_quiz.php): `teacher/create_quiz.php`
- [Quiz creation handler](https://github.com/nshoron/online_quiz_system/blob/master/teacher/process_quiz.php): `teacher/process_quiz.php`
- [Quiz management](https://github.com/nshoron/online_quiz_system/blob/master/teacher/manage_quizzes.php): `teacher/manage_quizzes.php`
- [Teacher results](https://github.com/nshoron/online_quiz_system/blob/master/teacher/view_results.php): `teacher/view_results.php`

### Student workflow

- [Student dashboard](https://github.com/nshoron/online_quiz_system/blob/master/student/dashboard.php): `student/dashboard.php`
- [Available quizzes](https://github.com/nshoron/online_quiz_system/blob/master/student/available_quizzes.php): `student/available_quizzes.php`
- [Timed quiz attempt](https://github.com/nshoron/online_quiz_system/blob/master/student/take_quiz.php): `student/take_quiz.php`
- [Attempt validation and scoring](https://github.com/nshoron/online_quiz_system/blob/master/student/process_quiz_attempt.php): `student/process_quiz_attempt.php`
- [Attempt history](https://github.com/nshoron/online_quiz_system/blob/master/student/my_results.php): `student/my_results.php`
- [Attempt detail](https://github.com/nshoron/online_quiz_system/blob/master/student/quiz_results.php): `student/quiz_results.php`

### Shared data

- [DB and session setup](https://github.com/nshoron/online_quiz_system/blob/master/config.php): `config.php`
- [Quiz data schema](https://github.com/nshoron/online_quiz_system/blob/master/database.sql): `database.sql`
- **MySQL database**

### Other components

- **Teacher or student**

## Connections

- Teacher or student → Login screen: opens (evidence: `README.md`)
- Teacher or student → Registration form: registers (evidence: `README.md`)
- Login screen → Sign-in handler: submits credentials (evidence: `README.md`)
- Registration form → Registration handler: submits registration (evidence: `README.md`)
- Sign-in handler → DB and session setup: queries users (evidence: `auth.php`)
- Registration handler → DB and session setup: checks and stores user (evidence: `register_process.php`)
- Sign-in handler → Teacher dashboard: redirects teacher (evidence: `auth.php`)
- Sign-in handler → Student dashboard: redirects student (evidence: `auth.php`)
- Teacher or student → Logout: logs out (evidence: `README.md`)
- Teacher dashboard → DB and session setup: queries activity (evidence: `teacher/dashboard.php`)
- Teacher or student → Quiz authoring form: authors quiz (evidence: `README.md`)
- Quiz authoring form → Quiz creation handler: submits quiz (evidence: `teacher/create_quiz.php`)
- Quiz creation handler → DB and session setup: stores quiz (evidence: `README.md`)
- Teacher or student → Quiz management: manages quizzes (evidence: `README.md`)
- Quiz management → DB and session setup: deletes and reads quizzes (evidence: `teacher/manage_quizzes.php`)
- Teacher or student → Teacher results: reviews results (evidence: `README.md`)
- Teacher results → DB and session setup: queries attempts (evidence: `teacher/view_results.php`)
- Teacher or student → Student dashboard: views overview (evidence: `README.md`)
- Student dashboard → DB and session setup: queries performance (evidence: `student/dashboard.php`)
- Teacher or student → Available quizzes: finds quizzes (evidence: `README.md`)
- Available quizzes → DB and session setup: reads available quizzes (evidence: `student/available_quizzes.php`)
- Teacher or student → Timed quiz attempt: takes quiz (evidence: `README.md`)
- Timed quiz attempt → DB and session setup: loads quiz (evidence: `README.md`)
- Timed quiz attempt → Attempt validation and scoring: submits answers (evidence: `README.md`)
- Attempt validation and scoring → DB and session setup: validates and stores attempt (evidence: `student/process_quiz_attempt.php`)
- Teacher or student → Attempt history: reviews history (evidence: `README.md`)
- Attempt history → DB and session setup: queries attempts (evidence: `student/my_results.php`)
- Attempt history → Attempt detail: opens details (evidence: `student/my_results.php`)
- Attempt detail → DB and session setup: queries answers (evidence: `student/quiz_results.php`)
- DB and session setup → MySQL database: connects (evidence: `config.php`)
- Quiz data schema → MySQL database: defines tables (evidence: `README.md`)
