Project Overview: EduAssign – Teacher-Student Assignment
Portal
Introduction:
EduAssign is a web-based platform
designed to facilitate seamless assignment management between teachers and
students. The system allows teachers to create and assign tasks, track
submissions, provide feedback, update assignment statuses, and assign grades.
Students can submit their assignments, view teacher feedback, and track their
progress. The platform enhances the learning experience by making assignment
management more organized and efficient.
Features of the Project
🔹 Teacher Features:
✅ Create and assign new assignments.
✅ Set deadlines for submissions.
✅ View submitted assignments from students.
✅ Provide feedback and comments.
✅ Update assignment status (Pending, Checked, Graded).
✅ Assign marks/grades to students.
✅ Download student submissions.
✅ Send notifications/reminders to students.
🔹 Student Features:
✅ View assigned tasks and deadlines.
✅ Submit assignments in various file formats (PDF, DOC, etc.).
✅ Check assignment status (Submitted, Checked, Graded).
✅ Receive teacher feedback and marks.
✅ Edit and resubmit assignments (if allowed).
✅ Receive notifications for new assignments and due dates.
🔹 Admin Features (Optional):
✅ Manage teacher and student accounts.
✅ Monitor assignment activities and generate reports.
✅ View student performance and submission records.
🔹 Additional Features:
✅ Secure authentication (Login system for students and
teachers).
✅ Dashboard for tracking assignments and performance.
✅ Search and filter assignments by subject, date, or status.
✅ File upload/download support for assignments.
✅ Automated email or SMS notifications for deadlines and
feedback.
2.
Objectives of the Project
📌 Simplify
Assignment Management: Provide an easy-to-use platform for teachers to
create, distribute, and grade assignments.
📌 Improve
Teacher-Student Communication: Ensure smooth interaction between
teachers and students regarding assignment feedback and grading.
📌 Enhance Student
Performance Tracking: Allow students to track their assignment
progress and learn from teacher feedback.
📌 Reduce
Paperwork & Save Time: Digitizing assignments minimizes paperwork,
making submission and grading more efficient.
📌 Provide a
Structured & Organized System: Ensure assignments, deadlines, and
grading are systematically managed for both students and teachers.
📌 Increase
Transparency in Grading: Students can view marks, comments, and
improvements suggested by the teacher.
📌 Enable Remote
Learning Support: The platform can be accessed online, allowing
students and teachers to interact remotely.
3.
Scope of the Project
🔹 For Schools,
Colleges, and Universities:
- Can be used by educational
institutions to manage assignments and grading efficiently.
🔹 For Online
Learning Platforms:
- Integrates with e-learning
systems where students need to submit coursework.
🔹 For Individual
Teachers & Tutors:
- Private tutors can manage
homework and assignments for their students.
🔹 For Corporate
Training Programs:
- Companies can use it for
employee skill assessments and training assignments.
🔹 Future
Enhancements:
- AI-powered plagiarism detection.
- Integration with Google
Classroom and Learning Management Systems (LMS).
- Mobile app support for
assignment submissions.
- Live chat feature for
teacher-student communication.
- Analytics for tracking student
performance over time.
Conclusion
EduAssign is a powerful,
user-friendly assignment management system that improves the way teachers
assign tasks and grade students. By offering a structured and transparent
system, it helps in better academic performance tracking and ensures effective
communication between teachers and students.
Modules of the Project
The project consists of four main
modules:
1. Authentication
Module (User Login & Registration)
2. Teacher
Module (Assignment Creation & Grading)
3. Student
Module (Assignment Submission & Tracking)
4. Admin
Module (User Management & Reports)
Each module has its functionalities
and respective database tables.
1. Authentication Module (User Login &
Registration)
Functionalities:
✅ User registration (Teacher/Student)
✅ User login/logout
✅ Password reset functionality
✅ Role-based authentication (Student, Teacher, Admin)
Database
Tables:
1.
users
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
user ID |
name |
VARCHAR |
Full
name |
email |
VARCHAR |
Unique
email address |
password |
VARCHAR |
Hashed
password |
role |
ENUM |
'student',
'teacher', 'admin' |
created_at |
TIMESTAMP |
Account
creation date |
updated_at |
TIMESTAMP |
Last
update time |
2. Teacher Module (Assignment Creation &
Grading)
Functionalities:
✅ Create assignments with title, description, and deadline
✅ Assign tasks to students or specific classes
✅ View submitted assignments
✅ Provide feedback and grades to students
✅ Update assignment status (Pending, Checked, Graded)
Database
Tables:
2.
assignments
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
assignment ID |
teacher_id |
INT
(FK) |
ID
of the teacher who created it |
title |
VARCHAR |
Assignment
title |
description |
TEXT |
Assignment
details |
deadline |
DATE |
Due
date |
created_at |
TIMESTAMP |
Assignment
creation date |
updated_at |
TIMESTAMP |
Last
update time |
3.
submissions
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
submission ID |
assignment_id |
INT
(FK) |
ID
of the assignment |
student_id |
INT
(FK) |
ID
of the student who submitted |
file_path |
VARCHAR |
Path
of uploaded assignment file |
submitted_at |
TIMESTAMP |
Submission
time |
status |
ENUM |
'Pending',
'Checked', 'Graded' |
feedback |
TEXT |
Teacher's
feedback |
marks |
INT |
Marks/grade
given by teacher |
3. Student Module (Assignment Submission &
Tracking)
Functionalities:
✅ View assigned tasks and deadlines
✅ Upload assignment files (PDF, DOC, etc.)
✅ Check assignment status (Pending, Checked, Graded)
✅ View teacher feedback and marks
Database
Tables:
(Uses
the same assignments and submissions tables)
4.
student_assignments (To track which student gets which assignment)
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
record ID |
assignment_id |
INT
(FK) |
ID
of the assigned task |
student_id |
INT
(FK) |
ID
of the student |
status |
ENUM |
'Pending',
'Submitted', 'Graded' |
created_at |
TIMESTAMP |
Record
creation date |
4. Admin Module (User Management & Reports)
Functionalities:
✅ Manage teacher and student accounts
✅ View all assignments and submissions
✅ Generate reports on student performance
✅ Send system-wide announcements
Database
Tables:
5.
notifications (For system-wide alerts)
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
notification ID |
user_id |
INT
(FK) |
Recipient
user ID |
message |
TEXT |
Notification
content |
created_at |
TIMESTAMP |
Notification
timestamp |
6.
reports (For student performance tracking)
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
report ID |
student_id |
INT
(FK) |
ID
of the student |
total_marks |
INT |
Total
marks obtained |
average_marks |
FLOAT |
Average
performance score |
created_at |
TIMESTAMP |
Report
generated date |
Conclusion
This project provides a structured
and efficient way for teachers to assign work, students to submit it, and
admins to manage the process. It ensures transparency in grading and simplifies
assignment tracking.
1. Users Table (Authentication
& Role Management)
Stores information about teachers,
students, and admins.
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
user ID |
name |
VARCHAR(255) |
Full
name |
email |
VARCHAR(255) |
Unique
email address |
password |
VARCHAR(255) |
Hashed
password |
role |
ENUM |
'student',
'teacher', 'admin' |
created_at |
TIMESTAMP |
Account
creation date |
updated_at |
TIMESTAMP |
Last
update timestamp |
2. Assignments Table (Teacher Creates Assignments)
Stores details about assignments
created by teachers.
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
assignment ID |
teacher_id |
INT
(FK) |
ID
of the teacher who created it |
title |
VARCHAR(255) |
Assignment
title |
description |
TEXT |
Assignment
details |
deadline |
DATE |
Due
date for submission |
created_at |
TIMESTAMP |
Assignment
creation timestamp |
updated_at |
TIMESTAMP |
Last
update timestamp |
3. Submissions Table (Students Submit
Assignments)
Stores student submissions for
assignments.
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
submission ID |
assignment_id |
INT
(FK) |
Assignment
ID |
student_id |
INT
(FK) |
ID
of the student who submitted |
file_path |
VARCHAR(255) |
Path
of the uploaded file |
submitted_at |
TIMESTAMP |
Submission
timestamp |
status |
ENUM |
'Pending',
'Checked', 'Graded' |
feedback |
TEXT |
Teacher's
feedback on submission |
marks |
INT |
Marks
awarded by the teacher |
4. Student Assignments Table (Tracking Assigned
Work)
Links students with assignments they
need to complete.
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
record ID |
assignment_id |
INT
(FK) |
ID
of the assigned task |
student_id |
INT
(FK) |
ID
of the student |
status |
ENUM |
'Pending',
'Submitted', 'Graded' |
created_at |
TIMESTAMP |
Record
creation timestamp |
5. Notifications Table (Alerts & Reminders)
Stores system notifications for
students and teachers.
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
notification ID |
user_id |
INT
(FK) |
Recipient
user ID |
message |
TEXT |
Notification
content |
created_at |
TIMESTAMP |
Notification
timestamp |
6. Reports Table (Student Performance Tracking)
Stores reports on student performance
for analytics.
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
report ID |
student_id |
INT
(FK) |
ID
of the student |
total_marks |
INT |
Total
marks obtained |
average_marks |
FLOAT |
Average
marks across assignments |
created_at |
TIMESTAMP |
Report
generated timestamp |
7. Admin Table (Optional - For Admin Management)
Stores admin user information.
Column |
Data
Type |
Description |
id |
INT
(PK) |
Unique
admin ID |
name |
VARCHAR(255) |
Admin
full name |
email |
VARCHAR(255) |
Unique
email |
password |
VARCHAR(255) |
Hashed
password |
created_at |
TIMESTAMP |
Account
creation timestamp |
Additional
Tables (Optional Enhancements)
1. comments
– If students/teachers can communicate through comments on assignments.
2. subjects
– If assignments are categorized by subjects.
3. classrooms
– If the system supports class-based assignments.
Entity-Relationship
(ER) Diagram and Data Flow Diagram (DFD) for EduAssign: Teacher-Student
Assignment Portal
1. ER Diagram (Entity-Relationship Diagram)
The ER Diagram represents the entities, their attributes, and
relationships in the system.
Entities
& Relationships:
1. User
(Teacher & Student)
o A
user can be either a teacher or a student.
o A
teacher can create assignments.
o A
student can submit assignments.
2. Assignment
o Created
by a teacher.
o Assigned
to students.
o Linked
with submissions.
3. Submission
o Made
by a student.
o Checked
by a teacher.
o Contains
marks and feedback.
4. Notifications
o Sent
to students and teachers.
o Alerts
about new assignments, deadlines, and results.
5. Reports
o Stores
student performance records.
ER
Diagram Overview:
- Primary Keys (PK)
uniquely identify records.
- Foreign Keys (FK)
establish relationships between tables.
2.
Data Flow Diagram (DFD)
DFD represents how data moves through
the system. We use two levels:
Level
0 (Context Diagram)
·
Actors:
- Teacher:
Creates assignments, checks submissions, gives marks.
- Student:
Views assignments, submits work.
- Admin (Optional):
Manages users, assignments.
·
Main Processes:
1.
User Login & Registration
2.
Teacher Creates Assignments
3.
Student Submits Assignment
4.
Teacher Checks & Grades Submission
5.
Notifications & Reports
Level
1 DFD (Detailed Flow)
Each major process in Level 0 is broken into sub-processes:
1. User
Authentication
o Input:
User credentials.
o Process:
Check login details.
o Output:
Access granted or denied.
2. Assignment
Management
o Teacher
creates an assignment.
o Assignment
stored in the database.
3. Submission
Management
o Student
submits an assignment.
o The
system stores the file & updates submission status.
4. Grading
& Feedback
o Teacher
reviews the submission.
o Assigns
marks & provides feedback.
5. Notification
System
o System
sends deadline reminders.
o Notifies
students of grades.
6. Performance
Report Generation
o System
calculates student progress.
o Generates
reports for teachers & students.
Project
Structure of EduAssign: Teacher-Student Assignment Portal (Using MVC in PHP)
Using the Model-View-Controller (MVC) architecture, we organize the
project into three primary components:
- Model (M)
→ Handles database interactions.
- View (V)
→ Manages the user interface.
- Controller (C)
→ Processes user requests and communicates between Model & View.
📂 Project Folder Structure
EduAssign/
│── app/
│ ├── controllers/
│ │ ├── AuthController.php
│ │ ├── AssignmentController.php
│ │ ├── SubmissionController.php
│ │ ├── UserController.php
│ │ ├── NotificationController.php
│ │ ├── ReportController.php
│ │ ├── AdminController.php
│ │
│ ├── models/
│ │ ├──
User.php
│ │ ├── Assignment.php
│ │ ├── Submission.php
│ │ ├── Notification.php
│ │ ├── Report.php
│ │
│ ├── views/
│ │ ├── auth/
│ │ │ ├──
login.php
│ │ │ ├── register.php
│ │ │ ├── dashboard.php
│ │ │
│ │ ├── assignments/
│ │ │ ├──
create.php
│ │ │ ├──
view.php
│ │ │ ├── edit.php
│ │ │
│ │ ├── submissions/
│ │ │ ├── submit.php
│ │ │ ├──
view.php
│ │ │
│ │ ├── notifications/
│ │ │ ├──
index.php
│ │ │
│ │ ├── reports/
│ │ │ ├── student_report.php
│ │ │ ├── teacher_report.php
│ │
│── config/
│ ├── config.php
│ ├──
database.php
│
│──
public/
│ ├── css/
│ │ ├── style.css
│ ├── js/
│ │ ├── script.js
│ ├── uploads/
│ │ ├── assignment_submissions/
│ ├──
index.php
│
│── routes/
│ ├── web.php
│
│── core/
│ ├── Controller.php
│ ├── Model.php
│ ├──
View.php
│
│── helpers/
│ ├──
functions.php
│
│── .htaccess
│── composer.json
│── README.md
📌 Explanation of Each
Folder:
1.
app/
(Main Application Folder)
·
controllers/
→ Manages request handling and
logic.
AuthController.php
: Handles login, registration.AssignmentController.php
: Manages assignment creation, update, deletion.SubmissionController.php
: Handles student assignment submissions.NotificationController.php
: Sends notifications to users.ReportController.php
: Generates student performance reports.
·
models/
→ Handles database operations.
User.php
: Manages user authentication.Assignment.php
: Handles CRUD operations for assignments.Submission.php
: Manages student submissions.
·
views/
→ Contains HTML templates for pages.
- Organized into subfolders:
auth/
,assignments/
,submissions/
,reports/
.
2.
config/
(Configuration Files)
config.php
→ Stores global settings like session, timezone.database.php
→ Handles database connection.
3.
public/
(Public Assets)
css/
→ Stylesheets (style.css
).js/
→ JavaScript files (script.js
).uploads/
→ Stores assignment submissions.index.php
→ Entry point for the application.
4.
routes/
(Routing System)
web.php
→ Defines URL routes like:
$router->
get(
'/login',
'AuthController@login');
$router->
post(
'/submit-assignment',
'SubmissionController@store');
5.
core/
(MVC Core Components)
Controller.php
→ Parent class for controllers.Model.php
→ Parent class for database models.View.php
→ Handles loading views.
6.
helpers/
(Helper Functions)
functions.php
→ Contains custom helper functions.
7.
.htaccess
(URL Rewriting)
- Enables clean URLs.
📌 Example Code Snippets
🔹 User.php
(Model)
class User extends Model {
protected
$table =
'users';
public
function getUserByEmail($email) {
return
$this->db->
query(
"SELECT * FROM users WHERE email = ?", [
$email])->
fetch();
}
}
🔹 AuthController.php
(Controller)
class AuthController extends Controller {
public
function login() {
$this->
view(
'auth/login');
}
public
function authenticate() {
$email =
$_POST[
'email'];
$password =
$_POST[
'password'];
$userModel =
new
User();
$user =
$userModel->
getUserByEmail(
$email);
if (
$user &&
password_verify(
$password,
$user[
'password'])) {
$_SESSION[
'user_id'] =
$user[
'id'];
header(
'Location: /dashboard');
}
else {
$this->
view(
'auth/login', [
'error' =>
'Invalid credentials']);
}
}
}
🔹 login.php
(View)
<form method=
"POST" action=
"/authenticate">
<input type=
"email" name=
"email" placeholder=
"Enter Email" required>
<input type=
"password" name=
"password" placeholder=
"Enter Password" required>
<button type=
"submit">Login</button>
</form>
📌 Summary
This MVC project structure separates concerns, making the code cleaner and easier
to maintain.
Project Structure of EduAssign: Teacher-Student
Assignment Portal (Without MVC in PHP)
If you are not using MVC, the project will follow a traditional procedural PHP structure where
pages directly handle database queries and display content.
📂 Project Folder Structure (Without
MVC)
EduAssign/
│──
admin/
│ ├── dashboard.php
│ ├── manage_assignments.php
│ ├── check_submissions.php
│ ├── update_marks.php
│ ├── manage_students.php
│ ├── reports.php
│ ├── logout.php
│
│── student/
│ ├── dashboard.php
│ ├── view_assignments.php
│ ├── submit_assignment.php
│ ├── view_marks.php
│ ├── notifications.php
│ ├── logout.php
│
│── includes/
│ ├── db_connect.php
│ ├──
header.php
│ ├── footer.php
│ ├── sidebar.php
│ ├──
functions.php
│
│── uploads/
│ ├── assignments/
│ ├── submissions/
│
│── assets/
│ ├── css/
│ │ ├── style.css
│ ├── js/
│ │ ├── script.js
│ ├── images/
│
│── auth/
│ ├──
login.php
│ ├── register.php
│ ├── forgot_password.php
│
│── config/
│ ├── config.php
│
│──
index.php
│── README.md
│── .htaccess
📌 Explanation of Each
Folder:
1.
admin/
(Admin Panel)
This folder contains pages where
teachers manage assignments, check submissions, and grade students.
dashboard.php
→ Main admin dashboard.manage_assignments.php
→ Create, edit, and delete assignments.check_submissions.php
→ View student submissions.update_marks.php
→ Assign marks to students.manage_students.php
→ Add/edit student details.reports.php
→ View student performance reports.
2.
student/
(Student Panel)
This folder contains pages where
students view assignments, submit work, and check marks.
dashboard.php
→ Main student dashboard.view_assignments.php
→ View available assignments.submit_assignment.php
→ Upload completed assignments.view_marks.php
→ Check assignment marks.notifications.php
→ View teacher notifications.
3.
includes/
(Common Files)
This folder contains reusable code
snippets to avoid repetition.
db_connect.php
→ Database connection script.header.php
→ Common header for all pages.footer.php
→ Common footer for all pages.sidebar.php
→ Sidebar navigation for dashboards.functions.php
→ Common utility functions.
4.
uploads/
(Assignment Files)
assignments/
→ Stores teacher-uploaded assignments.submissions/
→ Stores student-submitted work.
5.
assets/
(Static Resources)
Contains styles, JavaScript, and
images.
css/
→ CSS stylesheets (style.css
).js/
→ JavaScript files (script.js
).images/
→ Any required images.
6.
auth/
(Authentication)
Handles user login and registration.
login.php
→ Login page for students & teachers.register.php
→ Registration page for students.forgot_password.php
→ Password recovery.
7.
config/
(Configuration Files)
config.php
→ Stores database and session configurations.
8.
Root Files
index.php
→ Homepage or redirection to login.README.md
→ Documentation..htaccess
→ URL rewriting (optional).
📌 Example Code Snippets
🔹 db_connect.php
(Database Connection)
<?php
$host =
"localhost";
$user =
"root";
$password =
"";
$database =
"eduassign";
$conn =
mysqli_connect(
$host,
$user,
$password,
$database);
if (!
$conn) {
die(
"Database connection failed: " .
mysqli_connect_error());
}
?>
🔹 login.php
(User Login)
<?php
include
"../includes/db_connect.php";
session_start();
if (
$_SERVER[
"REQUEST_METHOD"] ==
"POST") {
$email =
$_POST[
'email'];
$password =
$_POST[
'password'];
$query =
"SELECT * FROM users WHERE email='$email'";
$result =
mysqli_query(
$conn,
$query);
$user =
mysqli_fetch_assoc(
$result);
if (
$user &&
password_verify(
$password,
$user[
'password'])) {
$_SESSION[
'user_id'] =
$user[
'id'];
$_SESSION[
'role'] =
$user[
'role'];
// student or teacher
if (
$user[
'role'] ==
'teacher') {
header(
"Location: ../admin/dashboard.php");
}
else {
header(
"Location: ../student/dashboard.php");
}
}
else {
echo
"Invalid login!";
}
}
?>
<form method=
"POST">
<input type=
"email" name=
"email" placeholder=
"Enter Email" required>
<input type=
"password" name=
"password" placeholder=
"Enter Password" required>
<button type=
"submit">Login</button>
</form>
🔹 manage_assignments.php
(Admin - Create Assignment)
<?php
include
"../includes/db_connect.php";
session_start();
if (
$_SESSION[
'role'] !=
'teacher') {
header(
"Location: ../auth/login.php");
}
if (
$_SERVER[
"REQUEST_METHOD"] ==
"POST") {
$title =
$_POST[
'title'];
$description =
$_POST[
'description'];
$deadline =
$_POST[
'deadline'];
$query =
"INSERT INTO assignments (title, description, deadline) VALUES ('$title', '$description', '$deadline')";
mysqli_query(
$conn,
$query);
echo
"Assignment Created Successfully!";
}
?>
<form method=
"POST">
<input type=
"text" name=
"title" placeholder=
"Assignment Title" required>
<textarea name=
"description" placeholder=
"Description" required></textarea>
<input type=
"date" name=
"deadline" required>
<button type=
"submit">Create Assignment</button>
</form>
📌 Advantages of Non-MVC
Structure
✅ Simple and easy to understand for beginners.
✅ Faster development for small projects.
✅ No need for complex routing systems.
🚨 Disadvantages
❌ Harder to maintain as the project grows.
❌ Code duplication across different files.
❌ Difficult to implement advanced features like API
integration.
📌 Conclusion
This non-MVC
project structure is best for small
projects but may become harder
to manage for large-scale applications.
Project Structure of EduAssign: Teacher-Student
Assignment Portal (Using Python with Flask)
If you are building this EduAssign project using Python and Flask, you should follow a
structured MVC (Model-View-Controller)
approach. Below is the Flask project
structure with explanations.
📂 Project Folder Structure (Using
Flask MVC)
EduAssign/
│── app/
│ ├── static/
│ │ ├── css/
│ │ │ ├── style.css
│ │ ├── js/
│ │ │ ├── script.js
│ │ ├── images/
│ │
│ ├── templates/
│ │ ├──
admin/
│ │ │ ├── dashboard.html
│ │ │ ├── manage_assignments.html
│ │ │ ├── check_submissions.html
│ │ │ ├── update_marks.html
│ │ │ ├── manage_students.html
│ │ ├── student/
│ │ │ ├── dashboard.html
│ │ │ ├── view_assignments.html
│ │ │ ├── submit_assignment.html
│ │ │ ├── view_marks.html
│ │ ├── auth/
│ │ │ ├──
login.html
│ │ │ ├── register.html
│ │ │ ├── forgot_password.html
│ │ ├── base.html
│
│ ├── models/
│ │ ├──
database.py
│ │ ├──
user.py
│ │ ├── assignment.py
│ │ ├── submission.py
│
│ ├── routes/
│ │ ├──
admin.py
│ │ ├── student.py
│ │ ├── auth.py
│
│ ├── forms/
│ │ ├── login_form.py
│ │ ├── register_form.py
│ │ ├── assignment_form.py
│ │ ├── submission_form.py
│
│ ├── uploads/
│ │ ├── assignments/
│ │ ├── submissions/
│
│ ├── __init__.py
│ ├── config.py
│ ├── utils.py
│
│── migrations/
│── tests/
│── .env
│── run.py
│── requirements.txt
│── README.md
│── .gitignore
📌 Explanation of Each
Folder:
1.
static/
(Static Assets)
Stores static resources like CSS, JavaScript, and images used in the
frontend.
css/
→ Contains stylesheets likestyle.css
.js/
→ Contains JavaScript files likescript.js
.images/
→ Stores images used in the project.
2.
templates/
(HTML Templates)
Contains HTML templates for rendering pages using Flask’s render_template()
.
admin/
→ Templates for the admin (teacher) panel.student/
→ Templates for the student panel.auth/
→ Templates for login, registration, and password reset.base.html
→ Base template for reusability.
3.
models/
(Database Models)
Defines database tables using SQLAlchemy.
database.py
→ Initializes database connection.user.py
→ Defines User model (Teacher & Student).assignment.py
→ Defines Assignment model.submission.py
→ Defines Submission model.
🔹 Example: user.py
(User Model)
from app.models.database
import db
class
User(db.Model):
id = db.Column(db.Integer, primary_key=
True)
name = db.Column(db.String(
100), nullable=
False)
email = db.Column(db.String(
100), unique=
True, nullable=
False)
password = db.Column(db.String(
255), nullable=
False)
role = db.Column(db.String(
20), nullable=
False)
# "teacher" or "student"
def
__init__(
self, name, email, password, role):
self.name = name
self.email = email
self.password = password
self.role = role
4.
routes/
(Controllers)
Handles URL routing for different
parts of the application.
admin.py
→ Routes for the teacher panel.student.py
→ Routes for the student panel.auth.py
→ Routes for login and registration.
🔹 Example: auth.py
(Authentication Routes)
from flask
import Blueprint, render_template, request, redirect, session
from app.models.user
import User
from app.models.database
import db
auth = Blueprint(
"auth", __name__)
@auth.route("/login", methods=["GET", "POST"])
def
login():
if request.method ==
"POST":
email = request.form[
"email"]
password = request.form[
"password"]
user = User.query.filter_by(email=email).first()
if user
and user.password == password:
session[
"user_id"] = user.
id
session[
"role"] = user.role
return redirect(
"/dashboard")
else:
return
"Invalid credentials!"
return render_template(
"auth/login.html")
5.
forms/
(WTForms)
Contains form validation classes using Flask-WTF.
login_form.py
→ Login form validation.register_form.py
→ Registration form validation.assignment_form.py
→ Assignment creation form.submission_form.py
→ Submission upload form.
6.
uploads/
(Uploaded Files)
Stores uploaded files.
assignments/
→ Teacher-uploaded assignments.submissions/
→ Student-submitted work.
7.
config.py
(Configuration Settings)
Contains database connection settings and Flask configurations.
🔹 Example: config.py
import os
class
Config:
SECRET_KEY =
"your_secret_key"
SQLALCHEMY_DATABASE_URI =
"sqlite:///eduassign.db"
SQLALCHEMY_TRACK_MODIFICATIONS =
False
8.
run.py
(Entry Point)
This file starts the Flask
application.
🔹 Example: run.py
from app
import create_app
app = create_app()
if __name__ ==
"__main__":
app.run(debug=
True)
📌 Advantages of Using
Flask with MVC
✅ Better Code
Organization (Separate Models, Views, Controllers).
✅ Easier to Scale
(Reusable components).
✅ Secure and
Maintainable (Less code repetition).
✅ Database Integration
(Using SQLAlchemy ORM).