A Next-Generation AI-Powered Examination Platform Seamlessly connecting Faculty and Students with the power of Generative AI.
Experience the platform live on Render:
| Portal | URL | Credentials |
|---|---|---|
| Faculty Dashboard | https://faculty-quiz-portal.onrender.com | admin / admin123 |
| Student Portal | https://student-quiz-portal.onrender.com | (No Login Required) |
| Backend | https://quiz-backend-cdxz.onrender.com | (No Login Required) |
- Overview
- Key Features
- Architecture
- Tech Stack
- Project Structure
- Installation & Setup
- Running Locally
- LAN / Lab Access
- Deployment
- API Reference
- Troubleshooting & FAQ
- License
The Smart Quiz System is a hybrid examination platform designed to modernize the academic assessment process. It eliminates the tedious task of manual question creation by leveraging Google Gemini AI to generate technical questions directly from syllabus documents (text or PDF).
The platform consists of three independently deployable services:
- Backend API β Spring Boot REST server handling all business logic, data, and AI integration.
- Faculty Web Portal β A feature-rich dashboard for uploading syllabi, generating questions, managing sessions, and viewing analytics.
- Student Web Portal β A secure, anti-cheating quiz interface accessible on any device via a browser.
- Instant Question Generation β Paste syllabus text or upload PDFs to generate structured MCQs via Google Gemini.
- Syllabus Analysis β AI-powered analysis endpoint to extract topics and structure from syllabus content.
- Intelligent Mapping β AI maps each question to Chapters and Course Outcomes (CO).
- Bloom's Taxonomy β Generates Conceptual, Application, and Analysis-level questions.
- Configurable Weights β Faculty can set topic-level weights to control question distribution.
- Session Management β Create secure sessions with unique Session IDs & auto-generated OTPs.
- JWT Authentication β Secure login with access/refresh tokens and token blacklisting on logout.
- Live Scoreboard β Real-time scoreboard showing student progress, scores, question sets, and cheat flags.
- Question Editing β Review and modify AI-generated questions before the exam.
- Manual Question Creation β Add custom questions alongside AI-generated ones.
- CO Analytics β Aggregated session analytics with per-CO and per-student performance breakdowns.
- Admin Panel β Onboard new faculty accounts with password validation.
- Dark Theme UI β Modern dark navy theme with glassmorphism effects, custom icons, and responsive layout.
- Zero Registration β Quick entry using Name, Enrollment ID, Session ID, and OTP.
- Anti-Cheating Suite:
- Tab-Switch Detection β Flags attempts to leave the exam window.
- Randomized Question Sets β Multiple shuffled sets (A, B, C...) assigned by student ID.
- Timer Enforcement β Server-side time validation prevents late submissions.
- Cheat Flagging β Cheating students are marked and scored zero.
- State Recovery β Uses
sessionStorageso students don't lose work on page refresh. - Auto-Recovery β If the server restarts mid-exam, students can still submit and their identity is recovered.
- Modular Codebase β Clean separation into
api.js,app.js,auth.js,components.js,utils.js.
The system uses a 3-service architecture β each component is a standalone static or application server:
ββββββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββ
β Faculty Web Portal β β Student Web Portal β
β (Static HTML/JS/CSS) β β (Static HTML/JS/CSS) β
β Served on Port 9876 β β Served on Port 8080 β
ββββββββββββββββ¬ββββββββββββββββ ββββββββββββββββ¬ββββββββββββββββ
β REST API (JWT Auth) β REST API
βΌ βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β BACKEND SERVER (Spring Boot) β
β Port 9090 β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββββββ β
β β Controllers β β Services β β Config / Security β β
β β (REST API) β β (Business) β β (JWT, CORS, DataInit) β β
β ββββββββ¬ββββββββ ββββββββ¬ββββββββ ββββββββββββ¬ββββββββββββββββ β
β β β β β
β βΌ βΌ βΌ β
β [ H2 Database ] [ Session Mgr ] [ Google Gemini AI ] β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Technology |
|---|---|
| Backend | Java 17, Spring Boot 3.0, Spring Security, Spring Data JPA, Jackson |
| Auth | JWT (Access + Refresh Tokens), BCrypt password hashing, Token blacklist |
| Database | H2 (Embedded SQL, in-memory by default) |
| AI | Google Gemini API (1.5 Flash) β question generation & syllabus analysis |
| Frontend | HTML5, CSS3, Vanilla JavaScript (ES6) β No heavy frameworks |
| Styling | CSS Variables, Dark theme, Glassmorphism, Responsive design, Custom SVG icons |
| Deploy | Docker (Backend), Static Site (Portals), Render-ready |
| Scripts | Bash (run.sh, setup.sh, show_access_urls.sh), Batch (run.bat, setup.bat, show_access_urls.bat) |
QuizFinal/
βββ backend/ # Spring Boot Server Application
β βββ Dockerfile # Multi-stage Docker build
β βββ pom.xml # Maven config
β βββ src/main/java/com/quiz/
β βββ QuizApplication.java # Entry point
β βββ config/ # Security, JWT, CORS, DataInitializer
β β βββ SecurityConfig.java
β β βββ JwtUtils.java
β β βββ JwtAuthenticationFilter.java
β β βββ DataInitializer.java
β βββ controller/ # REST API endpoints
β β βββ AuthController.java # Login, Logout, Token Refresh
β β βββ SessionController.java # Session lifecycle & OTP
β β βββ SyllabusController.java # AI question generation
β β βββ QuizController.java # Quiz submission & scoring
β β βββ ScoreboardController.java # Live scoreboard
β β βββ AnalyticsController.java # CO & session analytics
β β βββ AdminController.java # Faculty management
β β βββ StudentController.java # Student registration
β βββ model/ # JPA Entities
β β βββ User.java, Role.java, Faculty.java
β β βββ Session.java, Student.java
β β βββ Question.java, Answer.java
β β βββ Submission.java, Otp.java, Syllabus.java
β βββ repository/ # Spring Data JPA Repositories
β βββ service/ # Business Logic
β β βββ AIService.java # Gemini AI integration
β β βββ SessionService.java # Session management
β β βββ OTPService.java # OTP generation & validation
β β βββ TokenBlacklistService.java # JWT blacklisting
β β βββ CustomUserDetailsService.java
β βββ util/ # Utilities (PasswordValidator)
β
βββ faculty_portal/ # Faculty Web Dashboard (Static)
β βββ index.html # Main dashboard SPA
β βββ login.html # Faculty login page
β βββ css/style.css # Dark theme styling
β βββ js/app.js # Dashboard logic
β βββ js/config.js # API base URL config
β βββ icons/ # Custom SVG icons
β
βββ student_portal/ # Student Quiz Interface (Static)
β βββ index.html # Quiz SPA
β βββ css/ # Modular CSS (theme, layout, components, responsive)
β β βββ variables.css, theme.css, reset.css
β β βββ layout.css, components.css, style.css
β β βββ responsive.css
β βββ js/ # Modular JavaScript
β β βββ config.js # API base URL config
β β βββ api.js # HTTP client & API endpoints
β β βββ app.js # Core quiz logic & state machine
β β βββ auth.js # Student authentication flow
β β βββ components.js # UI components
β β βββ utils.js # Helpers & anti-cheat logic
β β βββ app.test.js # Unit tests
β βββ assets/ # Static assets
β
βββ client/ # JavaFX Desktop Client (Legacy)
β βββ pom.xml
β βββ src/ # Desktop app source
β
βββ run.sh # Launch all 3 services (Linux/Mac)
βββ run.bat # Launch all 3 services (Windows)
βββ setup.sh # Environment check & build (Linux/Mac)
βββ setup.bat # Environment check & build (Windows)
βββ show_access_urls.sh # Display LAN IPs for lab access
βββ show_access_urls.bat # Display LAN IPs (Windows)
βββ README.md # This file
βββ info.md # Technical documentation
- Java 17+ (JDK)
- Maven 3.6+
- Python 3 (for serving static portals locally)
- Google Gemini API Key (Get one here)
# 1. Clone the repository
git clone https://github.com/Daku3011/Quiz.git
cd Quiz
# 2. Create your environment file
echo "GEMINI_API_KEY=your_api_key_here" > backend/.env
# 3. Run the setup script (checks dependencies & builds)
# Linux / macOS:
./setup.sh
# Windows:
setup.batUse the automated launcher to start all three services:
# Linux / macOS
./run.sh
# Windows
run.batThis will:
- Build and start the Backend on port
9090 - Start the Faculty Portal on port
9876(via Python HTTP server) - Start the Student Portal on port
8080(via Python HTTP server) - Display all access URLs (including LAN IPs)
| Service | URL | Notes |
|---|---|---|
| Backend API | http://localhost:9090 | REST API only |
| Faculty Portal | http://localhost:9876 | Login: admin/admin123 |
| Student Portal | http://localhost:8080 | No login required |
To allow students on other devices (phones, tablets) to connect over the local network:
# Show all access URLs with your LAN IP
./show_access_urls.sh
# If using a firewall, open the required ports:
sudo ufw allow 8080/tcp && sudo ufw allow 9876/tcp && sudo ufw allow 9090/tcpStudents connect to http://<YOUR_IP>:8080 from any browser. The portals auto-detect the host machine's IP for API calls.
The project is configured for Render (or any Docker-compatible host).
| Setting | Value |
|---|---|
| Repo URL | https://github.com/Daku3011/Quiz |
| Root Directory | backend |
| Runtime | Docker |
| Env Vars | GEMINI_API_KEY=your_key |
| Setting | Value |
|---|---|
| Root Directory | faculty_portal |
| Build Command | (None) |
| Publish Directory | . |
| Config | Update js/config.js with Backend URL |
| Setting | Value |
|---|---|
| Root Directory | student_portal |
| Build Command | (None) |
| Publish Directory | . |
| Config | Update js/config.js with Backend URL |
All endpoints are prefixed with /api. The Backend runs on port 9090.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/auth/login |
Login with username/password β JWT | None |
POST |
/api/auth/refresh |
Refresh an expired access token | Refresh |
POST |
/api/auth/logout |
Blacklist current token | Bearer |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/session/start |
Create session, save questions, gen OTP | Bearer |
POST |
/api/session/join |
Student joins with OTP validation | None |
GET |
/api/session/{id}/status |
Get session status & timing info | None |
GET |
/api/session/{id}/questions |
Get shuffled questions for a student | None |
GET |
/api/session/active |
List all currently running sessions | Bearer |
POST |
/api/session/{id}/stop |
End a running session | Bearer |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/syllabus/generate |
Generate MCQs from text or PDF (Base64) | Bearer |
POST |
/api/syllabus/analyze |
Analyze syllabus structure & topics | Bearer |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/quiz/submit |
Submit answers, get score & results | None |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
GET |
/api/session/{id}/scoreboard |
Live scoreboard for a session | Bearer |
GET |
/api/analytics/session/{id} |
Aggregated CO analytics for a session | Bearer |
GET |
/api/analytics/session/{sessionId}/student/{sid} |
Individual student analytics | Bearer |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/admin/faculty |
Create a new faculty user | Bearer |
GET |
/api/admin/submissions |
Get all quiz submissions | Bearer |
| Method | Endpoint | Description | Auth |
|---|---|---|---|
POST |
/api/student/register |
Register for a session (name, enrollment, OTP) | None |
Q: "403 Forbidden" on Faculty Login?
Hard-refresh your browser (
Ctrl+Shift+R) to clear cached credentials.
Q: Port already in use?
The
run.shscript auto-kills processes on ports 8080, 9090, and 9876. If it fails, manually run:fuser -k 8080/tcp 9090/tcp 9876/tcp
Q: Students can't connect from their devices?
- Make sure all devices are on the same network (Wi-Fi or hotspot).
- Run
./show_access_urls.shto get the correct LAN URL.- Open firewall ports:
sudo ufw allow 8080/tcp && sudo ufw allow 9090/tcp
Q: AI question generation fails?
Verify your
GEMINI_API_KEYinbackend/.envis correct and has quota remaining.
Q: How do I change default admin credentials?
Edit
DataInitializer.javainbackend/src/main/java/com/quiz/config/and rebuild.
Distributed under the MIT License.
Owner Daku3011.