Josephat-S/aiprs
This project is a comprehensive Learning Management System (LMS) designed to enhance personalized education and improve academic outcomes within a university setting. It features an advanced AI Recommendation Engine and robust Analytics and Fraud Detection capabilities.
Intelligent Student Learning Analytics & Recommendation Platform
A comprehensive learning management system with AI-driven recommendations, analytics, and fraud detection for university education.
๐ฏ Features
For Students
- Course Management: Browse and enroll in courses with modules and lessons
- Learning Progress Tracking: Monitor completion and performance
- Assignments & Quizzes: Submit assignments and take timed quizzes
- AI Recommendations: Personalized learning suggestions based on performance
- Discussion Forums: Engage with peers and instructors
- Real-time Notifications: Get updates on deadlines, grades, and recommendations
- Multi-language Support: English, French, and Kinyarwanda
- Dark/Light Mode: Customizable theme preferences
For Teachers
- Course Creation: Build courses with modules, lessons, and assessments
- Performance Analytics: View detailed student performance metrics
- Assignment Grading: Grade submissions with feedback
- Forum Moderation: Respond to student questions
- Participation Tracking: Monitor student engagement
- Lesson Difficulty Analysis: Identify challenging content
For Admins
- User Management: Manage students, teachers, and admins
- Platform Analytics: Monitor system-wide metrics
- Report Generation: Export CSV/PDF reports
- Bulk Operations: Import/export courses and enrollments
- System Health Monitoring: Track platform performance
๐๏ธ Architecture
Frontend (React.js + Material UI)
frontend/
โโโ src/
โ โโโ components/ # Reusable UI components
โ โโโ pages/ # Page components (student, teacher, admin)
โ โโโ context/ # React Context (Auth, Theme, Language)
โ โโโ hooks/ # Custom React hooks
โ โโโ utils/ # Utility functions and translations
โ โโโ assets/ # Images and static files
โโโ public/
โโโ package.json
Backend (Pure PHP + MySQLi)
backend/
โโโ api/ # REST API endpoints
โโโ config/ # Database and constants
โโโ models/ # Data models (CRUD operations)
โโโ controllers/ # Business logic
โโโ includes/ # Shared templates
โโโ uploads/ # User-uploaded files
โโโ reports/ # Generated reports
โโโ logs/ # Error and analytics logs
Database (MySQL)
- 3NF Normalized Schema
- 14 Tables: users, courses, modules, lessons, enrollments, assignments, submissions, quizzes, questions, quiz_attempts, forum_posts, recommendations, notifications, analytics_logs
- Prepared Statements: SQL injection prevention
- Foreign Keys: Data integrity enforcement
๐ Installation
Prerequisites
- PHP: 7.4 or higher
- MySQL: 5.7 or higher
- Node.js: 16.x or higher
- XAMPP/WAMP/LAMP: Local server environment
Backend Setup
- Import Database
# Start MySQL server
mysql -u root -p
# Create database
CREATE DATABASE student_learning_platform;
# Import schema
mysql -u root -p student_learning_platform < database/schema.sql
# Import seed data
mysql -u root -p student_learning_platform < database/seed_data.sql- Configure Database Connection
Editbackend/config/database.php:
private $host = 'localhost';
private $username = 'root';
private $password = '';
private $database = 'student_learning_platform';- Set Directory Permissions
chmod -R 755 backend/uploads
chmod -R 755 backend/reports
chmod -R 755 backend/logs- Configure Apache
Ensuremod_rewriteis enabled and.htaccessfiles are processed.
Frontend Setup
- Install Dependencies
cd frontend
npm install- Configure API Endpoint
Editfrontend/src/context/AuthContext.js:
const API_BASE_URL = 'http://localhost/aiprs/backend/api';- Start Development Server
npm startThe application will open at http://localhost:3000
Production Build
cd frontend
npm run build๐ Security Features
-
Authentication
- Secure password hashing (bcrypt)
- Session management
- Role-based access control (RBAC)
-
Input Validation
- Client-side: React form validation
- Server-side: PHP filter_var, htmlspecialchars
- Prepared statements for SQL
-
File Upload Security
- MIME type validation
- File size limits (10MB)
- Random filename generation
- Restricted upload directories
-
Activity Logging
- Login attempts
- Data modifications
- Recommendation generation
- Quiz attempts with fraud detection
-
CORS Configuration
- Controlled cross-origin requests
- API endpoint protection
๐ AI Recommendation Engine
Algorithm Types
- Next Lesson: Suggests the next logical lesson based on progress
- Review: Recommends revisiting content for struggling students (score < 60%)
- Challenge: Advanced content for high performers (score โฅ 85%)
- Remedial: Content review based on quiz performance
How It Works
1. Analyze student performance data
- Quiz scores
- Assignment grades
- Lesson completion rates
- Time spent on lessons
2. Apply rule-based logic
- High performers โ Challenging content
- Struggling students โ Review and remedial
- Average students โ Next lessons
3. Generate personalized recommendations
- Priority scoring (0-10)
- Reason explanation
- Course/lesson linking
4. Send notifications
- Real-time alerts
- Dashboard display
๐งช Demo Accounts
| Role | Password | |
|---|---|---|
| Student | sangwabgy | Admin@123! |
| Student | jackson | Admin@123! |
| Teacher | Teacher1 | Admin@123! |
| Admin | admin | Admin@123! |
๐ฑ API Endpoints
Authentication
POST /api/auth.php?action=login- User loginPOST /api/auth.php?action=register- User registrationPOST /api/auth.php?action=logout- User logoutGET /api/auth.php?action=current- Get current user
Courses
GET /api/courses.php?action=list- List all coursesGET /api/courses.php?action=get&id={id}- Get course detailsPOST /api/courses.php?action=create- Create coursePUT /api/courses.php?action=update&id={id}- Update courseDELETE /api/courses.php?action=delete&id={id}- Delete course
Enrollments
GET /api/enrollments.php?action=student_courses- Get student's coursesGET /api/enrollments.php?action=course_students- Get course studentsPOST /api/enrollments.php?action=enroll- Enroll in coursePUT /api/enrollments.php?action=update_progress- Update progress
Recommendations
GET /api/recommendations.php?action=get- Get recommendationsPOST /api/recommendations.php?action=generate- Generate new recommendationsPOST /api/recommendations.php?action=mark_viewed- Mark as viewed
๐ Multi-Language Support
Supported languages:
- English (en): Default
- French (fr): Full translation
- Kinyarwanda (rw): Full translation
Add translations in frontend/src/utils/translations.js
๐จ Theming
Toggle between light and dark modes using the half-moon icon in the top navigation bar. Theme preference is saved in localStorage.
๐ Analytics & Reports
Student Analytics
- Enrollment statistics
- Completion rates
- Average grades
- Study time tracking
Teacher Analytics
- Course performance metrics
- Student participation rates
- Assignment submission statistics
- Quiz score distributions
Admin Analytics
- Platform-wide metrics
- User growth trends
- Course popularity
- System performance
Report Generation
- CSV exports for data analysis
- PDF reports for presentations
- Filter by date, course, student, or grade
๐ Fraud Detection
Quiz Monitoring
- IP address tracking
- Time analysis (too fast/slow)
- Answer pattern detection
- Multiple tab detection (future enhancement)
Assignment Plagiarism
- Text similarity checking
- Submission timing analysis
- Pattern recognition
๐ ๏ธ Development
Code Standards
- PHP: PSR-12 coding standards
- JavaScript: ESLint with Airbnb config
- Comments: Clear documentation for all functions
- Naming: Descriptive variable and function names
Testing
- Unit tests for models
- Integration tests for API endpoints
- End-to-end tests with Selenium (future)
Version Control
git init
git add .
git commit -m "Initial commit: Intelligent Learning Platform"๐ฆ Dependencies
Frontend
- React 18.2.0
- Material UI 5.14.19
- React Router DOM 6.20.1
- Recharts 2.10.3
- Axios 1.6.2
Backend
- Pure PHP (no frameworks)
- MySQLi extension
- GD Library (image processing)
๐ Troubleshooting
Common Issues
-
Database Connection Error
- Check MySQL is running
- Verify credentials in
backend/config/database.php - Ensure database exists
-
CORS Errors
- Check API endpoint URL in AuthContext
- Verify CORS headers in API files
- Enable
mod_headersin Apache
-
File Upload Fails
- Check directory permissions (755)
- Verify
upload_max_filesizein php.ini - Ensure uploads folder exists
-
Session Not Persisting
- Check
session.cookie_samesitein php.ini - Verify
withCredentials: truein Axios requests - Ensure cookies are enabled in browser
- Check
๐ License
This project is licensed under the MIT License. See LICENSE file for details.
๐ฅ Support
For questions and support:
- Email: support@eduplatform.edu
- Documentation: /docs
- Issue Tracker: GitHub Issues
๐ง Roadmap
Phase 1 (Current)
- โ Core functionality
- โ AI recommendations
- โ Multi-language support
- โ Analytics dashboard
Phase 2 (Upcoming)
- ๐ Real-time chat
- ๐ Video conferencing integration
- ๐ Mobile app (React Native)
- ๐ Advanced fraud detection
Phase 3 (Future)
- ๐ Machine learning models
- ๐ Blockchain certificates
- ๐ Gamification features
- ๐ Advanced analytics with AI
๐ Acknowledgments
Built with modern web technologies and best practices for educational institutions worldwide.
Version: 1.0.0
Last Updated: November 2024
Maintained by: Development Team