https://github.com/kawchar-ahammed/smart-quiz-system
A comprehensive online quiz management system built with Django REST API and React. Features real-time proctoring, multi-tenant architecture, group management, and advanced analytics for educational institutions and organizations.
https://github.com/kawchar-ahammed/smart-quiz-system
django educational-platform javascript jwt-authentication multi-tenant-applications online-assessment proctoring python quiz-platform quiz-system rest-api-framework self-assessment smart-quiz-system sql-server tailwindcss web-application
Last synced: 2 months ago
JSON representation
A comprehensive online quiz management system built with Django REST API and React. Features real-time proctoring, multi-tenant architecture, group management, and advanced analytics for educational institutions and organizations.
- Host: GitHub
- URL: https://github.com/kawchar-ahammed/smart-quiz-system
- Owner: Kawchar-Ahammed
- License: mit
- Created: 2025-09-11T19:53:40.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-11T20:18:43.000Z (9 months ago)
- Last Synced: 2025-09-11T22:58:29.189Z (9 months ago)
- Topics: django, educational-platform, javascript, jwt-authentication, multi-tenant-applications, online-assessment, proctoring, python, quiz-platform, quiz-system, rest-api-framework, self-assessment, smart-quiz-system, sql-server, tailwindcss, web-application
- Language: Python
- Homepage:
- Size: 298 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# ๐ Smart Quiz System
> **A comprehensive, enterprise-grade online assessment platform with advanced proctoring, multi-tenant support, and real-time analytics.**
[](https://opensource.org/licenses/MIT)
[](https://djangoproject.com/)
[](https://reactjs.org/)
[](https://www.microsoft.com/en-us/sql-server/)
## ๐ **Key Features**
### ๐ฏ **Assessment Management**
- **Multiple Question Types**: MCQ, True/False, Short Answer, Essay, Matching
- **Smart Randomization**: Question and answer order randomization
- **Flexible Scheduling**: Start/end dates with automatic expiration
- **Attempts Control**: Configurable maximum attempts per quiz
- **Instant Grading**: Automatic scoring with manual review options
### ๐ข **Multi-Tenant Architecture**
- **Organization Management**: Complete multi-tenancy support
- **Role-Based Access**: Admin, Instructor, Student roles with granular permissions
- **Group Management**: Course groups, study groups, public groups, self-assessment
- **Subscription Tiers**: Basic, Premium, Enterprise with feature gating
### ๐ **Advanced Security & Proctoring**
- **SmartMonitor**: Real-time proctoring with violation detection
- **JWT Authentication**: Secure token-based authentication
- **Tab Monitoring**: Detection of tab switches and window focus changes
- **Copy/Paste Prevention**: Advanced cheating prevention mechanisms
- **CSRF Protection**: Complete protection against common attacks
### ๐ **Analytics & Reporting**
- **Real-Time Dashboards**: Live statistics and performance metrics
- **Detailed Analytics**: Student progress tracking and performance analysis
- **Comprehensive Reports**: Quiz analytics, user statistics, system overview
- **Export Capabilities**: Data export for further analysis
### ๐ **Communication & Notifications**
- **Email Integration**: Automated notifications for quiz completion, assignments
- **Template System**: Customizable email templates
- **Real-Time Updates**: Live notifications for important events
- **Group Invitations**: Seamless collaboration features
## ๐๏ธ **Architecture Overview**
```
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
โ React.js โ โ Django REST โ โ SQL Server โ
โ Frontend โโโโโบโ API Backend โโโโโบโ Database โ
โ โ โ โ โ โ
โ โข TailwindCSS โ โ โข JWT Auth โ โ โข Normalized โ
โ โข React Router โ โ โข DRF โ โ โข Indexed โ
โ โข Axios โ โ โข Celery Tasks โ โ โข Scalable โ
โ โข Context API โ โ โข Redis Cache โ โ โข ACID โ
โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโ
```
### **Technology Stack**
#### **Frontend**
- **React 18.2** - Modern UI with hooks and context
- **TailwindCSS** - Utility-first styling framework
- **Axios** - HTTP client with interceptors
- **React Router** - SPA routing with protected routes
- **React Query** - Server state management
- **Chart.js** - Interactive data visualizations
#### **Backend**
- **Django 4.2.7** - Robust web framework
- **Django REST Framework** - Powerful API development
- **JWT Authentication** - Secure token-based auth
- **Celery + Redis** - Background task processing
- **WhiteNoise** - Static file serving
- **CORS Headers** - Cross-origin request handling
#### **Database & Infrastructure**
- **Microsoft SQL Server** - Enterprise-grade database
- **Redis** - Caching and task queue
- **Email Integration** - SMTP support with templates
- **File Storage** - Configurable static/media handling
## ๐ **Quick Start**
### **Prerequisites**
```bash
# Required software
Python 3.9+
Node.js 16+
SQL Server 2019+ (or SQL Server Express)
Redis (optional, for background tasks)
```
### **1. Clone & Setup**
```bash
# Clone the repository
git clone https://github.com/yourusername/smart-quiz-system.git
cd smart-quiz-system
# Quick setup (Windows)
setup.bat
# Or manual setup below...
```
### **2. Backend Setup**
```bash
cd backend
# Create virtual environment
python -m venv venv
venv\Scripts\activate # Windows
# source venv/bin/activate # Linux/macOS
# Install dependencies
pip install -r requirements.txt
# Configure environment
copy .env.example .env
# Edit .env with your database credentials
# Database setup
python manage.py migrate
python manage.py createsuperuser
# Start development server
python manage.py runserver
```
### **3. Frontend Setup**
```bash
cd frontend
# Install dependencies
npm install
# Start development server
npm start
```
### **4. Database Configuration**
```sql
-- Execute the enhanced schema
sqlcmd -S localhost -d SmartQuizDB -i database/enhanced_schema.sql
```
### **5. Access the Application**
- **Frontend**: http://localhost:3000
- **Backend API**: http://localhost:8000
- **Admin Panel**: http://localhost:8000/admin
## ๐ **Project Structure**
```
smart-quiz-system/
โโโ ๐ backend/ # Django REST API
โ โโโ ๐ smart_quiz_system/ # Main Django project
โ โโโ ๐ apps/ # Django applications
โ โ โโโ ๐ authentication/ # User management & JWT
โ โ โโโ ๐ organizations/ # Multi-tenant support
โ โ โโโ ๐ groups/ # Group management system
โ โ โโโ ๐ quizzes/ # Quiz & question management
โ โ โโโ ๐ results/ # Quiz attempts & scoring
โ โ โโโ ๐ proctoring/ # SmartMonitor system
โ โ โโโ ๐ notifications/ # Email & notifications
โ โโโ ๐ requirements.txt # Python dependencies
โ โโโ ๐ manage.py # Django management
โโโ ๐ frontend/ # React Application
โ โโโ ๐ public/ # Static assets
โ โโโ ๐ src/ # React source code
โ โ โโโ ๐ components/ # Reusable components
โ โ โโโ ๐ pages/ # Page components
โ โ โโโ ๐ services/ # API services
โ โ โโโ ๐ context/ # React context providers
โ โ โโโ ๐ hooks/ # Custom React hooks
โ โโโ ๐ package.json # Node dependencies
โ โโโ ๐ tailwind.config.js # TailwindCSS configuration
โโโ ๐ database/ # Database scripts
โ โโโ ๐ SmartQuizDB_SQLServer.sql # Original schema
โ โโโ ๐ enhanced_schema.sql # Enhanced features
โ โโโ ๐ sample_data.sql # Development data
โโโ ๐ docs/ # Documentation
โ โโโ ๐ SECURITY_FIXES.md # Security improvements
โ โโโ ๐ PERFORMANCE_GUIDE.md # Performance optimization
โ โโโ ๐ TESTING_STRATEGY.md # Testing implementation
โ โโโ ๐ PRODUCTION_DEPLOYMENT.md # Deployment guide
โโโ ๐ README.md # This file
```
## ๐ง **Configuration**
### **Environment Variables**
Create a `.env` file in the backend directory:
```env
# Django Settings
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
# Database Configuration
DATABASE_NAME=SmartQuizDB
DATABASE_HOST=localhost
DATABASE_PORT=1433
DATABASE_USER=your_username
DATABASE_PASSWORD=your_password
# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_HOST_USER=your_email@gmail.com
EMAIL_HOST_PASSWORD=your_app_password
DEFAULT_FROM_EMAIL=Smart Quiz System
# Redis Configuration (optional)
REDIS_URL=redis://localhost:6379/0
# Application Settings
QUIZ_MAX_DURATION=180
PROCTORING_ENABLED=True
EMAIL_NOTIFICATIONS_ENABLED=True
```
### **Quiz System Settings**
```python
QUIZ_SETTINGS = {
'MAX_QUIZ_DURATION': 180, # Maximum quiz duration (minutes)
'MAX_QUESTIONS_PER_QUIZ': 100, # Maximum questions per quiz
'MAX_CHOICES_PER_QUESTION': 6, # Maximum choices per MCQ
'DEFAULT_PASSING_SCORE': 60, # Default passing percentage
'MAX_ATTEMPTS_PER_QUIZ': 3, # Maximum attempts allowed
'PROCTORING_ENABLED': True, # Enable proctoring features
'EMAIL_NOTIFICATIONS_ENABLED': True, # Enable email notifications
}
```
## ๐ฅ **User Roles & Permissions**
### **Administrator**
- Complete system management
- User approval and management
- Organization and subscription management
- System analytics and reporting
- Security and compliance oversight
### **Instructor**
- Quiz creation and management
- Question bank development
- Student group management
- Grade management and review
- Analytics for their courses
### **Student**
- Quiz participation
- Results viewing and analysis
- Group participation
- Self-assessment tools
- Progress tracking
## ๐ฎ **Usage Examples**
### **Creating a Quiz (Instructor)**
```javascript
// Example quiz creation payload
const quizData = {
title: "Advanced JavaScript Concepts",
description: "Test your knowledge of ES6+ features",
duration_minutes: 60,
passing_score: 70,
quiz_type: "assessment",
visibility: "group",
group_id: 123,
questions: [
{
question_text: "What is the purpose of async/await?",
question_type: "multiple_choice",
marks: 2,
choices: [
{ choice_text: "Handle asynchronous operations", is_correct: true },
{ choice_text: "Create synchronous code", is_correct: false },
{ choice_text: "Handle errors only", is_correct: false },
{ choice_text: "Improve performance", is_correct: false }
]
}
]
};
```
### **Taking a Quiz (Student)**
```javascript
// Start quiz attempt
const attempt = await api.post('/api/quizzes/attempts/', {
quiz_id: 123
});
// Submit answers
const submission = await api.post(`/api/quizzes/attempts/${attempt.id}/submit/`, {
answers: [
{ question_id: 1, selected_choices: [1] },
{ question_id: 2, text_answer: "Event loop manages async operations" }
]
});
```
## ๐ **API Documentation**
### **Authentication Endpoints**
```http
POST /api/auth/register/ # User registration
POST /api/auth/login/ # User login
POST /api/auth/logout/ # User logout
GET /api/auth/profile/ # Get user profile
POST /api/auth/refresh/ # Refresh JWT token
```
### **Quiz Management**
```http
GET /api/quizzes/ # List quizzes
POST /api/quizzes/ # Create quiz
GET /api/quizzes/{id}/ # Get quiz details
PUT /api/quizzes/{id}/ # Update quiz
DELETE /api/quizzes/{id}/ # Delete quiz
POST /api/quizzes/{id}/attempts/ # Start quiz attempt
```
### **Results & Analytics**
```http
GET /api/results/my-results/ # Student's quiz results
GET /api/results/quiz/{id}/analytics/ # Quiz analytics
GET /api/admin/dashboard/stats/ # Admin dashboard stats
GET /api/admin/users/ # User management
```
## ๐งช **Testing**
### **Backend Tests**
```bash
cd backend
# Run all tests
python manage.py test
# Run with coverage
pip install coverage
coverage run --source='.' manage.py test
coverage report
```
### **Frontend Tests**
```bash
cd frontend
# Run tests
npm test
# Run with coverage
npm test -- --coverage --watchAll=false
```
### **End-to-End Tests**
```bash
# Install Cypress
npm install cypress --save-dev
# Run E2E tests
npx cypress run
```
## ๐ **Deployment**
### **Development**
```bash
# Start all services
docker-compose up -d
# Or start individually
python backend/manage.py runserver # Backend
npm start --prefix frontend # Frontend
```
### **Production**
```bash
# Build and deploy
docker-compose -f docker-compose.prod.yml up -d
# Or follow the comprehensive deployment guide
# See docs/PRODUCTION_DEPLOYMENT.md
```
## ๐ **Security Features**
- โ
**JWT Authentication** with refresh tokens
- โ
**Role-based access control** (RBAC)
- โ
**CSRF Protection** for all forms
- โ
**XSS Prevention** with input sanitization
- โ
**SQL Injection Protection** with ORM
- โ
**Secure Headers** implementation
- โ
**Rate Limiting** for API endpoints
- โ
**Password Hashing** with Django's PBKDF2
- โ
**Secure Session Management**
- โ
**Email Verification** system
## ๐ **Performance Features**
- โก **Database Indexing** for optimal query performance
- โก **Redis Caching** for frequently accessed data
- โก **Background Tasks** with Celery
- โก **Connection Pooling** for database efficiency
- โก **Static File Optimization** with WhiteNoise
- โก **Frontend Code Splitting** with React lazy loading
- โก **Image Optimization** and lazy loading
- โก **API Response Caching** strategies
## ๐ **Browser Support**
| Browser | Version |
|---------|---------|
| Chrome | 88+ |
| Firefox | 85+ |
| Safari | 14+ |
| Edge | 88+ |
## ๐ค **Contributing**
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
### **Development Workflow**
1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
3. Commit your changes (`git commit -m 'Add amazing feature'`)
4. Push to the branch (`git push origin feature/amazing-feature`)
5. Open a Pull Request
### **Code Standards**
- Follow PEP 8 for Python code
- Use ESLint configuration for JavaScript
- Write comprehensive tests for new features
- Update documentation for API changes
## ๐ **Roadmap**
### **Version 2.0** (Q4 2025)
- [ ] Mobile applications (React Native)
- [ ] Advanced analytics with ML insights
- [ ] Video-based questions support
- [ ] Blockchain-based certificate verification
- [ ] Advanced proctoring with AI
### **Version 2.1** (Q1 2026)
- [ ] Microservices architecture
- [ ] GraphQL API support
- [ ] Real-time collaborative features
- [ ] Advanced accessibility features
- [ ] Multi-language support
## ๐ **Known Issues**
- Quiz timer may not sync perfectly across browser tabs
- Large file uploads may timeout on slow connections
- Email delivery may be delayed in high-traffic scenarios
See [Issues](https://github.com/yourusername/smart-quiz-system/issues) for a complete list and to report new bugs.
## ๐ **License**
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐ **Support & Contact**
- **Documentation**: [Wiki](https://github.com/yourusername/smart-quiz-system/wiki)
- **Issues**: [GitHub Issues](https://github.com/yourusername/smart-quiz-system/issues)
- **Discussions**: [GitHub Discussions](https://github.com/yourusername/smart-quiz-system/discussions)
- **Email**: support@smartquiz.com
## ๐ **Acknowledgments**
- Django and Django REST Framework communities
- React and Create React App teams
- TailwindCSS for the amazing utility framework
- All open-source contributors who made this project possible
---
**โญ Star this repository if you find it helpful!**
Made with โค๏ธ by [Kawchar Ahammed](https://github.com/Kawchar-Ahammed)