A Comprehensive Quiz Competition Management System for Educational Institutions
Developed at University of Ruhuna | Faculty of Engineering
Features β’ Architecture β’ Getting Started β’ Documentation β’ Contributing
- Overview
- Problem Statement
- Target Audience
- Solution
- Architecture
- Key Features
- User Stories
- Technology Stack
- Project Structure
- Getting Started
- API Documentation
- Security Features
- Development Workflow
- Deployment
- Contributing
- Acknowledgments
- License
The Rextro School Quiz Platform is an advanced, real-time quiz competition management system designed to facilitate inter-school academic competitions. Built with modern web technologies at the University of Ruhuna Faculty of Engineering, it provides a seamless experience for administrators, teachers, and students while maintaining the highest standards of academic integrity through comprehensive anti-cheating mechanisms.
To create an engaging, fair, and technologically advanced platform that enables educational institutions to conduct large-scale quiz competitions efficiently while ensuring complete transparency and security.
Traditional quiz competitions face several challenges:
- π Security Concerns: Preventing cheating and unauthorized access during online assessments
- π Manual Tracking: Time-consuming manual score calculation and violation monitoring
- β±οΈ Time Management: Difficulty in synchronizing quiz timing across multiple participants
- π Real-time Monitoring: Lack of live tracking and instant result compilation
- π Team Coordination: Managing multiple team members and their individual performances
- π± Accessibility: Need for a platform that works seamlessly across devices
- π Violation Detection: Manual monitoring of student behavior during assessments
-
π« School Administrators
- Register school teams
- Monitor team performance
- Track violations
- Access comprehensive analytics
-
π¨βπ« Teachers/Coordinators
- Manage student teams
- Monitor quiz progress
- View real-time results
- Generate reports
-
π Students
- Participate in timed quizzes
- View personal scores
- Access leaderboards
- Compete fairly
-
π οΈ System Administrators
- Create and manage quizzes
- Configure platform settings
- Monitor system health
- Manage user access
-
π Event Organizers
- Track competition progress
- Generate reports
- Analyze participation data
- Monitor platform performance
A full-stack web application that addresses all challenges through:
- Question Bank Management: Create, edit, and organize quiz questions with support for text and images
- Team Management: Register and manage school teams with multiple members
- Real-time Monitoring: Live dashboard showing active quizzes and participant status
- Violation Tracking: Automated detection and logging of suspicious activities
- Analytics Dashboard: Comprehensive insights into performance and participation
- Team Registration: Simple interface to register school teams with student details
- Progress Tracking: Monitor team members' quiz progress in real-time
- Result Access: Instant access to scores and rankings
- Violation Reports: View detailed violation logs for each team member
- Secure Authentication: Token-based login system for each team member
- Timed Quizzes: 45-minute quiz sessions with countdown timer
- Fullscreen Mode: Immersive quiz experience with anti-cheat measures
- Instant Results: Immediate score calculation and ranking display
- Leaderboard: Real-time ranking system showing top performers
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Layer β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Admin β β Teacher β β Student β β
β β Dashboard β β Portal β β Quiz β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β HTTPS/REST API
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββ
β Application Layer β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Next.js Frontend (SSR/CSR) β β
β β β’ React Components β’ Context API β’ Interceptors β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Express.js Backend (REST API) β β
β β β’ Controllers β’ Routes β’ Middleware β’ Services β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β Mongoose ODM
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββ
β Data Layer β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β MongoDB Database β β
β β β’ SchoolTeams β’ Questions β’ Quizzes β’ Violations β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Student Login β Authentication β Token Generation β Quiz Access
β β β β
Quiz Start β Fullscreen Mode β Answer Selection β Violation Check
β β β β
Timer Tick β Progress Save β Score Calculation β Result Display
- Fullscreen Enforcement: Automatic detection when students exit fullscreen mode
- Copy/Paste Prevention: Disabled clipboard operations during quiz
- Tab Switching Detection: Alerts and logs when students switch tabs
- Activity Monitoring: Tracks user activity and flags extended inactivity
- Device Fingerprinting: Unique identification of quiz-taking devices
- Token-based Authentication: Secure JWT tokens for session management
- Violation Logging: Comprehensive database of all suspicious activities
- Dynamic Question Bank: Support for text and image-based questions
- Multiple Answer Formats: Text-only, image-only, or combined answers
- Timed Sessions: Configurable quiz duration (default: 45 minutes)
- Auto-submission: Automatic submission when time expires
- Progress Tracking: Real-time progress indicators
- Answer Review: Students can navigate between questions before submission
- Multi-member Teams: Support for 4 students per school team
- Individual Tracking: Separate authentication and scoring for each member
- Team Aggregation: Automatic calculation of team total scores
- School Information: Store educational zone and teacher contact details
- Member Status: Track login status and quiz completion for each member
- Live Rankings: Automatic ranking based on scores
- School-wise Display: Show performance by school and team
- Individual Scores: Display each team member's contribution
- Violation Indicators: Flag teams/members with violations
- Responsive Design: Works seamlessly on all screen sizes
- Responsive Design: Mobile-first approach with beautiful UI
- Intuitive Navigation: Easy-to-use interface for all user types
- Visual Feedback: Clear indicators for selections and progress
- Loading States: Smooth transitions and loading indicators
- Error Handling: User-friendly error messages
- Accessibility: Keyboard navigation and screen reader support
- Support Backend Layer: Dedicated caching server to reduce main backend load
- Response Caching: Intelligent caching of quiz data, questions, and leaderboards
- Optimized API Calls: Reduces redundant database queries
- Scalable Architecture: Easy horizontal scaling with caching layer
- Question Management: CRUD operations for quiz questions
- Team Overview: View all registered school teams
- Violation Monitoring: Dashboard for tracking all violations
- Analytics: Comprehensive statistics and insights
- Bulk Operations: Import/export questions and teams
- System Logs: Detailed activity logs for auditing
β I want to register my school team with student details
β I want to view my team's performance in real-time
β I want to see which students have completed the quiz
β I want to check if any violations were detected
β I want to compare my team's ranking with other schools
β I want to login securely with my school credentials
β I want to take the quiz in a distraction-free fullscreen mode
β I want to see my remaining time clearly
β I want to navigate between questions freely
β I want to see my score immediately after submission
β I want to view my ranking on the leaderboard
β I want to create and manage quiz questions easily
β I want to upload images for questions and answers
β I want to monitor all active quiz sessions
β I want to view comprehensive violation reports
β I want to export results and analytics
β I want to ensure system security and performance
β I want to help my students login to the quiz
β I want to monitor their progress during the quiz
β I want to ensure they follow the rules
β I want to view detailed results after completion
β I want to identify areas for improvement
| Technology | Purpose | Version |
|---|---|---|
| Next.js | React Framework with SSR/CSR | 15.x |
| React | UI Library | 19.x |
| TypeScript | Type Safety | 5.x |
| Tailwind CSS | Utility-first CSS Framework | 3.x |
| Lucide React | Icon Library | Latest |
| Axios | HTTP Client | Latest |
| Technology | Purpose | Version |
|---|---|---|
| Node.js | Runtime Environment | 20+ |
| Express.js | Web Framework | 5.x |
| TypeScript | Type Safety | 5.x |
| MongoDB | NoSQL Database | 7.x |
| Mongoose | ODM for MongoDB | 8.x |
| JWT | Authentication | Latest |
| Bcrypt | Password Hashing | Latest |
| Technology | Purpose | Version |
|---|---|---|
| Node.js | Runtime Environment | 20+ |
| Express.js | Web Framework | 5.x |
| TypeScript | Type Safety | 5.x |
| node-cache | In-Memory Caching | 5.x |
| Tool | Purpose |
|---|---|
| Git | Version Control |
| Docker | Containerization |
| Artillery | Load Testing |
| ESLint | Code Linting |
| Prettier | Code Formatting |
| Swagger | API Documentation |
Rextro-School-Quiz-Platform/
β
βββ π frontend/ # Next.js Frontend Application
β βββ π app/ # Next.js App Router
β β βββ π admin/ # Admin dashboard pages
β β βββ π quiz/ # Quiz interface
β β βββ π leaderboard/ # Rankings display
β β βββ π login/ # Authentication pages
β β βββ π api/ # API routes
β βββ π components/ # Reusable React components
β βββ π contexts/ # React Context providers
β βββ π interceptors/ # Axios interceptors
β βββ π lib/ # Utility functions
β βββ π types/ # TypeScript type definitions
β βββ π public/ # Static assets
β βββ π package.json # Frontend dependencies
β
βββ π backend/ # Express.js Backend API
β βββ π config/ # Configuration files
β β βββ π db.ts # Database connection
β βββ π controllers/ # Request handlers
β β βββ π authController.ts
β β βββ π questionController.ts
β β βββ π quizController.ts
β β βββ π schoolTeamController.ts
β β βββ π uploadController.ts
β β βββ π userController.ts
β β βββ π violationController.ts
β βββ π models/ # Mongoose schemas
β β βββ π SchoolTeam.ts
β β βββ π Question.ts
β β βββ π Quiz.ts
β β βββ π User.ts
β β βββ π Violation.ts
β βββ π routes/ # API routes
β βββ π middleware/ # Custom middleware
β βββ π utils/ # Utility functions
β βββ π index.ts # Application entry point
β
βββ π README.md # Project documentation
βββ π .gitignore # Git ignore rules
βββ π LICENSE # License file
Before you begin, ensure you have the following installed:
- Node.js (v20 or higher)
- npm or yarn
- MongoDB (v7.0 or higher) or MongoDB Atlas account
- Git
git clone https://github.com/yourusername/Rextro-School-Quiz-Platform.git
cd Rextro-School-Quiz-Platform# Navigate to backend directory
cd backend
# Install dependencies
npm install
# Create environment file
cp .env.example .env
# Configure environment variables
nano .envBackend Environment Variables (.env):
# Server Configuration
PORT=5000
NODE_ENV=development
# Database Configuration
DEV_MONGO_URI=mongodb://localhost:27017/rextro_quiz_dev
PROD_MONGO_URI=mongodb+srv://user:password@cluster.mongodb.net/rextro_quiz
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRE=1h
# Cloudinary Configuration (for image uploads)
CLOUDINARY_CLOUD_NAME=your_cloud_name
CLOUDINARY_API_KEY=your_api_key
CLOUDINARY_API_SECRET=your_api_secret# Run in development mode
npm run dev
# Run in production mode
npm run prod
# Build for production
npm run build
npm start# Navigate to frontend directory
cd ../frontend
# Install dependencies
npm install
# Create environment file
cp .env.example .env.local
# Configure environment variables
nano .env.localFrontend Environment Variables (.env.local):
# API Configuration
NEXT_PUBLIC_API_URL=http://localhost:5000/api
# App Configuration
NEXT_PUBLIC_APP_NAME=Rextro Quiz Platform
NEXT_PUBLIC_QUIZ_DURATION=2700# Run development server
npm run dev
# Build for production
npm run build
npm start- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
- API Documentation: http://localhost:5000/api-docs
POST /api/auth/login
Content-Type: application/json
{
"schoolName": "Sunrise High School",
"memberName": "Alice",
"password": "secure123"
}Response:
{
"success": true,
"message": "Login successful",
"data": {
"teamId": "68bf02d2004d8f942bdf2c45",
"teamName": "Alpha Innovators",
"memberName": "Alice",
"schoolName": "Sunrise High School",
"hasEndedQuiz": false,
"authToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
}GET /api/auth/logout
Content-Type: application/json
Authorization: Bearer <token>GET /api/auth/me
Authorization: Bearer <token>PUT /api/auth/update-state
Content-Type: application/json
Authorization: Bearer <token>
{
"schoolName": "Sunrise High School",
"memberName": "Alice",
"hasEndedQuiz": true
}POST /api/school-teams
Content-Type: application/json
{
"teamName": "Alpha Innovators",
"schoolName": "Sunrise High School",
"password": "secure123",
"educationalZone": "Central District",
"teacherInCharge": "Ms. Sarah Johnson",
"teacherContact": "+1-555-0123",
"members": [
{ "name": "Alice", "marks": 0 },
{ "name": "Bob", "marks": 0 },
{ "name": "Charlie", "marks": 0 },
{ "name": "Diana", "marks": 0 }
]
}GET /api/school-teamsResponse:
{
"success": true,
"count": 6,
"data": [
{
"_id": "68bf02d2004d8f942bdf2c45",
"teamName": "Alpha Innovators",
"schoolName": "Sunrise High School",
"totalMarks": 85,
"members": [
{
"name": "Alice",
"marks": 26.67,
"isLoggedIn": true,
"hasEndedQuiz": true
}
]
}
]
}GET /api/questions
Authorization: Bearer <token>POST /api/questions
Content-Type: application/json
Authorization: Bearer <token>
{
"question": "What is the capital of France?",
"image": null,
"answers": [
{ "id": "a", "text": "Paris", "image": null },
{ "id": "b", "text": "London", "image": null },
{ "id": "c", "text": "Berlin", "image": null }
],
"correctAnswer": "a"
}GET /api/quizzes/{id}
Authorization: Bearer <token>POST /api/quizzes/submit-quiz
Content-Type: application/json
Authorization: Bearer <token>
{
"quizId": 1,
"answers": {
"0": "a",
"1": "b",
"2": "c"
}
}GET /api/quizzes/get-leaderboardGET /api/quizzes/check-quiz-published-statusPOST /api/violations
Content-Type: application/json
{
"teamId": "68bf02d2004d8f942bdf2c45",
"memberName": "Alice",
"violationType": "copy & paste"
}GET /api/violations
Content-Type: application/json
{
"teamId": "68bf02d2004d8f942bdf2c45"
}GET /api/violations/count
Content-Type: application/json
{
"teamId": "68bf02d2004d8f942bdf2c45",
"memberName": "Alice"
}GET /api/violations/get-allFor complete API documentation, visit the Swagger UI at http://localhost:5000/api-docs
- JWT Tokens: Secure token-based authentication
- Password Hashing: Bcrypt with salt rounds for password security
- Token Expiration: Automatic session timeout after 1 hour
- Role-based Access: Different permissions for students, teachers, and admins
- Fullscreen Lock: Forces fullscreen mode during quiz
- Copy/Paste Prevention: Disables clipboard operations
- Tab Switching Detection: Alerts when users switch tabs
- Right-click Disable: Prevents context menu access
- Text Selection Block: Prevents text highlighting
- Device Fingerprinting: Unique device identification
- Automated Logging: All violations logged to database
- Real-time Alerts: Instant notifications for violations
- Comprehensive Reports: Detailed violation history per student/team
- Timestamped Records: Precise tracking of when violations occurred
- Environment Variables: Sensitive data stored in
.envfiles - Input Validation: Server-side validation for all inputs
- NoSQL Injection Prevention: Mongoose ODM protects against NoSQL injection
- XSS Protection: React's built-in XSS protection
- CORS Configuration: Controlled cross-origin resource sharing
- Rate Limiting: Support backend caching reduces attack surface
# Create feature branch
git checkout -b feature/your-feature-name
# Make changes and commit
git add .
git commit -m "feat: add your feature description"
# Push to remote
git push origin feature/your-feature-name
# Create pull request on GitHubFollow the Conventional Commits specification:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc.)refactor:Code refactoringtest:Adding or updating testschore:Maintenance tasks
# Backend tests
cd backend
npm test
# Frontend tests
cd frontend
npm test
# Load testing with Artillery
artillery run artillery-config.yml# Lint code
npm run lint
# Format code
npm run format
# Type check
npm run typecheck# Build images
docker-compose build
# Start containers
docker-compose up -d
# View logs
docker-compose logs -f
# Stop containers
docker-compose downcd backend
# Build TypeScript
npm run build
# Start production server
NODE_ENV=production npm start
# Build TypeScript
npm run build
# Start production server
NODE_ENV=production npm startcd frontend
# Build Next.js app
npm run build
# Start production server
npm start- Development:
npm run dev - Production:
npm run prod
We welcome contributions from the community! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'feat: add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow the existing code style
- Write meaningful commit messages
- Add tests for new features
- Update documentation as needed
- Ensure all tests pass before submitting PR
Please read our Code of Conduct before contributing.
- University of Ruhuna - Faculty of Engineering
- 25 Years of Innovation & Excellence
- All contributors and testers
- Open-source community for amazing tools and libraries
For support, questions, or feedback:
- Email: rextro2025@eng.ruh.ac.lk
- Institution: University of Ruhuna, Faculty of Engineering
- Issues: GitHub Issues
- Documentation: Wiki
This project is licensed under the MIT License - see the LICENSE file for details.
- β User authentication system
- β Quiz management
- β Team registration
- β Basic violation detection
- β Leaderboard
- β Support Backend with caching
- π Advanced analytics dashboard
- π Email notifications
- π Bulk import/export
- π Mobile app
- π AI-powered question generation
- π Video proctoring
- π Multi-language support
- π Customizable themes
- π Redis-based distributed caching
University of Ruhuna | Faculty of Engineering
25 Years of Innovation & Excellence (2000-2025)
ποΈ Built with β€οΈ by the Rextro Development Team
