TABLE OF CONTENTS
1. Introduction
2. Hardware and software required
3. Modules used and their purposes
4. Source code
5. Output
6. Conclusion
7. bibliography
INTRODUCTION
1. Background
In today's digital age, most administrative and academic processes
in schools and colleges are gradually moving toward automation.
One such critical area is the management of examinations and
results. Traditionally, teachers and school staff maintain records of
students, manually enter marks, calculate totals and percentages,
and prepare report cards. This process is not only time-consuming
but also susceptible to human error, especially when dealing with a
large number of students.
To address these challenges, an Examination Management System
offers an efficient solution by automating the process of managing
student information, examination results, and performance
analysis. It not only reduces manual effort but also ensures
accuracy, consistency, and speed in handling academic records.
2. What is an Examination Management System?
The Examination Management System (EMS) is a computerized
application developed using Python for the front end and MySQL
for the backend database. This system is designed to help
educational institutions manage student records, subjects, and
marks. It also calculates total marks, percentage, and grade, and
generates final results in a neat, organized format.
The system allows the user (typically a teacher or admin) to:
Add and update student details
Store subject-wise marks
Generate individual student report cards
View and manage results
Print or export results (in text format or PDF)
The EMS can be implemented as a command-line application or
with a graphical interface (GUI) using Tkinter in Python, depending
on the complexity and user preference.
3. Purpose of the Project
The primary aim of this project is to create a simple yet effective
application that can assist in managing examination-related tasks.
The project demonstrates the practical application of various
concepts taught in Class 12 Informatics Practices, such as:
Database connectivity with Python
CRUD operations (Create, Read, Update, Delete)
User-defined functions
Data structures like lists and dictionaries
SQL queries
Basic file handling (if report cards are exported)
By developing this project, students gain hands-on experience in
software development and problem-solving. They also understand
the real-world importance of database applications and
automation in daily tasks.
4. Advantages of the System
Some key advantages of using this system include:
Time-saving: Automates repetitive tasks like calculating
totals and grades.
Accuracy: Reduces errors that commonly occur in manual
calculations.
Efficiency: Makes result generation and record maintenance
quick and easy.
User-friendly: Simple interface for easy data entry and result
viewing.
Data management: All records are stored in a structured
database and can be accessed or modified easily.
5. Scope of the Project
This project is designed for small to medium-sized educational
institutions, especially schools that need a basic yet functional
examination system. It can be further expanded in the future to
include features like:
Online student/teacher login
Automated email of results to parents
Graphical performance charts
Multi-user support
For this Class 12 project, the focus will remain on core features
such as:
Student registration
Subject and marks entry
Result computation
Report card display
6. Key Features
The project includes the following functionalities:
Add Student: Input student name, class, section, and roll number.
The data is stored in the MySQL database.
Add Subject: Enter subject name and maximum marks to
manage the subjects offered by the institution.
Enter Marks: For each student, subject-wise marks can be
entered and stored.
Generate Report Card: The system fetches all relevant
information from the database and generates a report card
that includes total marks, percentage, and grade.
Grade Assignment: Grades such as A+, A, B+, etc., are
assigned based on percentage.
The system is fully menu-driven and works via the command line,
ensuring it remains simple and focused for Class 12-level learning.
5. Real-Life Application & Future Scope
Though the current system is built for learning purposes, it has
real-world applications. It can be implemented in small schools,
coaching centers, or tuition classes to manage their examination
data. In the future, this system can be enhanced by:
Adding a graphical user interface (GUI) using Tkinter
Exporting report cards to PDF format
Integrating email notifications for sending results to parents
Providing user authentication for multiple users (e.g., admin,
teacher)
HARDWARE AND SOFTWARE REQUIRED
HARDWARES
1. Monitor
2. Keyboard and Mouse
3. Hard Disk
SOFTWARE
1. Python 3.x
2. MySQL Server 3.
4. MySQL Connector for Python
MODULES USED AND THEIR PURPOSES
mysql.connector : This module is used to establish a
connection between Python and the MySQL database. It allows
the program to execute SQL queries like INSERT, SELECT, UPDATE,
and DELETE directly from Python.
os (optional) : This module is used to interact with the
operating system, such as clearing the screen (os.system('cls') or
os.system('clear')) or working with file paths.
tkinter (optional) : Used to build the Graphical User Interface
(GUI) for the application. Tkinter provides windows, buttons,
labels, and other GUI components.
datetime (optional) : Used to work with date and time values,
for example, when displaying the date of result generation on a
report card.
csv (optional) : Used to export data to CSV files if you want to
allow downloading or saving results in Excel-readable format.
sys (optional): Can be used to exit the program or manage error
handling with sys.exit().
reportlab (optional): If you're generating PDF report cards, this
module helps create PDF documents through Python.
SOURCE CODE
SQL
-- CREATE DATABASE
CREATE DATABASE exam_system;
-- USE THE DATABASE
USE exam_system;
-- CREATE STUDENTS TABLE
CREATE TABLE students (
student_id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(50),
class VARCHAR(10),
section VARCHAR(1),
roll_no INT
);
-- CREATE SUBJECTS TABLE
CREATE TABLE subjects (
Subject_id INT PRIMARY KEY AUTO_INCREMENT,
subject_name VARCHAR(30),
max_marks INT
);
-- CREATE MARKS TABLE
CREATE TABLE marks (
record_id INT PRIMARY KEY AUTO_INCREMENT,
student_id INT,
subject_id INT,
marks_obtained INT,
FOREIGN KEY (student_id) REFERENCES students(student_id),
FOREIGN KEY (subject_id) REFERENCES subjects(subject_id)
);
PYTHON
import mysql.connector
import os
from datetime import datetime
# CONNECT TO MYSQL DATABASE
def connect_db():
return mysql.connector.connect(
host="localhost",
user="root",
password="yourpassword", # Replace with your MySQL password
database="exam_system"
)
# ADD A NEW STUDENT
def add_student():
os.system('cls' if os.name == 'nt' else 'clear')
con = connect_db()
cursor = con.cursor()
name = input("Enter Student Name: ")
student_class = input("Enter Class: ")
section = input("Enter Section: ")
roll_no = int(input("Enter Roll Number: "))
cursor.execute("INSERT INTO students (name, class, section, roll_no)
VALUES (%s, %s, %s, %s)",
(name, student_class, section, roll_no))
con.commit()
print("✅ Student added successfully.")
con.close()
# ADD A NEW SUBJECT
def add_subject():
os.system('cls' if os.name == 'nt' else 'clear')
con = connect_db()
cursor = con.cursor()
subject_name = input("Enter Subject Name: ")
max_marks = int(input("Enter Maximum Marks: "))
cursor.execute("INSERT INTO subjects (subject_name, max_marks)
VALUES (%s, %s)", (subject_name, max_marks))
con.commit()
print("✅ Subject added successfully.")
con.close()
# ENTER MARKS
def enter_marks():
os.system('cls' if os.name == 'nt' else 'clear')
con = connect_db()
cursor = con.cursor()
student_id = int(input("Enter Student ID: "))
cursor.execute("SELECT * FROM subjects")
subjects = cursor.fetchall()
for subject in subjects:
subject_id = subject[0]
subject_name = subject[1]
marks = int(input(f"Enter marks for {subject_name}: "))
cursor.execute("INSERT INTO marks (student_id, subject_id,
marks_obtained) VALUES (%s, %s, %s)",
(student_id, subject_id, marks))
con.commit()
print("✅ Marks entered successfully.")
con.close()
# GENERATE REPORT CARD
def generate_report_card():
os.system('cls' if os.name == 'nt' else 'clear')
con = connect_db()
cursor = con.cursor()
student_id = int(input("Enter Student ID: "))
cursor.execute("SELECT name, class, section, roll_no FROM students
WHERE student_id = %s", (student_id,))
student = cursor.fetchone()
if student:
print("\n📄 Report Card")
print(f"Name: {student[0]}")
print(f"Class: {student[1]}- Section: {student[2]}")
print(f"Roll No: {student[3]}")
print(f"Date: {datetime.now().strftime('%d-%m-%Y')}")
print("-" * 40)
cursor.execute("""
SELECT s.subject_name, s.max_marks, m.marks_obtained
FROM marks m
JOIN subjects s ON m.subject_id = s.subject_id
WHERE m.student_id = %s
""", (student_id,))
results = cursor.fetchall()
total_obtained = 0
total_max = 0
print(f"{'Subject':<15}{'Max Marks':<12}{'Marks Obtained'}")
for row in results:
print(f"{row[0]:<15}{row[1]:<12}{row[2]}")
total_max += row[1]
total_obtained += row[2]
percentage = (total_obtained / total_max) * 100
print("-" * 40)
print(f"Total Marks: {total_obtained} / {total_max}")
print(f"Percentage: {percentage:.2f}%")
grade = assign_grade(percentage)
print(f"Grade: {grade}")
else:
print("❌ Student not found.")
con.close()
# ASSIGN GRADE BASED ON PERCENTAGE
def assign_grade(percentage):
if percentage >= 90:
return "A+"
elif percentage >= 80:
return "A"
elif percentage >= 70:
return "B+"
elif percentage >= 60:
return "B"
elif percentage >= 50:
return "C"
else:
return "Fail"
# MAIN MENU
def main():
while True:
print("\n📚 Examination Management System")
print("1. Add Student")
print("2. Add Subject")
print("3. Enter Marks")
print("4. Generate Report Card")
print("5. Exit")
choice = input("Enter your choice: ")
if choice == "1":
add_student()
elif choice == "2":
add_subject()
elif choice == "3":
enter_marks()
elif choice == "4":
generate_report_card()
elif choice == "5":
print("Exiting... Thank you!")
break
else:
print("❌ Invalid choice. Try again.")
if __name__ == "__main__":
main()
OUTPUT
1. Add Student:
Enter Student Name: Ananya Sharma
Enter Class: 12
Enter Section: A
Enter Roll Number: 15
✅ Student added successfully.
2. Add Subject:
Enter Subject Name: Mathematics
Enter Maximum Marks: 100
✅ Subject added successfully.
3. Enter Marks:
Enter Student ID: 1
Enter marks for Mathematics: 92
Enter marks for English: 88
Enter marks for Physics: 85
✅ Marks entered successfully.
4. Generate Report Card:
📄 Report Card
Name: Ananya Sharma
Class: 12- Section: A
Roll No: 15
Date: 19-05-2025
Subject Max Marks Marks Obtained
Mathematics 100 92
English 100 88
Physics 100 85
Total Marks: 265 / 300
Percentage: 88.33%
Grade: A
5. Exit:
Exiting... Thank you!
CONCLUSION
The Examination Management System project has been developed
as a part of the Class 12 CBSE curriculum in Informatics Practices.
The project was designed to showcase the application of Python
programming in combination with MySQL database management
to solve real-world problems in the field of education.
Through this project, we created a system that simplifies and
automates various tasks associated with managing school
examinations. These tasks include student registration, subject and
mark entry, automatic calculation of total marks and percentage,
grade assignment, and report card generation.
By integrating a user-friendly, text-based menu system with
efficient backend database operations, the project demonstrates a
strong grasp of programming logic, database connectivity, and data
management—all of which are crucial for real-life software
development.
BIBLIOGRAPHY
1. NCERT Informatics Practices – Class 12 Textbook
2. Python Official Documentation – https://docs.python.org
3. MySQL Documentation – https://dev.mysql.com/doc/
4. YouTube Tutorials