# nandana-a-r/automated-handwritten-answer-evaluation-system architecture

> Architecture diagram of the GitHub repository nandana-a-r/automated-handwritten-answer-evaluation-system, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nandana-a-r/automated-handwritten-answer-evaluation-system
- Repository: https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system

## Overview

This Django application supports teacher-managed exams and student submissions, then evaluates handwritten answers and presents marks/results. The main flow runs from the browser through URL routing and view handlers, with exam and answer records persisted in Django models. Evaluation combines image preprocessing, PaddleOCR text extraction, and BERT semantic comparison. The README documents the OCR and BERT capabilities; some implementation details are omitted from the excerpts, so uncertain internal evaluation links are shown as unverified.

Main entry points: [`ans_eval/urls.py`](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/urls.py) (App routes), [`ans_eval/views.py`](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py) (Mark calculation), [`static/js/main.js`](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/static/js/main.js) (Web interface), [`ans_eval/models.py`](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/models.py) (Exam records)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_browser["Web interface<br/>[main.js]"]
  node_templates["Role pages"]
  node_root_routes["Project routes<br/>[urls.py]"]
  node_app_routes["App routes<br/>[urls.py]"]
end

subgraph group_workflow["Exam workflow"]
  node_accounts["Accounts and profiles<br/>[views.py]"]
  node_exam_ops["Exam management<br/>[views.py]"]
  node_answer_upload["Answer submissions<br/>[views.py]"]
  node_results["Marks and results<br/>[views.py]"]
end

subgraph group_evaluation["Answer evaluation"]
  node_evaluation_handler["Mark calculation<br/>[views.py]"]
  node_image_preprocess["Image preprocessing<br/>[views.py]"]
  node_ocr["Handwriting OCR<br/>[views.py]"]
  node_semantic["Semantic comparison<br/>[views.py]"]
end

subgraph group_storage["Persistence"]
  node_records[("Exam records<br/>[models.py]")]
  node_media["Uploaded files"]
end

node_teacher(("Teacher"))
node_student(("Student"))

node_teacher -->|"manages exams"| node_browser
node_student -->|"submits answers"| node_browser
node_browser -.->|"uses pages"| node_templates
node_browser -->|"sends requests"| node_app_routes
node_root_routes -->|"includes routes"| node_app_routes
node_app_routes -->|"routes requests"| node_accounts
node_app_routes -->|"routes requests"| node_exam_ops
node_app_routes -->|"routes requests"| node_answer_upload
node_app_routes -->|"routes requests"| node_evaluation_handler
node_accounts -->|"uses user accounts"| node_records
node_exam_ops -->|"reads and writes"| node_records
node_answer_upload -->|"reads and writes"| node_records
node_exam_ops -->|"stores answer keys"| node_media
node_answer_upload -->|"stores submissions"| node_media
node_evaluation_handler -->|"loads answers"| node_records
node_evaluation_handler -.->|"preprocesses image"| node_image_preprocess
node_image_preprocess -.->|"prepares OCR input"| node_ocr
node_ocr -.->|"compares extracted text"| node_semantic
node_evaluation_handler -.->|"scores similarity"| node_semantic
node_evaluation_handler -->|"returns marks"| node_results
node_results -->|"displays results"| node_browser

click node_browser "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/static/js/main.js"
click node_templates "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/tree/main/templates"
click node_root_routes "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/automated_handwritten_evaluation/urls.py"
click node_app_routes "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/urls.py"
click node_accounts "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_exam_ops "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_answer_upload "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_evaluation_handler "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_image_preprocess "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_ocr "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_semantic "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_results "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py"
click node_records "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/models.py"
click node_media "https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/tree/main/media"

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_browser,node_templates,node_root_routes,node_app_routes toneBlue
class node_accounts,node_exam_ops,node_answer_upload,node_results toneAmber
class node_evaluation_handler,node_image_preprocess,node_ocr,node_semantic toneMint
class node_records,node_media toneRose
class node_teacher,node_student toneIndigo
```

## Components

### Web experience

- [Web interface](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/static/js/main.js): `static/js/main.js`
- [Role pages](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/tree/main/templates): `templates`
- [Project routes](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/automated_handwritten_evaluation/urls.py): `automated_handwritten_evaluation/urls.py`
- [App routes](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/urls.py): `ans_eval/urls.py`

### Exam workflow

- [Accounts and profiles](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`
- [Exam management](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`
- [Answer submissions](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`
- [Marks and results](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`

### Answer evaluation

- [Mark calculation](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`
- [Image preprocessing](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`
- [Handwriting OCR](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`
- [Semantic comparison](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/views.py): `ans_eval/views.py`

### Persistence

- [Exam records](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/blob/main/ans_eval/models.py): `ans_eval/models.py`
- [Uploaded files](https://github.com/nandana-a-r/automated-handwritten-answer-evaluation-system/tree/main/media): `media`

### Other components

- **Teacher**
- **Student**

## Connections

- Teacher → Web interface: manages exams (evidence: `README.md`)
- Student → Web interface: submits answers (evidence: `README.md`)
- Web interface → Role pages: uses pages
- Web interface → App routes: sends requests (evidence: `static/js/main.js`)
- Project routes → App routes: includes routes (evidence: `automated_handwritten_evaluation/urls.py`)
- App routes → Accounts and profiles: routes requests (evidence: `ans_eval/urls.py`)
- App routes → Exam management: routes requests (evidence: `ans_eval/urls.py`)
- App routes → Answer submissions: routes requests (evidence: `ans_eval/urls.py`)
- App routes → Mark calculation: routes requests (evidence: `ans_eval/urls.py`)
- Accounts and profiles → Exam records: uses user accounts (evidence: `ans_eval/views.py`)
- Exam management → Exam records: reads and writes (evidence: `ans_eval/views.py`)
- Answer submissions → Exam records: reads and writes (evidence: `ans_eval/views.py`)
- Exam management → Uploaded files: stores answer keys (evidence: `ans_eval/views.py`)
- Answer submissions → Uploaded files: stores submissions (evidence: `ans_eval/views.py`)
- Mark calculation → Exam records: loads answers (evidence: `ans_eval/views.py`)
- Mark calculation → Image preprocessing: preprocesses image (evidence: `ans_eval/views.py`)
- Image preprocessing → Handwriting OCR: prepares OCR input (evidence: `ans_eval/views.py`)
- Handwriting OCR → Semantic comparison: compares extracted text (evidence: `ans_eval/views.py`)
- Mark calculation → Semantic comparison: scores similarity (evidence: `ans_eval/views.py`)
- Mark calculation → Marks and results: returns marks (evidence: `ans_eval/views.py`)
- Marks and results → Web interface: displays results (evidence: `static/js/main.js`)
