Web application for creating paper-based tests (generated from LaTeX templates) and automatically grading scanned answer sheets using image processing and ML.
The project was built to keep the practical advantages of paper exams while reducing the time cost and human error of manual grading.
- Create and manage LaTeX templates used to generate exam PDFs.
- Templates must include required placeholders:
{HEADER}- header with encoded unique test identifier + student index{ANSWER_FORM}- answer sheet area{QUESTIONS}- questions content
- Manage the question bank:
- create / edit / delete questions
- organize them with labels / categories for easier filtering and reuse
- Configure test parameters, including:
- template used
- number of questions
- question selection rules (e.g. by label or category)
- layout settings (e.g. visible date or question grouping)
- Generate sets of exam PDFs. Download a
.zipcontaining:generated_tests/(PDFs of generated exams)answer sheetPDF(s)- optional
blank "backup" answer sheet
- Configure marking strategy per test:
- All-or-nothing - full points only if all correct answers are selected and no incorrect answers
- Partially correct - points based on correct answers; incorrect answers reduce the score
- Define your own grade thresholds per test
- Upload completed tests as:
- individual images
- archives where each folder corresponds to one filled test
- PDFs with pages of filled tests
- Automatic grading pipeline includes:
- orientation correction
- reading the encoded test identifier
- recognizing handwritten student index number using a trained neural network
- extracting marked answers and checking correctness (2 available methods):
- Canny edge-based detection
- pixel-intensity analysis
- UI supports results visualization and manual grading adjustments
- Exports an annotated PDF of each graded answer sheet (detected answers & per-question score and flags)
- Optional scan denoising using a trained Restormer model
- Python - single-language architecture
- Django - auth, ORM, admin, signals, class-based view mixins
- Bootstrap 5 - responsive layout and UI components
- JavaScript - interactive UI (dynamic forms, validation, DataTables views, Chart.js results, upload UX)
- LaTeX - template-driven PDF exam generation
- OpenCV - scan preprocessing (rotation/orientation correction, region detection, extraction)
- InceptionResNetV2 - handwritten digit recognition (student index)
- Restormer - optional scan denoising
- Python 3.x + pip
- A LaTeX distribution (for PDF generation;
pdflatex/xelatexdepending on your implementation) - System packages needed by OpenCV (varies by OS)
# Create venv
python -m venv .venv
# (Windows: .venv\Scripts\activate)
source .venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Migrate DB
python manage.py migrate
# Create admin superuser (optional)
python manage.py createsuperuser
# Run server
python manage.py runserver- InceptionResNetV2 - handwritten numbers recognition
- Restormer - scan restoration / denoising











