A modern Django-based academy management system with AI-powered quiz generation - A comprehensive learning platform that combines traditional education management with cutting-edge artificial intelligence.
YG Academy is a comprehensive educational management platform built with Django that integrates advanced AI capabilities for personalized learning. This project serves as both a robust academy management system and a showcase of innovative educational technology, featuring AI-powered quiz generation from PDF documents.

- User Registration - Custom user registration with email validation
- User Login/Logout - Secure authentication system with session management
- Password Reset - Email-based password recovery with secure token verification
- Role-Based Access - Separate student and teacher accounts with granular permissions
- Teacher Dashboard - Comprehensive teacher interface with management tools
- Student Management - View, manage, and monitor student accounts
- Subject Access Control - Grant/revoke student access to specific subjects (Math, Physics, Science, History)
- Math Video Management - Add, organize, edit, and delete math course videos
- Course Organization - Structure videos by course, chapter, and sequential ordering
- Student Progress Tracking - Monitor student quiz performance and learning analytics
- Student Dashboard - Personalized student interface with subject access
- Subject Access - Access to Math, Physics, Science, History based on teacher permissions
- Video Learning - Watch educational videos with organized course structure
- Subject-Specific Content - Dedicated pages for each subject area
- AI Quiz Assistant - Advanced AI-powered quiz generation and testing system
- Math Courses - Complete math course system with video organization
- Chapter Organization - Videos organized by course and chapter hierarchy
- Video Player - Integrated video watching experience with progress tracking
- Course Ordering - Sequential organization of course content
- Content Management - Teacher-controlled content creation and management
- PDF Upload & Processing - Upload PDF documents for quiz generation
- AI-Powered Question Generation - Uses Google Gemini AI to create intelligent questions
- Multiple Choice Questions - Automatically generates 4-option multiple choice questions
- Smart Content Analysis - AI analyzes PDF content to create relevant, diverse questions
- Customizable Quiz Length - Choose from 5, 10, 15, or 20 questions per quiz
- PDF Text Extraction - Advanced PDF parsing using PyPDF2
- Content Validation - Ensures sufficient content for meaningful quiz generation
- AI Processing - Google Gemini 2.0 Flash model analyzes content and generates questions
- Question Validation - Automatic validation of generated questions and answers
- Database Storage - Secure storage of quizzes and user progress
- Interactive Interface - Modern, responsive quiz-taking interface
- Real-time Timer - Built-in timer to track quiz completion time
- Progress Tracking - Visual progress indicators throughout the quiz
- Answer Selection - Intuitive radio button interface with visual feedback
- Instant Validation - Client-side validation before quiz submission
- Detailed Results - Comprehensive breakdown of quiz performance
- Score Calculation - Percentage-based scoring with detailed statistics
- Answer Review - Review correct/incorrect answers with explanations
- Performance Metrics - Time taken, accuracy rate, and question-by-question analysis
- Progress History - Complete history of all quiz attempts
- Quiz History - View all previous quiz attempts with scores and dates
- Retake Capability - Ability to retake quizzes for improved scores
- Custom Titles - Personalized quiz titles for better organization
- Content Preview - Preview of PDF content used for quiz generation
- Subject-Based Access - Granular control over subject access permissions
- Teacher-Only Areas - Protected teacher functionality and administrative tools
- Access Control Decorators - Secure page access based on user roles and permissions
- Subject Unavailable Pages - Proper handling and messaging for access restrictions
- Dynamic Permission Updates - Real-time permission updates by teachers
- Home Page - Modern landing page with academy information
- About Page - Comprehensive information about the academy
- Teachers Page - Faculty information and profiles
- Contact Page - Contact information and communication channels
- Content Page - General content and announcements area
- Django 4.x - Web framework with advanced ORM capabilities
- Python 3.8+ - Core programming language
- SQLite/PostgreSQL - Database management (SQLite for development, PostgreSQL production-ready)
- Google Gemini AI - Advanced AI model for quiz generation
- PyPDF2 - PDF text extraction and processing
- Python-dotenv - Environment variable management
- HTML5 & CSS3 - Modern web standards with responsive design
- JavaScript ES6+ - Interactive functionality and AJAX requests
- Bootstrap 5 - Responsive UI framework
- Font Awesome - Icon library for enhanced UI
- Custom CSS - Tailored styling for unique user experience
- Google Gemini 2.0 Flash - Latest AI model for content analysis
- Natural Language Processing - Advanced text analysis and question generation
- Content Understanding - AI-powered content comprehension and question formulation
- Django Authentication - Built-in user management with custom extensions
- CSRF Protection - Cross-site request forgery protection
- Session Management - Secure session handling and timeout
- Permission-Based Access - Role-based access control system
- Python 3.8 or higher
- pip (Python package installer)
- virtualenv (recommended for isolated environment)
- Google Gemini API key (for AI features)
# Clone the repository
git clone https://github.com/GhilaniYassine/YG_Academy.git
cd YG_Academy
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txtCreate a .env file in the project root:
# AI Configuration
GEMINI_API_KEY=your_gemini_api_key_here
# Email Configuration (optional)
EMAIL_USER=[email protected]
EMAIL_PASSWORD=your_app_password
# Django Secret Key
SECRET_KEY=your_secret_key_here# Run migrations
python manage.py makemigrations
python manage.py migrate
# Create superuser
python manage.py createsuperuser
# Start development server
python manage.py runserver-
Get Google Gemini API Key:
- Visit Google AI Studio
- Create a new API key
- Add it to your
.envfile
-
Configure Media Settings:
- Ensure media directory exists for PDF uploads
- Check file upload permissions
Build image:
docker build -t yg_academy:latest .Run container (SQLite + static/media volumes):
docker run --rm \
-p 8000:8000 \
--env-file .env \
-e DEBUG=False \
-e SECRET_KEY=change_me_in_prod \
-e ALLOWED_HOSTS=127.0.0.1,localhost \
-v "$(pwd)"/media:/app/media \
-v "$(pwd)"/staticfiles:/app/staticfiles \
yg_academy:latestOpen: http://localhost:8000
Notes:
- WhiteNoise serves collected static files from /app/staticfiles.
If build/run fails with:
whitenoise.storage.MissingFileError: The file 'images/...' could not be found ...Then one of your CSS files references an image that isnβt present in static sources.
Fix options:
- Add the missing files under:
learn/static/images/Untitled-1.jpglearn/static/images/6.jpglearn/static/images/logotn.png
- Or temporarily remove/disable those
background-image: url(...)lines incss/index.css(already done in this repo). - After adding assets, you can restore the URLs and rerun
collectstatic.
YG_Academy/
βββ app/ # Main application directory
β βββ views.py # Application views and business logic
β βββ models.py # Database models (User, Course, Quiz, QuizAttempt)
β βββ services.py # AI service layer (GeminiQuizService)
β βββ urls.py # URL routing configuration
β βββ templates/ # Application-specific templates
β βββ ai_quiz/ # AI Quiz feature templates
β βββ quiz_home.html # AI Quiz dashboard
β βββ upload_pdf.html # PDF upload interface
β βββ take_quiz.html # Quiz taking interface
β βββ quiz_results.html # Results display
β βββ quiz_history.html # Quiz history
βββ templates/ # Global HTML templates
βββ static/ # Static files
β βββ css/ # Stylesheets
β β βββ dashboard.css # Main dashboard styles
β β βββ ai_quiz.css # AI Quiz specific styles
β βββ js/ # JavaScript files
β βββ images/ # Image assets
βββ media/ # User uploaded files (PDFs)
βββ learn/ # Django project settings
β βββ settings.py # Configuration with AI integration
β βββ urls.py # Main URL configuration
βββ requirements.txt # Python dependencies including AI packages
βββ .env # Environment variables (not in repo)
βββ manage.py # Django management script
βββ README.md # Project documentation
- User authentication (login/logout/register)
- Role-based access control (teachers vs students)
- Teacher dashboard with student management
- Subject-based permission system
- Math course video management
- Video organization by course and chapter
- Student video watching interface
- Password reset functionality
- Custom user model with subject permissions
- Protected views with decorators
- Error handling (404, access denied)
- PDF upload and text extraction
- AI-powered quiz generation using Google Gemini
- Multiple choice question creation
- Interactive quiz taking interface
- Real-time timer and progress tracking
- Comprehensive results analysis
- Quiz history and progress tracking
- Score calculation and performance metrics
- Question validation and error handling
- Responsive design for all devices
- Advanced analytics dashboard for teachers
- Multiple question types (True/False, Fill-in-the-blank)
- Collaborative learning features
- Mobile app development
- Integration with Learning Management Systems (LMS)
- Advanced AI tutoring system
- Multimedia quiz content (images, audio, video)
- Peer-to-peer learning network
Django==5.0.6
google-generativeai==0.3.2
PyPDF2==3.0.1
python-dotenv==1.0.0
# ... other dependencies in requirements.txt- Google Gemini AI API - For intelligent quiz generation
- Email Services - For password reset functionality
- Login to your student account
- Access Subjects based on teacher permissions
- Use AI Quiz Assistant:
- Click the AI Quiz button on dashboard
- Upload a PDF document
- Set quiz parameters (title, number of questions)
- Take the generated quiz
- Review results and explanations
- Track progress in quiz history
- Login to your teacher account
- Manage Students - Grant/revoke subject access
- Add Course Content - Upload and organize video content
- Monitor Progress - View student quiz performance
- Content Management - Organize courses by subject and chapter
- Upload PDF - Select and upload educational PDF content
- AI Processing - Gemini AI analyzes content and generates questions
- Quality Assurance - System validates questions for completeness
- Quiz Creation - Interactive quiz interface is generated
- Performance Tracking - Results are stored for progress monitoring
We welcome contributions to YG Academy! Here's how you can help:
- Bug Reports - Report issues with detailed reproduction steps
- Feature Requests - Suggest new educational features
- Code Contributions - Submit pull requests with improvements
- AI Enhancements - Improve quiz generation algorithms
- UI/UX Improvements - Enhance user interface and experience
- Course Materials - Contribute educational video content
- Quiz Templates - Create standardized quiz formats
- Learning Assessments - Develop evaluation criteria
This project is licensed under the MIT License - see the LICENSE file for details.
This project represents a significant step forward in educational technology, combining traditional learning management with artificial intelligence. The AI Quiz Assistant demonstrates how modern AI can be integrated into educational platforms to create personalized, adaptive learning experiences.
- AI Integration - Successfully integrated Google Gemini AI for content analysis
- Real-time Processing - Efficient PDF processing and question generation
- Scalable Architecture - Designed for future AI feature expansion
- User Experience - Intuitive interface for complex AI functionality
- Personalized Learning - AI adapts to individual learning materials
- Instant Assessment - Immediate feedback and performance analysis
- Content Flexibility - Works with any educational PDF content
- Progress Tracking - Comprehensive learning analytics
- Issues - Report bugs on GitHub Issues
- Documentation - Comprehensive setup and usage guides
- Community - Join our educational technology discussions
- PDF Processing - Supports files up to 10MB for optimal performance
- AI Response Time - Quiz generation typically takes 10-30 seconds
- Concurrent Users - Optimized for multiple simultaneous users
- Google AI - For providing the Gemini AI platform
- Django Community - For the robust web framework
- Open Source Contributors - For various libraries and tools used
β Star this repository if you find it helpful for educational technology development!
Made with β€οΈ, π€ AI, and lots of β by Yassine Ghilani
YG Academy - Where Traditional Education Meets Artificial Intelligence





