How aditya-1123/full-fledged-online-examination-system works
Project Type and Purpose
• This is a full-stack web application, specifically an Online Examination System built with Python and Django.
• It provides three user-facing domains (Student, Teacher, Admin) plus shared “exam” management logic.
• Data persistence is handled by SQLite; front-end rendering by Django templates (HTML/CSS/Bootstrap).
High-Level Architecture & File-Structure Analysis
• Top-level “onlinexam” folder: the Django project root containing settings.py, URL dispatcher, WSGI/ASGI entry points.
• Three Django apps under root:
• exam/ ← shared exam-management models, views, forms, admin hooks
• student/ ← student-specific URL routes, views, forms, templates
• teacher/ ← teacher-specific routes, views, forms, templates
• templates/ folder: grouped subfolders for exam/, student/, teacher/ – holds HTML templates.
• static/ folder: images, profile pics, CSS, JS (if any) served as static assets.
• db.sqlite3: single-file relational database.
• manage.py: CLI entry to runserver, migrations, shell, etc.
Core Components
a. Clients (Browser)
• Student UI
• Teacher UI
• Admin UI (leveraging Django’s built-in admin or custom admin templates)
b. Web Server & Request Pipeline
• Django WSGI/ASGI server (e.g., Gunicorn/Uvicorn + Nginx in production)
• URL Dispatcher → app-specific routers (student.urls, teacher.urls, exam/views, onlinexam/urls)
• View logic (class- and function-based views in each app)
c. Business Logic Layer (Django Apps)
• exam app: Models for Course, Question, Result; Forms for question creation/test taking; Views for admin workflows
• student app: Models (Student profile extension), Views for exam participation, result viewing
• teacher app: Models (Teacher profile extension), Views for question/exam creation, salary requests
d. Data Layer
• SQLite database with tables auto-generated from models and migrations
• Migrations subfolders to show schema evolution
e. Static/Template Layer
• Template engine rendering HTML + Bootstrap
• Static files served by Django’s staticfiles module (or CDN/webserver)
Relationships & Data Flows
• User (Student/Teacher/Admin) → HTTP(S) Request → Nginx (optional) → Gunicorn/Uvicorn → Django WSGI/ASGI
• Django → URL router (onlinexam/urls.py) → Dispatch to student.urls / teacher.urls / exam.views → View
• View → ORM call → SQLite → result set → business logic → Template context → Rendered HTML
• View POST (form submission) → Form validation → ORM write (new Question/ExamAttempt/Result) → Redirect/JSON response
• Static asset request → Django staticfiles (or webserver) → Browser
Architectural Patterns & Design Principles
• MVC (Model-View-Template) / MVT (Django variant) separation of concerns
• Modularization by domain: three Django apps for clear code ownership
• Reuse: “exam” app houses shared exam business logic; student & teacher apps import and extend the same models/forms
• Declarative URL configuration promotes loose coupling between endpoints and handlers
• Use of migrations ensures versioned, repeatable schema changes