How adigunsherif/cbt works
Project type and purpose
• This is a full-stack Django web application implementing a Computer-Based Testing (CBT) system.
• Its primary purpose is to allow administrators to create exams, manage question banks, assign exams to students, auto-time and submit tests, and display student scores.
File structure
• Top-level directories:
• apps/core – “core” business logic (users, sessions/terms, staff/student lists)
• apps/exam – exam functionality (questions, assignments, take-test flows, scoring)
• cbt – Django project settings (asgi.py, wsgi.py, settings.py, urls.py)
• static – vendor-provided assets (Bootstrap, jQuery, Summernote, FontAwesome, etc.)
• templates – project-level HTML templates (base.html, dashboard.html, error pages)
• Configuration/build files: manage.py, requirements.txt, .env example, flake8/.isort configs
• Patterns:
• MVC/MVT pattern with Django apps separating views, models, forms, templates
• Use of Django middleware and context processors for cross-cutting concerns
• Database migrations under each app
• Modular “apps” approach (core vs exam)
README for additional insights
• Tech stack: Django 4, Bootstrap 5, Summernote, FontAwesome, jQuery
• Features: timezone awareness, unlimited exams/questions, question bank, auto timeout/submit, configurable options
Main components of the system
a. Client (browser/mobile browser) – renders HTML/CSS/JS, interacts via HTTP(S)
b. Web Server & Application Server – e.g., Nginx (static files) + Gunicorn/Uvicorn (Django ASGI/WSGI)
c. Django Application – cbt project + two apps (core, exam)
d. Template Engine & Static Assets – HTML templates, Bootstrap, Summernote, jQuery, FontAwesome
e. Database – relational DB (PostgreSQL/MySQL/SQLite via Django ORM)
f. External/Infrastructure services (optional) – caching layer (Redis/Memcached), email/SMTP, environment variables
Relationships & interactions
• Browser → HTTP Request → Web Server → Django URL dispatcher → view (apps/core or apps/exam) → ORM → Database → view → Template → HTTP Response → Browser
• Middleware & context processors intercept requests/responses for authentication, settings, etc.
• Static assets served directly by Web Server or via Django’s static files handler.
• Migrations update DB schema; tests exercise models/views.
Architectural patterns & design principles
• Django’s MVT (Model-View-Template) pattern
• Separation of concerns via “apps”
• Reusable components (forms, filters, context processors, middleware)
• Configurable settings via .env and Django settings.py
• Modular and layered: presentation (templates/static), business logic (views/forms), data (models/ORM)
Relevant technologies/frameworks/libraries
• Django 4 framework
• Python packages from requirements.txt
• Bootstrap 5 (CSS grid, components)
• Summernote rich-text editor integration
• jQuery & countdown plugin for timing
• Optional caching (Redis/Memcached) and reverse proxy (Nginx)