COMPUTER SCIENCE PROJECT
Gursharan Singh
NAME OF THE STUDENT-__________________________________
11
ROLL NO.-_________________________
XII-C
CLASS-________
M.L. KHANNA DAV PUBLIC SCHOOL
SCHOOL’S NAME-_____________________________________
2025-26
SESSION-_____________
Ms. Aakanksha Verma
NAME OF GUIDE-____________________________
ACKNOWLEDGEMENT
I would like to convey my heartfelt thanks to
Mr./Mrs./Ms. .......................,
Aakanksha Verma my Computer Science
teacher who always gave valuable suggestions and
guidance during the completion of this project.
He/She has been a source of inspiration during the
completion of my project work. He/She helped me
to understand and remember important details of
the project that I would have otherwise lost. My
project has been a success only because of his/her
guidance.
Gursharan Singh
Name of the Student ........................................
Roll no. allotted by CBSE ........................................
CERTIFICATE
Gursharan Singh
This is to certify that Mr./Ms ........................................
XII-C
of Class ................. M.L. KHANNA DAV Public School
of ............................
has completed his/her project file under my
supervision. He/She has taken proper care and shown
utmost sincerity in completion of this project. I certify
that this project is upto my expectation and as per the
guidelines issued by CBSE.
Signature ............................................
Ms. Aakanksha Verma
(Project Guide)
INTRODUCTION
My Project is a mini online learning and school
management platform inspired by platforms like
Shauryasoft.
This project is designed for educational institutions to
manage students, teachers, learning resources,
exams, and communication through a single
dashboard.
It is a small-scale prototype, developed for learning
purposes using Flask (Python) and MySQL.
AIM OF THE PROJECT
To build a web-based learning platform
To implement secure login and registration
To manage different users with different roles
To display role-based dashboards
To store and retrieve data using MySQL
SCOPE OF THE PROJECT
Suitable for schools and coaching institutes
Parent and student dashboards
Teacher and admin access
Secure authentication system
Expandable to a full LMS in future
TOOLS & TECHNOLOGIES USED
Component Technology
Frontend HTML, CSS, Bootstrap
Backend Python (Flask Framework)
Database MySQL
Security Werkzeug Password Hashing
IDE VS Code
Browser Google Chrome
SYSTEM DESCRIPTION
The platform provides:
Login & Registration system
Role-based access
Student dashboard
Admin controls
Secure session handling
USER ROLES & ACCESS CONTROL
1. User (Student/Parent)
View dashboard
Check progress & results
Access timetable
View circulars and messages
2. Teacher
Manage students
Upload results
Access admin panel
3. Admin
Full system access
Manage users
Control platform content
DATABASE DESIGN
Users Table
Field Name Data Type Description
id INT Primary Key
username VARCHAR(100) User Name
email VARCHAR(100) Email Address
password VARCHAR(255) Hashed Password
role ENUM user / teacher / admin
Exams Table
Field Name Data Type Description
id INT (Primary Key) Unique exam ID
exam_name VARCHAR(100) Name of the exam
category VARCHAR(50) Subject or exam
class VARCHAR(10) Class for which
sections VARCHAR(20) Section(s) of the
exam_time TIME Duration of the
max_marks INT Maximum marks
created_by INT ID of teacher/admin
status ENUM Draft or Published
DATABASE DESIGN
Questions Table
Field Name Data Type Description
id INT (Primary Key) Unique question ID
Exam to which the
exam_id INT (Foreign Key)
question belongs
question TEXT Question text
MCQ / True-False /
question_type VARCHAR(20)
Descriptive
Answers Table
Field Name Data Type Description
id INT (Primary Key) Unique answer ID
question_id INT (Foreign Key) Related question ID
answer TEXT Correct answer
INPUT CODE
from flask import Flask, flash, render_template,
request, redirect, url_for, session
import [Link]
from [Link] import
generate_password_hash, check_password_hash
app = Flask(__name__)
app.secret_key = "dev-secret-key"
def get_db():
return [Link](
host="localhost",
user="root",
password="",
database="flask_project"
)
INPUT CODE
@app.context_processor
def inject_user():
return {
"user_id": [Link]("user_id"),
"role": [Link]("role"),
"admission_number":
[Link]("admission_number"),
"name": [Link]("name"),
"father_name": [Link]("father_name"),
"mother_name": [Link]("mother_name"),
"class": [Link]("class")
}
@[Link]("/")
def index():
if "user_id" not in session:
return redirect(url_for("login"))
return render_template("[Link]")
INPUT CODE
@[Link]("/students")
def students():
if [Link]("role") not in ["admin", "teacher"]:
flash("Access denied", "error")
return redirect(url_for("index"))
class_filter = [Link]("class")
section_filter = [Link]("section")
db = get_db()
cursor = [Link](dictionary=True)
query = "SELECT name, admission_number, class
FROM users WHERE role='user'"
params = []
if class_filter and section_filter:
query += " AND class = %s"
[Link](f"{class_filter}-{section_filter}")
INPUT CODE
elif class_filter:
query += " AND class LIKE %s"
[Link](f"{class_filter}-%")
elif section_filter:
query += " AND class LIKE %s"
[Link](f"%-{section_filter}")
[Link](query, params)
students = [Link]()
[Link]()
[Link]()
return render_template("[Link]",
students=students)
INPUT CODE
@[Link]("/add-students")
def add_students():
if [Link]("role") not in ["admin", "teacher"]:
flash("Access denied", "error")
return redirect(url_for("index"))
return render_template("[Link]")
@[Link]("/create-exam", methods=["GET",
"POST"])
def create_exam():
if [Link]("role") not in ["admin", "teacher"]:
flash("Access denied", "error")
return redirect(url_for("index"))
INPUT CODE
if [Link] == "POST":
exam_name = [Link]["exam_name"]
exam_category = [Link]["exam_category"]
class_val = [Link]["class"]
sections = [Link]("sections[]")
exam_time = [Link]["exam_time"]
max_marks = [Link]["max_marks"]
status = [Link]["status"]
created_by = session["user_id"]
sections_str = ",".join(sections)
db = get_db()
cursor = [Link]()
INPUT CODE
[Link]("""
INSERT INTO exams
(exam_name, category, class, sections,
exam_time,
max_marks, status, created_by)
VALUES (%s,%s,%s,%s,%s,%s,%s,%s)
""", (
exam_name,
exam_category,
class_val,
sections_str,
exam_time,
max_marks,
status,
created_by
))
exam_id = [Link]
questions = [Link].to_dict(flat=False)
INPUT CODE
for key in questions:
if [Link]("questions[") and
[Link]("][text]"):
qid = [Link]("[")[1].split("]")[0]
q_text = [Link][f"questions[{qid}][text]"]
q_type = [Link][f"questions[{qid}][type]"]
[Link]("""
INSERT INTO exam_questions
(exam_id, question, question_type)
VALUES (%s,%s,%s)
""", (exam_id, q_text, q_type))
question_id = [Link]
if q_type == "mcq":
correct = [Link](f"questions[{qid}]
[correct]")
INPUT CODE
for i in range(1,5):
option = [Link](f"questions[{qid}]
[option{i}]")
if option:
[Link]("""
INSERT INTO exam_options
(question_id, option_text, is_correct)
VALUES (%s,%s,%s)
""", (
question_id,
option,
1 if str(i) == correct else 0
))
else:
answer = [Link](f"questions[{qid}]
[answer]")
[Link]("""
INPUT CODE
INSERT INTO exam_answers
(question_id, answer)
VALUES (%s,%s)
""", (question_id, answer))
[Link]()
[Link]()
[Link]()
flash(f"Exam {[Link]()} Successfully!",
"success")
return redirect(url_for("create_exam"))
return render_template("[Link]")
INPUT CODE
@[Link]("/student-courses")
def student_courses():
return render_template("[Link]")
@[Link]("/library")
def library():
return render_template("[Link]")
@[Link]("/analytics")
def analytics():
return render_template("[Link]")
@[Link]("/login", methods=["GET", "POST"])
def login():
if [Link] == "POST":
admission_number =
[Link]["admission_number"]
password = [Link]["password"]
db = get_db()
cursor = [Link](dictionary=True)
INPUT CODE
[Link](
"SELECT * FROM users WHERE
admission_number=%s",
(admission_number,)
)
user = [Link]()
[Link]()
[Link]()
if user and
check_password_hash(user["password"],
password):
session["user_id"] = user["id"]
session["role"] = user["role"]
session["admission_number"] =
user["admission_number"]
session["name"] = user["name"]
session["father_name"] = user["father_name"]
session["mother_name"] = user["mother_name"]
session["class"] = user["class"]
INPUT CODE
return redirect(url_for("index"))
flash("Invalid admission number or password",
"error")
return redirect(url_for("login"))
return render_template("[Link]")
@[Link]("/register-student", methods=
["POST"])
def register_student():
if [Link]("role") not in ["admin", "teacher"]:
flash("Access denied", "error")
return redirect(url_for("index"))
admission_number =
[Link]["admission_number"]
name = [Link]["name"]
father_name = [Link]["father_name"]
mother_name = [Link]["mother_name"]
INPUT CODE
class_val = [Link]["class"]
section = [Link]["section"]
password = [Link]["password"]
student_class = f"{class_val}-{section}"
db = get_db()
cursor = [Link]()
[Link]("""
INSERT INTO users
(admission_number, name, father_name,
mother_name, class, password, role)
VALUES (%s, %s, %s, %s, %s, %s, 'user')
""", (
admission_number,
name,
father_name,
mother_name,
student_class,
generate_password_hash(password)
))
INPUT CODE
[Link]()
[Link]()
[Link]()
flash("Student registered successfully", "success")
return redirect(url_for("students"))
@[Link]("/logout")
def logout():
[Link]()
return redirect(url_for("login"))
if __name__ == "__main__":
[Link](debug=True)
OUTPUT SCREENSHOTS
User / Parent Dashboard
OUTPUT SCREENSHOTS
Teacher / Admin Dashboard
OUTPUT SCREENSHOTS
Teacher / Admin Dashboard
CONCLUSION
This Online Examination System is a simple yet
effective digital platform designed to conduct exams
in a secure and organized manner. The database
design ensures proper storage of exam details,
questions, and answers while maintaining clear
relationships between users, exams, and evaluation
data. By implementing role-based access, only
authorized teachers or administrators can create and
manage exams, ensuring system security and
reliability.
The system reduces manual effort, saves time, and
improves accuracy in conducting examinations. It is
scalable, user-friendly, and suitable for academic
institutions. This project demonstrates the practical
application of database management, backend logic,
and web technologies, making it an ideal Computer
Science project for Class XII.