# dinesh-v11/hebcoss-techquiz architecture

> Architecture diagram of the GitHub repository dinesh-v11/hebcoss-techquiz, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dinesh-v11/hebcoss-techquiz
- Repository: https://github.com/dinesh-v11/hebcoss-techquiz

## Overview

HebCoss TechQuiz is a PHP/MySQL platform for timed, team-based quiz competitions. Teams enter through the landing page, authenticate, answer a question bank while the server tracks time and saves selections, and submit for server-side scoring and results. Browser focus violations feed a warning endpoint that can block a team; administrators manage teams and view a ranked leaderboard. The excerpts show quiz, scoring, authentication, answer-save, warning, and database interactions. Some admin storage wiring and the database schema are documented but not excerpted, so those links are marked unverified.

Main entry points: [`quiz.php`](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/quiz.php) (Timed quiz), [`quiz_event_setup.sql`](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/quiz_event_setup.sql) (Quiz database), [`login.php`](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/login.php) (Team authentication), [`submit.php`](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/submit.php) (Submission and scoring)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and identity"]
  node_home["Landing page<br/>[index &#40;1&#41;.php]"]
  node_team_auth["Team authentication<br/>[login.php]"]
  node_session_exit["Logout<br/>[logout.php]"]
end

subgraph group_competition["Quiz competition"]
  node_question_bank["Question bank<br/>[questions &#40;1&#41;.php]"]
  node_quiz_runtime["Timed quiz<br/>[quiz.php]"]
  node_answer_saver["Answer autosave<br/>[save_answers.php]"]
  node_anti_cheat["Warning enforcement<br/>[warn.php]"]
  node_scoring["Submission and scoring<br/>[submit.php]"]
  node_dq_page["Disqualification notice<br/>[disqualified.php]"]
end

subgraph group_oversight["Administration"]
  node_admin_console["Admin dashboard<br/>[admin.php]"]
end

subgraph group_persistence["Persistence"]
  node_db_config["Database connection config<br/>[db.example.php]"]
  node_quiz_db[("Quiz database")]
end

node_participant(("Team participant"))
node_admin_user(("Event administrator"))

node_participant -->|"opens"| node_home
node_home -->|"links to"| node_team_auth
node_participant -->|"authenticates"| node_team_auth
node_team_auth -->|"routes active teams"| node_quiz_runtime
node_team_auth -->|"routes blocked teams"| node_dq_page
node_team_auth -->|"routes completed teams"| node_scoring
node_quiz_runtime -->|"renders questions"| node_question_bank
node_quiz_runtime -->|"posts answers"| node_answer_saver
node_quiz_runtime -->|"posts warnings"| node_anti_cheat
node_quiz_runtime -->|"submits quiz"| node_scoring
node_quiz_runtime -->|"routes blocked teams"| node_dq_page
node_scoring -->|"checks answer key"| node_question_bank
node_participant -->|"requests logout"| node_session_exit
node_session_exit -->|"redirects to"| node_home
node_admin_user -->|"manages event"| node_admin_console
node_admin_console -.->|"reads and updates teams"| node_quiz_db
node_quiz_runtime -->|"reads timer and answers"| node_quiz_db
node_answer_saver -->|"writes answers"| node_quiz_db
node_anti_cheat -->|"updates warning status"| node_quiz_db
node_scoring -->|"reads answers and saves score"| node_quiz_db
node_team_auth -->|"checks credentials and status"| node_quiz_db
node_dq_page -->|"checks team status"| node_quiz_db
node_db_config -.->|"connects to"| node_quiz_db

click node_home "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/index%20(1).php"
click node_team_auth "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/login.php"
click node_session_exit "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/logout.php"
click node_question_bank "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/questions%20(1).php"
click node_quiz_runtime "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/quiz.php"
click node_answer_saver "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/save_answers.php"
click node_anti_cheat "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/warn.php"
click node_scoring "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/submit.php"
click node_dq_page "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/disqualified.php"
click node_admin_console "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/admin.php"
click node_db_config "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/db.example.php"
click node_quiz_db "https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/quiz_event_setup.sql"

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_home,node_team_auth,node_session_exit toneBlue
class node_question_bank,node_quiz_runtime,node_answer_saver,node_anti_cheat,node_scoring,node_dq_page toneAmber
class node_admin_console toneMint
class node_db_config,node_quiz_db toneRose
class node_participant,node_admin_user toneIndigo
```

## Components

### Entry and identity

- [Landing page](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/index%20(1).php): `index (1).php`
- [Team authentication](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/login.php): `login.php`
- [Logout](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/logout.php): `logout.php`

### Quiz competition

- [Question bank](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/questions%20(1).php): `questions (1).php`
- [Timed quiz](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/quiz.php): `quiz.php`
- [Answer autosave](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/save_answers.php): `save_answers.php`
- [Warning enforcement](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/warn.php): `warn.php`
- [Submission and scoring](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/submit.php): `submit.php`
- [Disqualification notice](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/disqualified.php): `disqualified.php`

### Administration

- [Admin dashboard](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/admin.php): `admin.php`

### Persistence

- [Database connection config](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/db.example.php): `db.example.php`
- [Quiz database](https://github.com/dinesh-v11/hebcoss-techquiz/blob/main/quiz_event_setup.sql): `quiz_event_setup.sql`

### Other components

- **Team participant**
- **Event administrator**

## Connections

- Team participant → Landing page: opens (evidence: `README.md`)
- Landing page → Team authentication: links to (evidence: `index (1).php`)
- Team participant → Team authentication: authenticates (evidence: `login.php`)
- Team authentication → Timed quiz: routes active teams (evidence: `login.php`)
- Team authentication → Disqualification notice: routes blocked teams (evidence: `login.php`)
- Team authentication → Submission and scoring: routes completed teams (evidence: `login.php`)
- Timed quiz → Question bank: renders questions (evidence: `README.md`)
- Timed quiz → Answer autosave: posts answers (evidence: `quiz.php`)
- Timed quiz → Warning enforcement: posts warnings (evidence: `quiz.php`)
- Timed quiz → Submission and scoring: submits quiz (evidence: `quiz.php`)
- Timed quiz → Disqualification notice: routes blocked teams (evidence: `quiz.php`)
- Submission and scoring → Question bank: checks answer key (evidence: `submit.php`)
- Team participant → Logout: requests logout
- Logout → Landing page: redirects to (evidence: `logout.php`)
- Event administrator → Admin dashboard: manages event (evidence: `README.md`)
- Admin dashboard → Quiz database: reads and updates teams
- Timed quiz → Quiz database: reads timer and answers (evidence: `quiz.php`)
- Answer autosave → Quiz database: writes answers (evidence: `save_answers.php`)
- Warning enforcement → Quiz database: updates warning status (evidence: `warn.php`)
- Submission and scoring → Quiz database: reads answers and saves score (evidence: `submit.php`)
- Team authentication → Quiz database: checks credentials and status (evidence: `login.php`)
- Disqualification notice → Quiz database: checks team status (evidence: `disqualified.php`)
- Database connection config → Quiz database: connects to
