A comprehensive MCA Project built with Flask for secure online examinations. It supports both local login (username/password) and Google Account login for convenience and enhanced security.
The system provides role-based dashboards for Admins and Students, ensuring seamless exam management and participation.
Live Demo: https://sameeralam3127.pythonanywhere.com/
See the Screenshots & Architecture for more details.
- Dashboard – Overview of users, exams, and results
- User Management – Add/edit/delete users; assign exams
- Exam Management – Create, edit, and control exam availability
- Reports & Analytics – View, filter, and export performance data
- Dashboard – List of available and completed exams
- Exam Taking – Timer-based, auto-submission, real-time scoring
- Result Review – Detailed breakdown of performance
- Local Login (username + password)
- Google Account Login (OAuth 2.0)
- Passwords hashed via Werkzeug
- Flask-Login for session management
- Role-based access control for Admins and Students
- Built with Bootstrap 5 for responsive, mobile-friendly layouts
- Modern components, modals, and interactive progress bars
- Toast notifications and user-friendly feedback
- User – Authentication, roles, Google account info
- Exam – Exam structure, total marks, duration
- Question – MCQs with options and correct answers
- ExamResult – Stores student exam attempts and scores
- UserAnswer – Tracks selected answers per question
- Flask (Backend)
- Flask-Login (Authentication)
- Flask-Dance (Google OAuth)
- SQLite / SQLAlchemy (Database ORM)
- Bootstrap 5 (Frontend)
git clone https://github.com/sameeralam3127/SecureExamPortal.git
cd SecureExamPortalUsing Poetry (recommended):
/bin/bash -c "$(curl -sSL https://install.python-poetry.org)"
export PATH="$HOME/.local/bin:$PATH"
poetry install
poetry shellOr with venv:
python -m venv venv
source venv/bin/activate # (Windows: venv\Scripts\activate)
pip install -r requirements.txtCreate a .env file in the project root (SecureExamPortal/.env) with the following variables:
# Flask Secret
FLASK_SECRET_KEY=your_random_secret_key_here
# Google OAuth Credentials
GOOGLE_CLIENT_ID=your_google_client_id_here
GOOGLE_CLIENT_SECRET=your_google_client_secret_here
⚠️ Make sure to enable the Google OAuth API in your Google Cloud Console and set your Authorized redirect URIs as:http://localhost:5000/login/google/authorized http://127.0.0.1:5000/login/google/authorized
python run.pyThen open your browser at: 👉 http://127.0.0.1:5000
Default credentials:
- Admin:
admin / admin123 - Student:
student1 / student123
-
Click “Sign in with Google” on the login page
-
Approve access via your Google Account
-
On success:
- A user is created automatically (if new)
- You’re redirected to your Admin or Student dashboard
- Custom error pages (
404,500) - Session expiry notifications
- Safe database relationships with cascade delete
- Randomized question sets
- Bulk student import (CSV)
- Real-time analytics dashboard
- Email notifications and PDF report exports
- Docker + CI/CD deployment
We welcome contributions! See CONTRIBUTING.md for pull request workflow and issue guidelines.
Report vulnerabilities privately through SECURITY.md.
Licensed under the MIT License. See LICENSE for more information.