SmartExam System

Online examination platform featuring role-based secure access, timed exam lifecycles, and a high-performance automated grading engine.

SmartExam System

Technologies Used

React.jsSpring BootJava 17MavenViteREST APIsMongoDBSpring Data MongoDBSpring SecurityJWT (JSON Web Tokens)Axios InterceptorsTailwind CSS

Problem

Traditional examination processes suffer from security vulnerabilities, session handling issues during long tests, and grading inefficiencies. Evaluating exam responses manually—especially free-text short answers and proportional partial credit multiple-choice questions—is time-consuming, subjective, and prone to human error.

Solution

SmartExam centralizes the full exam lifecycle by combining secure role-based controls, course enrollment tracking, and a real-time exam session manager. The platform runs a high-throughput Java-based **AutoMarking Engine** that evaluates multiple question styles dynamically with granular criteria (including proportional partial marking for multiple-choice questions and threshold-based keyword matching for short-answer questions).

Results and Impact

  • Consolidated System Architecture: Integrated 12 backend modules and 8 MongoDB collections to model courses, questions, enrollment, timed exams, and student results.
  • Zero Grading Latency: Automated evaluation delivers instantaneous grading sheets, letter marks, and email updates to students immediately upon exam submission.
  • Session Security & Reliability: Secured user sessions with silent token rotation to ensure active test-takers do not face abrupt expirations during exam sessions.

Challenges & Resolutions

  • Silent Token Rotation: Implemented a custom Axios interceptor sequence in the client that automatically intercepts a `401 Unauthorized` response, requests a new access token via a refresh token, and replays the failed request transparently.
  • Exam Time Synchronization & Autosave: Designed a robust state system that synchronizes client timers with database bounds, automatically saving student responses periodically (autosave) and auto-submitting the exam on session timeout to prevent out-of-time edits.
  • Fuzzy Keyword Evaluation: Wrote clean algorithms in `AutoMarkingService.java` to perform case-insensitive keyword density matching on short answers (providing half-credit for matching a secondary set of keywords).

Key Features

JWT & Axios Interceptors

Role-aware routing (Admin, Student, Instructor) backed by short-lived JWTs and Axios interceptors for transparent token refresh.

Timed Exam Sessions

Client-side countdown timers aligned with backend constraint checks, supporting automated submission and persistent state saving (autosave).

Granular Automated Marking

Java-based grading strategies mapping MCQ, True/False, Multiple Choice (proportional partial credit), and Short Answer (keyword density) dynamically.

Course Management

Enrolls students into active sections and filters access control, ensuring students only view and take exams for courses they belong to.

SMTP Email Notifications

Verification codes, password recovery flows, and grading notifications delivered instantly via Gmail SMTP integration.

Instructor Dashboards

Dynamic analytical panels representing class average marks, grade curves, and question statistics.

Technical Implementation & Architecture

Frontend Presentation Layer

Created with React using Vite and Tailwind CSS. State management handles JWT validation, role-based view filters, and exam lifecycle events. Communications are handled through a configured Axios instance attaching token cookies and headers.

Backend Core Layer

A modular Spring Boot application written in Java 17 and structured into 12 core services including user management, courses, question banks, timed exam attempts, notifications, and auto-marking. Secured using custom filter middleware, route authorization guards, and password hashing.

Data Storage Schema

Data persistence is handled by a MongoDB document database. Document references structure relationships across collections:

  • User: Stores basic details, hashed credentials, roles, and course memberships.
  • Course: Holds code, title, sections, and mappings of student enrollments.
  • Question: Stores type, details, correct choices, and short-answer keyword lists.
  • Exam: Declares settings, schedules, time limits, and points.
  • ExamQuestion: Maps specific questions into scheduled exams.
  • StudentAnswer: Stores answer state, saving snapshots during timed tests.
  • Result / MarkingResult: Contains final scores, letter grades, and auto-marking breakdowns.

Project Links

Explore the codebase or visit the live deployment of the platform.