This E-Learning Platform is a comprehensive web application designed to facilitate online learning with an integrated automated quiz system. It provides functionalities for users (students and administrators) to manage learning materials, take quizzes, and interact with a chatbot for assistance. The platform aims to offer an interactive and engaging learning experience, leveraging modern web technologies and AI integration for enhanced user support.
- User Authentication: Secure login and registration for both students and administrators, ensuring role-based access to different parts of the system.
- Role-Based Access Control: Distinct functionalities and dashboards for administrators (e.g., managing content, creating quizzes) and students (e.g., viewing notes, taking quizzes).
- Lecture Note Management: Administrators can easily upload, organize, and manage lecture notes, typically in PDF format. Students can then access and view these notes directly within the platform.
- Automated Quiz System:
- Quiz Creation: Administrators have the capability to create new quizzes, linking them to specific lecture notes or topics.
- Question and Option Management: Questions can be added to quizzes, along with multiple-choice options, and the correct answer can be designated.
- Quiz Taking: Students can take assigned quizzes, and their responses are recorded.
- Automated Scoring: The system automatically scores quizzes upon submission, providing immediate feedback to students.
- Score Tracking: Student scores are stored in the database, allowing for progress tracking and performance analysis.
- Interactive Chatbot: An AI-powered chatbot is integrated into the platform to provide instant support and answer user queries. This chatbot leverages the OpenRouter API (specifically the DeepSeek model) to offer intelligent responses related to course content, platform usage, or general study tips.
- User Dashboards:
- Student Dashboard: Provides students with an overview of their courses, accessible lecture notes, pending quizzes, and performance metrics.
- Administrator Dashboard: Offers administrators tools for content management, user management, quiz creation, and system monitoring.
- File Uploads: Supports the secure upload of lecture notes (PDFs) to the server.
- Responsive Design: The platform is built with a responsive design approach (utilizing Bootstrap), ensuring optimal viewing and interaction across various devices, including desktops, tablets, and mobile phones.
This project is built using a combination of popular web development technologies:
-
Frontend:
- HTML5: For structuring the web content.
- CSS3: For styling and layout, including custom styles and a modern, glassmorphism-inspired design.
- Bootstrap 5.3: A powerful front-end framework for responsive and mobile-first development, providing pre-built components and a grid system.
- JavaScript: For interactive elements, form validation, and dynamic content updates.
- Font Awesome: For scalable vector icons.
- Google Fonts (Inter, Space Grotesk): For modern and readable typography.
-
Backend:
- PHP: The server-side scripting language used for handling business logic, database interactions, and API integrations.
- Composer: PHP dependency manager, used for managing external libraries like
vlucas/phpdotenv. vlucas/phpdotenv: A PHP library to load environment variables from a.envfile, enhancing security by keeping sensitive information out of the codebase.
-
Database:
- MySQL: A robust relational database management system used to store all application data, including user information, lecture notes, quiz questions, options, student answers, and chatbot logs.
-
API Integration:
- OpenRouter API: Utilized for the intelligent chatbot functionality, connecting to various large language models (specifically
deepseek/deepseek-chat:freein this implementation) to provide AI-driven responses.
- OpenRouter API: Utilized for the intelligent chatbot functionality, connecting to various large language models (specifically
To set up and run this E-Learning Platform project locally, follow these detailed steps:
-
Clone the repository: First, clone the project repository from GitHub to your local machine using Git:
git clone <repository_url>
Replace
<repository_url>with the actual URL of your GitHub repository (e.g.,https://github.com/your-username/elearning-platform.git). -
Set up a web server environment: This project requires a web server environment that supports PHP and MySQL. Popular choices include:
- XAMPP: (Windows, macOS, Linux) A free and open-source cross-platform web server solution stack package developed by Apache Friends, consisting mainly of the Apache HTTP Server, MariaDB (a MySQL fork), and interpreters for scripts written in the PHP and Perl programming languages.
- WAMP: (Windows) Windows Apache MySQL PHP.
- LAMP: (Linux) Linux Apache MySQL PHP.
- MAMP: (macOS) macOS Apache MySQL PHP.
Ensure you have one of these environments installed and configured on your system.
-
Place project files: After cloning, locate the
elearning_platformfolder. Copy this entire folder into your web server's document root directory. Common locations are:- For XAMPP:
C:\xampp\htdocs\(on Windows) or/Applications/XAMPP/htdocs/(on macOS). - For WAMP:
C:\wamp\www\. - For LAMP/MAMP: The equivalent
htdocsorwwwdirectory.
Example: If you are using XAMPP on Windows, the path to your project will be
C:\xampp\htdocs\elearning_platform. - For XAMPP:
-
Install Composer dependencies: This project uses Composer to manage its PHP dependencies. You need to install Composer if you haven't already. Then, navigate to the
elearning_platformdirectory in your terminal or command prompt and run the following command:cd C:\xampp\htdocs\elearning_platform # Adjust path as per your setup composer install
This command will download and install all the required PHP libraries, including
vlucas/phpdotenv, into thevendor/directory.
-
Create a MySQL database: Open your preferred MySQL client (e.g., phpMyAdmin, MySQL Workbench, or the command line).
- If using phpMyAdmin, typically accessible via
http://localhost/phpmyadminin your web browser. - Create a new database. The project expects the database to be named
elearning_platform. You can do this by executing the SQL commandCREATE DATABASE elearning_platform;or by using the graphical interface.
- If using phpMyAdmin, typically accessible via
-
Import the database schema: The database schema and initial data are provided in the
elearning_platform.sqlfile, located directly within theelearning_platform/project directory. Import this SQL file into theelearning_platformdatabase you just created. In phpMyAdmin, you can typically do this by selecting the database, going to the
Import tab, and uploading the elearning_platform.sql file.
This SQL file contains the schema for the following tables:
### Database Schema Overview:
**`user` table:** Stores user authentication and role information.
| Column | Type | Description |
| :----------- | :----------- | :-------------------------------------------- |
| `UserID` | `INT` | Primary Key, Auto-increment |
| `Username` | `VARCHAR(50)`| Unique username for login |
| `Email` | `VARCHAR(100)`| Unique email address for login |
| `Password` | `VARCHAR(255)`| Hashed password (using `password_hash`) |
| `Role` | `ENUM(\'admin\',\'student\')`| User role (`admin` or `student`) |
| `Created_At` | `TIMESTAMP` | Timestamp of user creation |
**`lecture_note` table:** Stores details about uploaded lecture notes.
| Column | Type | Description |
| :------------ | :----------- | :-------------------------------------------- |
| `NoteID` | `INT` | Primary Key, Auto-increment |
| `UserID` | `INT` | Foreign Key referencing `user.UserID` (uploader)|
| `Title` | `VARCHAR(100)`| Title of the lecture note |
| `File_Path` | `VARCHAR(255)`| Path to the uploaded PDF file on the server |
| `Upload_Date` | `TIMESTAMP` | Timestamp of upload |
**`quiz` table:** Stores information about quizzes.
| Column | Type | Description |
| :------------ | :----------- | :-------------------------------------------- |\n | `QuizID` | `INT` | Primary Key, Auto-increment |
| `NoteID` | `INT` | Foreign Key referencing `lecture_note.NoteID` (optional link to notes)|
| `Quiz_Title` | `VARCHAR(100)`| Title of the quiz |
| `Creation_Date`| `TIMESTAMP` | Timestamp of quiz creation |
**`question` table:** Stores individual quiz questions.
| Column | Type | Description |
| :------------- | :----------- | :-------------------------------------------- |
| `QuestionID` | `INT` | Primary Key, Auto-increment |
| `QuizID` | `INT` | Foreign Key referencing `quiz.QuizID` |
| `Question_Text`| `TEXT` | The full text of the question |
**`option` table:** Stores multiple-choice options for quiz questions.
| Column | Type | Description |
| :----------- | :----------- | :-------------------------------------------- |
| `OptionID` | `INT` | Primary Key, Auto-increment |
| `QuestionID` | `INT` | Foreign Key referencing `question.QuestionID` |
| `Option_Text`| `VARCHAR(100)`| The text of the option |
| `Is_Correct` | `TINYINT(1)` | `1` if correct, `0` if incorrect |
**`student_answer` table:** Records student responses to quiz questions.
| Column | Type | Description |
| :-------------- | :----------- | :-------------------------------------------- |
| `AnswerID` | `INT` | Primary Key, Auto-increment |
| `UserID` | `INT` | Foreign Key referencing `user.UserID` |
| `QuestionID` | `INT` | Foreign Key referencing `question.QuestionID` |
| `Selected_Answer`| `INT` | ID of the option selected by the student |
| `Answer_Date` | `TIMESTAMP` | Timestamp of the answer submission |
| `Score` | `INT` | Score obtained for this specific answer (e.g., 1 for correct, 0 for incorrect)|
**`chatbot_log` table:** Logs interactions with the AI chatbot.
| Column | Type | Description |
| :--------------- | :----------- | :-------------------------------------------- |
| `LogID` | `INT` | Primary Key, Auto-increment |
| `UserID` | `INT` | Foreign Key referencing `user.UserID` |
| `Query` | `TEXT` | User's input query to the chatbot |
| `Response` | `TEXT` | Chatbot's generated response |
| `Confidence_Score`| `FLOAT` | (Optional) Confidence score of the response |
| `Log_Date` | `TIMESTAMP` | Timestamp of the interaction |
-
Configure database connection: Open the
config.phpfile located in theelearning_platform/directory. Ensure the database connection details within this file match your MySQL server configuration:$host = 'localhost'; $username = 'root'; $password = ''; // Your MySQL password here $database = 'elearning_platform';
$host: Your database host (typicallylocalhost).$username: Your MySQL username (default isrootfor XAMPP/WAMP).$password: Your MySQL password. If you have set a password for your MySQLrootuser, enter it here. Otherwise, leave it empty ('').$database: The name of the database you created in the previous step (elearning_platform).
-
Configure OpenRouter API Key: The chatbot functionality relies on the OpenRouter API. For security reasons, it's highly recommended to store your API key as an environment variable. The project uses
phpdotenvto load these variables.Create a new file named
.envin the root of yourelearning_platformdirectory (the same directory asindex.phpandconfig.php). Add the following line to this.envfile, replacingyour_openrouter_api_key_herewith your actual OpenRouter API key:OPENROUTER_API_KEY="your_openrouter_api_key_here"You can obtain an OpenRouter API key from their website after signing up.
Once the installation and database setup are complete, you can access and use the E-Learning Platform:
-
Start your web server: Ensure that your Apache (or equivalent) and MySQL services are running through your XAMPP/WAMP/LAMP control panel.
-
Access the application: Open your web browser and navigate to the URL where your project is hosted. If you placed it in
htdocsaselearning_platform, the URL will typically be:http://localhost/elearning_platform -
Register/Login:
- For Students: You can register a new student account through the registration page. Once registered, log in to access the student dashboard, view lecture notes, and take quizzes.
- For Administrators: The
elearning_platform.sqlfile might contain a default admin user (e.g.,adminwith a pre-hashed password). Check theusertable in your database for initial admin credentials, or register a new user and manually change theirRoletoadminin the database if needed.
-
Explore Features:
- Admin Panel: Administrators can upload new lecture notes, create quizzes, add questions and options, and manage users.
- Student Panel: Students can browse uploaded notes, attempt quizzes, and interact with the chatbot for assistance.
Contributions are welcome! If you'd like to contribute to this project, please follow these steps:
- Fork the repository: Click the 'Fork' button at the top right of the project's GitHub page.
- Clone your forked repository:
git clone https://github.com/your-username/elearning-platform.git
- Create a new branch:
(Choose a descriptive name for your feature or bug fix.)
git checkout -b feature/your-feature-name
- Make your changes: Implement your features or bug fixes.
- Commit your changes:
git commit -m 'Add a concise and descriptive commit message' - Push to the branch:
git push origin feature/your-feature-name
- Open a Pull Request: Go to the original repository on GitHub and open a new pull request from your forked repository and branch.
This project is open-source and available under the MIT License.














