# rishank-shah/exam-portal architecture

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

- Interactive diagram: https://gitdiagram.com/rishank-shah/exam-portal
- Repository: https://github.com/rishank-shah/exam-portal

## Overview

Exam Portal is a Django application for faculty to create exams and students to take them and view results. The main workflow is faculty-authored questions and papers assembled into scheduled exams, followed by student submissions, score calculation, and result viewing. Separate capabilities include account registration and verification, faculty authorization, login preferences, and professor email alerts for repeated window-focus changes. The graph reflects the sampled code and README; some client-side timer and focus behavior is documented but its implementation was not sampled.

Main entry points: [`Exam/questions/views.py`](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py) (Exam attempt and scoring), [`Exam/questions/questionpaper_models.py`](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/questionpaper_models.py) (Question papers), [`Exam/student/views.py`](https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/views.py) (Student accounts), [`Exam/faculty/views.py`](https://github.com/rishank-shah/exam-portal/blob/main/Exam/faculty/views.py) (Faculty accounts)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_accounts["Accounts and access"]
  node_student_accounts["Student accounts<br/>[views.py]"]
  node_faculty_accounts["Faculty accounts<br/>[views.py]"]
  node_student_profile[("Student profile<br/>[models.py]")]
  node_faculty_profile[("Faculty profile<br/>[models.py]")]
end

subgraph group_authoring["Exam authoring"]
  node_question_bank[("Question bank<br/>[question_models.py]")]
  node_question_papers[("Question papers")]
  node_exam_setup[("Exam setup<br/>[models.py]")]
  node_exam_management["Exam management<br/>[views.py]"]
end

subgraph group_participation["Exam participation"]
  node_student_exam_views["Exam listings<br/>[views.py]"]
  node_exam_taking["Exam attempt and scoring<br/>[views.py]"]
  node_student_records[("Attempts and results<br/>[models.py]")]
  node_results_views["Result viewing<br/>[views.py]"]
  node_exam_client_behavior["Timer and focus behavior"]
  node_alert_api["Professor alert API<br/>[api.py]"]
end

subgraph group_preferences["Student preferences"]
  node_preferences_views["Preference settings<br/>[views.py]"]
  node_preferences_store[("Login email preference<br/>[models.py]")]
end

node_student_actor(("Student"))
node_faculty_actor(("Faculty"))
node_admin_actor(("Administrator"))
node_email_service["Email service"]

node_student_actor -->|"registers or logs in"| node_student_accounts
node_student_accounts -->|"saves profile"| node_student_profile
node_student_actor -->|"registers or logs in"| node_faculty_accounts
node_faculty_accounts -->|"saves profile"| node_faculty_profile
node_admin_actor -->|"grants access"| node_faculty_accounts
node_faculty_actor -->|"manages exams"| node_exam_management
node_exam_management -->|"creates questions"| node_question_bank
node_exam_management -->|"creates papers"| node_question_papers
node_exam_management -->|"creates exams"| node_exam_setup
node_question_papers -->|"includes questions"| node_question_bank
node_exam_setup -->|"selects paper"| node_question_papers
node_student_actor -->|"browses exams"| node_student_exam_views
node_student_exam_views -->|"checks attempts"| node_student_records
node_student_actor -->|"submits answers"| node_exam_taking
node_exam_taking -->|"loads exam"| node_exam_setup
node_exam_taking -->|"loads questions"| node_question_papers
node_exam_taking -->|"saves answers and score"| node_student_records
node_student_actor -->|"views result"| node_results_views
node_results_views -->|"reads score"| node_student_records
node_exam_client_behavior -.->|"submits on timeout"| node_exam_taking
node_exam_client_behavior -.->|"reports focus changes"| node_alert_api
node_alert_api -->|"emails professor"| node_email_service
node_student_actor -->|"changes preferences"| node_preferences_views
node_preferences_views -->|"reads and saves"| node_preferences_store
node_student_accounts -->|"checks email setting"| node_preferences_store
node_preferences_store -.->|"controls login email"| node_email_service

click node_student_accounts "https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/views.py"
click node_faculty_accounts "https://github.com/rishank-shah/exam-portal/blob/main/Exam/faculty/views.py"
click node_student_profile "https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/models.py"
click node_faculty_profile "https://github.com/rishank-shah/exam-portal/blob/main/Exam/faculty/models.py"
click node_question_bank "https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/question_models.py"
click node_question_papers "https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/questionpaper_models.py"
click node_exam_setup "https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/models.py"
click node_exam_management "https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py"
click node_student_exam_views "https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py"
click node_exam_taking "https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py"
click node_student_records "https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/models.py"
click node_results_views "https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py"
click node_exam_client_behavior "https://github.com/rishank-shah/exam-portal/tree/main/Exam/student"
click node_alert_api "https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/api.py"
click node_preferences_views "https://github.com/rishank-shah/exam-portal/blob/main/Exam/studentPreferences/views.py"
click node_preferences_store "https://github.com/rishank-shah/exam-portal/blob/main/Exam/studentPreferences/models.py"

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_student_accounts,node_faculty_accounts,node_student_profile,node_faculty_profile toneBlue
class node_question_bank,node_question_papers,node_exam_setup,node_exam_management toneAmber
class node_student_exam_views,node_exam_taking,node_student_records,node_results_views,node_exam_client_behavior,node_alert_api toneMint
class node_preferences_views,node_preferences_store toneRose
class node_student_actor,node_faculty_actor,node_admin_actor,node_email_service toneIndigo
```

## Components

### Accounts and access

- [Student accounts](https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/views.py): `Exam/student/views.py`
- [Faculty accounts](https://github.com/rishank-shah/exam-portal/blob/main/Exam/faculty/views.py): `Exam/faculty/views.py`
- [Student profile](https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/models.py): `Exam/student/models.py`
- [Faculty profile](https://github.com/rishank-shah/exam-portal/blob/main/Exam/faculty/models.py): `Exam/faculty/models.py`

### Exam authoring

- [Question bank](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/question_models.py): `Exam/questions/question_models.py`
- [Question papers](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/questionpaper_models.py): `Exam/questions/questionpaper_models.py`
- [Exam setup](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/models.py): `Exam/questions/models.py`
- [Exam management](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py): `Exam/questions/views.py`

### Exam participation

- [Exam listings](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py): `Exam/questions/views.py`
- [Exam attempt and scoring](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py): `Exam/questions/views.py`
- [Attempts and results](https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/models.py): `Exam/student/models.py`
- [Result viewing](https://github.com/rishank-shah/exam-portal/blob/main/Exam/questions/views.py): `Exam/questions/views.py`
- [Timer and focus behavior](https://github.com/rishank-shah/exam-portal/tree/main/Exam/student): `Exam/student`
- [Professor alert API](https://github.com/rishank-shah/exam-portal/blob/main/Exam/student/api.py): `Exam/student/api.py`

### Student preferences

- [Preference settings](https://github.com/rishank-shah/exam-portal/blob/main/Exam/studentPreferences/views.py): `Exam/studentPreferences/views.py`
- [Login email preference](https://github.com/rishank-shah/exam-portal/blob/main/Exam/studentPreferences/models.py): `Exam/studentPreferences/models.py`

### Other components

- **Student**
- **Faculty**
- **Administrator**
- **Email service**

## Connections

- Student → Student accounts: registers or logs in (evidence: `Exam/student/views.py`)
- Student accounts → Student profile: saves profile (evidence: `Exam/student/views.py`)
- Student → Faculty accounts: registers or logs in (evidence: `Exam/faculty/views.py`)
- Faculty accounts → Faculty profile: saves profile (evidence: `Exam/faculty/views.py`)
- Administrator → Faculty accounts: grants access
- Faculty → Exam management: manages exams (evidence: `Exam/questions/views.py`)
- Exam management → Question bank: creates questions (evidence: `Exam/questions/views.py`)
- Exam management → Question papers: creates papers (evidence: `Exam/questions/views.py`)
- Exam management → Exam setup: creates exams (evidence: `Exam/questions/views.py`)
- Question papers → Question bank: includes questions (evidence: `Exam/questions/questionpaper_models.py`)
- Exam setup → Question papers: selects paper (evidence: `Exam/questions/models.py`)
- Student → Exam listings: browses exams (evidence: `Exam/questions/views.py`)
- Exam listings → Attempts and results: checks attempts (evidence: `Exam/questions/views.py`)
- Student → Exam attempt and scoring: submits answers (evidence: `Exam/questions/views.py`)
- Exam attempt and scoring → Exam setup: loads exam (evidence: `Exam/questions/views.py`)
- Exam attempt and scoring → Question papers: loads questions (evidence: `Exam/questions/views.py`)
- Exam attempt and scoring → Attempts and results: saves answers and score (evidence: `Exam/questions/views.py`)
- Student → Result viewing: views result (evidence: `Exam/questions/views.py`)
- Result viewing → Attempts and results: reads score (evidence: `Exam/questions/views.py`)
- Timer and focus behavior → Exam attempt and scoring: submits on timeout (evidence: `Exam/questions/views.py`)
- Timer and focus behavior → Professor alert API: reports focus changes (evidence: `Exam/student/urls.py`)
- Professor alert API → Email service: emails professor (evidence: `Exam/student/api.py`)
- Student → Preference settings: changes preferences (evidence: `Exam/studentPreferences/views.py`)
- Preference settings → Login email preference: reads and saves (evidence: `Exam/studentPreferences/views.py`)
- Student accounts → Login email preference: checks email setting (evidence: `Exam/student/views.py`)
- Login email preference → Email service: controls login email
