Exammm 5 61
Exammm 5 61
TitlePage i
Declaration ii
Certificate iii
Acknowledgement iv
Contents v
ABSTRACT ix
Chapter 1 INTRODUCTION 1
1.2 Motivation 3
1.3 Objectives 4
v
2.7 Case Study on Automated Exam Scheduling and Seating Manage-
ment 9
Chapter 3 METHODOLOGY 12
vi
6.2 Generated Seating Plan 43
REFERENCES 50
vii
LIST OF DIAGRAMS
viii
ABSTRACT
ix
CHAPTER-1
INTRODUCTION
1
1.1 Challenges in Manual Examination Seating
The traditional approach to seating arrangements relies heavily on human effort,
leading to inefficiencies and difficulties in managing large student populations. Some
key challenges include the following.
2
1.1.5 Lack of Real Time Modifications
Last minute changes, such as cancellations, updates in subject codes, or modifica-
tions in room availability, require extensive manual reallocation. If invigilators or faculty
members request changes, adjustments must be made manually, leading to delays and
increased workload for administrative staff.
Due to these challenges, there is a growing need for an automated examination seat-
ing planner that can efficiently allocate seats while ensuring fairness, accuracy, and com-
pliance with institutional rules.
1.2 Motivation
Examination seating arrangements play a crucial role in ensuring fairness, discipline,
and efficiency in academic institutions. However, the manual seat allocation process is
highly inefficient, requiring faculty members to spend significant time sorting student
lists, ensuring proper distribution, and handling last-minute changes. For institutions
conducting large-scale examinations, this process becomes even more challenging, lead-
ing to errors, mismanagement, and increased administrative burden.
A key issue in manual seat allocation is the difficulty in enforcing constraints, such
as preventing students from the same department or subject from sitting next to each
other. Human errors, duplicate seat assignments, and bias in distribution further compli-
cate the process. Additionally, handling modifications due to student absences or room
availability changes is time-consuming and disrupts the workflow.
To address these challenges, this project introduces an Automated Exam Seating
Planner, which eliminates manual inefficiencies by automatically generating optimized
seating plans. The system ensures real-time modifications, structured seating layouts,
and efficient report generation, significantly reducing faculty workload. By providing a
scalable, flexible, and user-friendly solution, this project aims to enhance fairness, accu-
racy, and operational efficiency in examination management. This automation not only
improves institutional productivity but also ensures a smoother and more transparent
examination process.
3
1.3 Objectives
The primary objective of this project is to develop an automated exam seating sys-
tem that eliminates manual inefficiencies, ensures fair allocation, and simplifies seat
management for educational institutions.
4
1.4 Problem Statement
The manual examination seating process is a time consuming, error prone, and in-
efficient method that lacks scalability, fairness, and ease of real time updates. Institu-
tions struggle to ensure that students from the same department or subject do not sit
together, leading to exam integrity risks. Additionally, last minute modifications in seat-
ing arrangements require extensive faculty involvement, further increasing administra-
tive workload.
To solve this, we propose an Automated Exam Seating Planner that: Efficiently
assigns seats while maintaining predefined constraints. Minimizes human errors and
eliminates the need for manual intervention. Handles real time updates, making last
minute adjustments seamless. Provides structured outputs in PDF format, ensuring easy
access and distribution.
This system enhances examination management efficiency by automating seat allo-
cation, report generation, and real time modifications, making it an essential tool for
educational institutions conducting large scale assessments.
5
CHAPTER-2
LITERATURE REVIEW
6
2.2 AI-Based Exam Seating Arrangement Using Constraint
Satisfaction
Patel and Verma (2022) [2] proposed an AI-driven exam seating allocation system
based on Constraint Satisfaction Programming (CSP). Their system enforces hard con-
straints, such as ensuring students from the same department or subject do not sit to-
gether, while also optimizing soft constraints, such as reducing empty seats and maxi-
mizing room utilization.
One of the major advantages of their approach is the ability to dynamically adjust
seating plans when last-minute changes occur, such as student dropouts or room unavail-
ability. The system uses constraint propagation techniques, allowing it to identify and
resolve conflicts efficiently. A significant strength of this approach is its ability to handle
complex constraints and dynamic modifications to seating plans in real-time. The study
demonstrated high efficiency in preventing seat conflicts and optimizing available room
space.
However, the major limitation of CSP-based methods is their computational cost—as
the number of students increases, the system requires higher processing power to solve
constraints effectively. While the study provides valuable insights into the use of AI in
seating allocation, there is still a need for more scalable solutions that balance real-time
optimization with computational efficiency.
7
grate graph theory with AI-based adaptive methods.
8
2.6 Deep Learning-Based Exam Seating Arrangement Pre-
diction
Wang and Zhang (2022) [6] proposed a deep learning-based approach to optimize
exam seating arrangements. Their system utilized a combination of Convolutional Neu-
ral Networks (CNNs) and Long Short-Term Memory (LSTM) networks to predict op-
timal seating assignments. The model was trained using historical seating data, exam
formats, and spatial constraints to enhance the seat allocation process.
CNNs were used for seat classification based on predefined constraints, while LSTM
networks were employed to predict modifications required for future exams. The deep
learning model demonstrated significant improvements in seating accuracy, reducing
seat misallocations by 20 percent compared to rule-based assignment methods. The
study also highlighted the ability of deep learning models to detect potential seating
conflicts before they occur, ensuring a structured and optimized seating plan.
Despite its advantages, the deep learning-based approach faces some limitations.
The system requires a large amount of labeled training data, which may not always be
available for every institution. Additionally, training deep learning models is computa-
tionally expensive, making it less feasible for smaller institutions with limited hardware
resources. Furthermore, the model lacks adaptability for last-minute changes, requiring
additional modules for real-time seat reallocation. While this study demonstrates the po-
tential of deep learning in seating allocation, integrating it with rule-based or constraint
satisfaction techniques could improve its adaptability and efficiency.
9
improved the accuracy of seat assignments, minimizing instances of misallocation and
duplicate assignments. By automating the process, universities were able to generate
structured seating plans in minutes rather than hours, ensuring timely exam preparation.
One of the strengths of this case study is its real-world applicability. Unlike theoret-
ical models, this implementation was tested in an actual academic institution, proving
its effectiveness in reducing administrative overhead. However, some limitations were
noted. The system relied heavily on pre-existing student databases, meaning any incon-
sistencies in database records could impact seating accuracy. Moreover, the study did
not explore real-time seat adjustments, making it less flexible for handling last-minute
changes. Future enhancements, such as AI-based optimization and real-time realloca-
tion, could improve the system’s efficiency and adaptability.
10
2.9 Disadvantages of Existing Systems
• Despite advancements in automated exam seating allocation, existing systems still
face several challenges:
• Many AI-based models require significant processing power, making them less
suitable for real-time applications in large institutions.
• Graph-based and heuristic methods require predefined constraints and do not au-
tomatically adjust to changing student enrollments.
11
CHAPTER-3
METHODOLOGY
12
methodology used in developing the system, detailing each step from data input to final
seat assignment and report generation.
13
source and is uploaded through a web-based interface.
Once the Excel file is uploaded, the system extracts the relevant data from predefined
columns. The structure of the uploaded file must adhere to a specific format to ensure
smooth processing. The expected format consists of multiple columns, including roll
numbers, student names, departments, subject codes, and assigned rooms if applicable.
To prevent errors, the system first verifies the integrity of the file, ensuring that it is
a valid Excel format with extensions such as xlsx or xls and is not corrupted. If the
file does not meet these criteria, an error message is displayed, prompting the user to
re-upload a correctly formatted file.
After successful file validation, the preprocessing phase begins, which involves mul-
tiple steps to clean and standardize the data. The first step in preprocessing is checking
for missing values. If any essential information such as roll numbers, department names,
or subject codes is missing, the system flags these entries and either prompts the user to
correct them manually or automatically removes them based on predefined rules. This
ensures that incomplete records do not interfere with seat allocation. The next step is
duplicate detection, where the system scans the dataset to identify any students who
may have been accidentally included more than once. Duplicate roll numbers or student
entries are flagged, and administrators are notified to verify the data before proceeding
further.
14
tions. For example, if some records contain "CSE" while others have "Computer Science
Engineering," the system ensures uniformity by mapping all variations to a common for-
mat. Similarly, subject names are checked against a predefined list to ensure that they
are accurately entered.
Another crucial step in data preprocessing is sorting the dataset. Students are grouped
based on their departments and subject codes to facilitate an efficient seating arrange-
ment process. The sorting algorithm ensures that students from the same department
are processed together, making it easier to enforce constraints such as preventing stu-
dents from the same department or subject from sitting adjacent to each other. Sorting
also optimizes the allocation algorithm by ensuring that students are assigned seats in a
structured and systematic manner.
Additionally, the system performs room capacity validation, ensuring that the num-
ber of students does not exceed the total seating capacity available. The room allocation
data is cross-checked against the number of students to confirm that there are sufficient
seats available for the examination. If the total number of students exceeds the available
capacity, the system alerts the administrator, suggesting adjustments such as reassigning
students to different rooms or increasing the number of examination halls.
After completing these preprocessing steps, the final cleaned and structured dataset
is stored in memory for further processing in the seat allocation phase. At this stage, the
dataset is completely formatted, error-free, and optimized for efficient seat distribution.
The preprocessing module plays a critical role in ensuring that only valid and well-
structured data is fed into the allocation algorithm, preventing complications during the
later stages of the seating arrangement process.
With the data preprocessing complete, the system proceeds to the next stage, where
students are systematically assigned to seats based on predefined constraints, ensuring
fairness and optimal room utilization.
15
assigns them to rooms in a structured manner to maintain examination integrity and
fairness.
The system follows a structured approach where the allocation process begins with
identifying the total number of students, the departments they belong to, and the number
of subjects in the examination. The list of available rooms and their respective capacities
is then loaded into the system. Each room consists of a predefined number of benches,
and each bench can accommodate two students. The allocation algorithm processes
students in batches while ensuring that no two students from the same department or
subject are placed adjacent to each other. The system systematically distributes students
across multiple rooms while following a well-defined set of constraints.
One of the core constraints enforced during seat allocation is department-wise sep-
aration. The system ensures that two students from the same department are not seated
together on the same bench or in adjacent positions. This constraint is enforced through
a structured mapping process, where students from different departments are alternately
placed to avoid direct proximity. If a room reaches near capacity and the only remaining
students belong to the same department, the system attempts to place them in a different
room to maintain fairness. If no alternative room is available, the allocation algorithm
makes adjustments by ensuring that students from the same department are separated as
much as possible within the same room.
Another important constraint is subject-wise separation, ensuring that students tak-
ing the same subject are not seated next to one another. This is particularly important in
multi-departmental subjects where students from different departments may be taking
the same examination. The system scans through the list of students and ensures that
individuals with identical subject codes are seated at a reasonable distance from each
other. This constraint is enforced dynamically during seat allocation, and if any viola-
tion is detected, the system reshuffles the seating arrangement to maintain compliance.
The seat allocation process also includes special handling for departments with a
small number of students. If a department has fewer than twelve students, placing them
in a separate room may lead to underutilization of space. To optimize room usage while
ensuring compliance with seating constraints, the system groups students from multiple
departments with low student counts into shared rooms. The allocation strategy ensures
that even in such shared rooms, students from the same department do not sit next to
16
each other, thereby maintaining examination fairness. This approach allows the system
to maximize seating capacity without compromising constraint enforcement.
To efficiently allocate seats while maintaining constraints, the system follows a
greedy algorithmic approach. The algorithm processes students sequentially and as-
signs them to the next available seat that satisfies all constraints. The steps involved in
the allocation algorithm are as follows. First, the student list is sorted based on depart-
ment and subject codes to facilitate structured placement. The first student is assigned to
the first available bench in the first room. The next student is checked to ensure that they
do not belong to the same department or subject as the first student. If this condition is
satisfied, they are seated next to the first student; otherwise, the algorithm searches for
the next best seat that meets all constraints. This process continues iteratively, with the
system dynamically adjusting seating assignments if conflicts arise.
In cases where the seating plan reaches a point where constraints cannot be strictly
enforced due to limited room availability, the system follows an adjustment mechanism.
If a student must be placed next to another from the same department due to room con-
straints, the system ensures that this only occurs as a last resort and that such placements
are minimized across the seating plan. Additionally, an alternative placement strategy
is applied in cases where some rooms have excess capacity while others are near full.
The system redistributes students across available rooms to maintain an even seating
distribution.
Another layer of complexity in seat allocation arises when last-minute modifica-
tions occur. If students are added or removed after the initial seat allocation, the system
updates the seating plan dynamically while ensuring minimal disruption to existing allo-
cations. The algorithm recalculates placements only for the affected students rather than
modifying the entire plan. This ensures that real-time changes can be accommodated
without significantly affecting the overall seat arrangement.
After seat allocation is completed, the system validates the generated seating plan
to ensure that all constraints have been successfully enforced. If any violations are
detected, the system runs an optimization process that adjusts seat placements to resolve
conflicts. The final allocation is then stored for further processing in the seating plan
generation phase, where the assigned seats are formatted into a structured tabular layout
for display and reporting purposes.
17
Seat allocation plays a fundamental role in ensuring that the examination process
remains fair, organized, and optimized for efficient space utilization. By following a
structured algorithm that dynamically assigns students while preventing constraint vio-
lations, the system provides an effective solution for managing large-scale examination
seating arrangements. With seat allocation completed, the system proceeds to the next
step, where the seating plan is converted into a structured table format for clear visual-
ization and documentation.
18
To enhance readability, the seating plan is formatted with appropriate spacing, head-
ers, and labels. Each room is assigned a unique identifier, and within each room, students
are placed in a structured sequence that follows the allocation order. The seat numbering
is sequentially assigned to maintain consistency in student placement. The room details,
including the total number of benches, available capacity, and assigned students, are dis-
played as part of the seating plan. This structured approach ensures that administrators
can quickly verify the seat assignments and identify any necessary modifications before
finalizing the seating arrangement.
A key feature of the seating plan generation step is the ability to accommodate
last-minute changes. If a student is added or removed after the initial allocation, the
system dynamically updates the seating arrangement to reflect the modifications. The
updated seating plan is recalculated while ensuring that previously assigned students
remain in their designated positions, minimizing disruptions. The system intelligently
adjusts placements by shifting students where necessary, ensuring that the constraints
related to department-wise and subject-wise separation continue to be enforced even
after modifications.
To facilitate seamless usage, the seating plan is designed to be exportable in multiple
formats, making it accessible for both digital and printed distribution. The seating plan
can be viewed on the user interface, where faculty members can preview the arrange-
ments before finalizing the layout. Additionally, the generated seating plan is stored for
further processing in subsequent steps, where it is formatted into printable documents
such as PDFs for official use.
The structured seating plan provides an essential foundation for the examination
process, ensuring that student placements are well-documented, easy to interpret, and
compliant with institutional regulations. With the seating plan generation complete, the
system proceeds to the next phase, where nominal rolls are created to assist invigilators
in verifying student attendance during the examination.
19
tematically record attendance while ensuring that each student occupies the correct seat.
The nominal roll creation process is automated to minimize human errors and to provide
an organized record that simplifies administrative tasks during exams.
Each nominal roll is generated separately for every examination room, ensuring that
student details are accurately recorded. The nominal roll includes essential information
such as student roll numbers, names, and designated seat numbers based on the finalized
seating plan. Additionally, the document contains spaces for entering booklet numbers
and capturing student signatures, which helps in confirming attendance and tracking
answer booklets. This structured approach ensures that all students are accounted for
and that there are no discrepancies in seat assignments.
The system processes student data from the seating plan and formats it into a struc-
tured tabular layout for clarity and readability. The format of the nominal roll is designed
to be print-friendly so that faculty members and examination administrators can easily
distribute and use it during the exam. Each nominal roll includes a header displaying the
institution name, the room number, the date and session of the examination, and the type
of exam being conducted. Below the header, the main table lists each student’s details in
a sequential manner, ensuring that the order of seating corresponds to the room layout.
To ensure accuracy, the system performs a final validation check before generating
the nominal rolls. This validation ensures that all students appearing in the nominal roll
are correctly assigned to their respective rooms and that there are no missing entries. If
any inconsistencies are detected, the system alerts the administrator, allowing necessary
corrections before finalizing the document. This prevents issues such as missing student
records, misallocated seats, or duplicate entries, which could cause confusion during the
examination.
In addition to individual room-wise nominal rolls, the system provides an option to
generate department-wise summaries that list all students appearing for an exam within
a particular department. This feature is useful for academic administrators who need
an overview of student allocations without referring to individual room sheets. The
nominal roll generation process also accounts for last-minute modifications, such as
student additions or removals, ensuring that any changes are automatically reflected in
the final documents.
The nominal rolls are generated in digital format and stored as PDF files, allow-
20
ing them to be easily printed and distributed before the examination. The system also
includes a batch processing feature that allows administrators to download all nominal
rolls at once in a compressed ZIP file, facilitating quick access to all required documents.
This bulk download capability is particularly useful for large-scale examinations where
multiple rooms need to be managed efficiently.
By automating the creation of nominal rolls, the system significantly reduces the ad-
ministrative burden on faculty members and examination coordinators. Instead of man-
ually preparing attendance sheets and verifying seat assignments, invigilators receive a
structured document that is ready for use. This automation improves the efficiency of
the examination process while ensuring accuracy in student placement and attendance
tracking.
With the nominal roll generation complete, the system moves to the final phase,
where all seating plans and related documents are prepared for final distribution and
downloading.
21
serves as a master document that includes all seat assignments across all departments
and rooms, allowing examination coordinators to oversee the entire arrangement from a
single file.
In addition to seating plans, the system also generates nominal rolls in PDF for-
mat for each examination room. The nominal rolls list student details, including roll
numbers, names, seat numbers, and spaces for booklet numbers and signatures. These
documents are essential for attendance tracking and answer booklet distribution during
the examination. By providing these documents in a standardized format, the system en-
sures that invigilators can efficiently manage the examination process without confusion
or errors.
To enhance accessibility and organization, the system includes a feature for com-
pressing all nominal rolls into a single ZIP file. This allows administrators to download
all required documents in one step instead of retrieving them individually. The ZIP file
contains separate PDF files for each examination room, ensuring that invigilators can
access and print the required documents for their respective rooms without searching
through multiple files. The compression process does not alter the document structure
or quality, ensuring that all details remain intact when extracted.
Once the PDF generation and ZIP compression processes are complete, the system
provides an interface for downloading all examination documents. Users can download
individual department-wise, room-wise, and consolidated seating plans as separate PDF
files or retrieve the complete ZIP archive containing all nominal rolls. This approach
allows faculty members and examination coordinators to efficiently distribute seating
plans and attendance records among invigilators and students. The system also ensures
that any modifications made before finalizing the seating plan are reflected in the gener-
ated PDFs, maintaining accuracy and consistency in the provided documents.
The automation of PDF and ZIP file generation significantly enhances the overall
efficiency of the examination seating planner. By providing digital access to well-
structured seating plans and nominal rolls, the system eliminates the need for manual
paperwork and ensures that all essential documents are readily available before the ex-
amination begins. The structured document generation process not only reduces ad-
ministrative burden but also minimizes the risk of miscommunication regarding seat
assignments.
22
With the completion of this step, the examination seating arrangement process is
fully automated, ensuring that all necessary seating plans and attendance records are
properly documented and available for distribution. The generated documents serve as
the final output of the system, enabling smooth execution of the examination process
while maintaining clarity and compliance with institutional seating policies.
23
essential for structuring student allocations based on department and subject constraints.
Pandas also plays a crucial role in generating department-wise and room-wise seating
plans, ensuring that the data is accurately structured before converting it into reports.
24
seating planner. Flask enables the interactive web-based interface, Pandas processes
and structures the student data, OpenPyXL handles Excel file operations, and Report-
Lab generates formatted PDF reports. Together, these components ensure a seamless
workflow, from data input to seat allocation and final report generation.
• RAM: 4 GB
25
OpenPyXL is employed for handling Excel file operations, allowing the system to
extract and update spreadsheet data. It ensures seamless integration between the system
and the input student records stored in Excel format.
ReportLab is used for generating structured PDF documents, including seating plans
and nominal rolls. It provides tools for formatting tables, adding styles, and ensuring
print-ready reports.
Zipfile is utilized to compress all nominal rolls into a single ZIP file, allowing users
to download them in an organized manner. This feature improves accessibility and en-
sures structured storage of seating documents.
OS provides functions for interacting with the operating system, managing file paths,
and automating file handling tasks such as reading and saving reports.
UUID is used to generate unique identifiers for temporary files and session-based
storage, preventing conflicts and ensuring secure handling of user-generated files.
Tempfile is essential for creating temporary files that store intermediate data before
final processing. It ensures efficient memory usage by managing temporary storage
dynamically.
Together, these packages automate the entire examination seating process, from stu-
dent data collection to final report generation, ensuring efficiency, accuracy, and scala-
bility. System analysis content.
26
CHAPTER-4
UML DIAGRAMS
The Student interacts with the system by viewing seating assignments in different
formats, including room-wise, department-wise, and all-room plans, as well as checking
noticeboard displays. The System processes student records, applies seating constraints,
and generates structured reports for download. The diagram clearly represents the au-
tomated workflow, ensuring an efficient, accurate, and fair seat allocation process while
reducing manual effort.
27
4.2 Sequence Diagram
The sequence diagram represents Fig 4.2 the step-by-step flow of interactions be-
tween different users and the Exam Seating Planner System. The primary actors in the
system are the Developer, Admin, and Student, while the system itself and session man-
agement are also depicted. The Developer is responsible for developing and deploying
the system. The Admin initiates the process by uploading student data, which is stored in
the system, followed by configuring exam details, which are then saved in the database.
The admin then generates the seating plan, which involves fetching student and room
data, applying seating constraints, and saving the final seat assignments. Once the seat-
ing plan is generated, the admin can download it, generate nominal rolls, and fetch and
save them in the system. The admin can also download room-wise, department-wise,
and all-room department plans for distribution. Students can access and view their seat-
ing plans either through the noticeboard display or by directly retrieving them from the
system. The sequence diagram provides a clear representation of how data flows through
different stages, ensuring a structured and automated seat allocation process.
28
4.3 Activity Diagram
The activity diagram as in Fig 4.3 represents the workflow of the Exam Seating
Planner System, illustrating the sequence of actions from system development to student
seat viewing. The process begins with the developer building and deploying the system
online. The administrator then uploads student data, configures examination details, and
validates the input. If the data is valid, the system proceeds to generate the seating plan,
apply seating constraints, and store the plan in the database.
The administrator can then download the seating plan, generate nominal rolls, store
them in the database, and download various seating plans, including room-wise, department-
wise, and all-room department plans. If the input data is invalid, an error message is dis-
played, prompting the administrator to correct the data. The final step involves students
accessing their assigned seating arrangements through a noticeboard display. This struc-
tured flow ensures an organized and automated seat allocation process while maintaining
accuracy and efficiency.
29
4.4 Component Diagram
The component diagram as in Fig 4.4 illustrates the architecture of the Exam Seat-
ing Planner System, highlighting the interactions between different components. The
system consists of three main components: Admin Device, Student Device, and Cloud
Server. Both the admin and student access the system through a web browser, sending
HTTP requests to the cloud server, which hosts the Flask-based web application.
The Flask application processes these requests, performs seat allocation, and in-
teracts with the session database to store and retrieve student and seating data. The
database ensures data persistence, allowing the system to maintain examination details
efficiently. The diagram provides a clear representation of how the system components
interact, ensuring seamless data flow and accessibility for users.
30
4.5 Class Diagram
The class diagram Fig 4.5 represents the structure of the Exam Seating Planner Sys-
tem by defining its key classes and their relationships. The system consists of multiple
classes, each responsible for a specific function. The Student class stores student details
such as roll number, name, department, and subject code.
The Room class contains information about the room name and total benches avail-
able, with a method to assign students. The SeatingPlan class manages a list of students
and rooms, implementing methods to generate a seating plan and apply constraints.
The ReportGenerator class is responsible for creating different seating plans, includ-
ing room-wise, department-wise, and all-room plans. The NominalRoll class generates
nominal rolls for invigilators, containing student details. The Database class handles
data storage operations, including saving student data, seating plans, and nominal rolls.
The System class oversees deployment and noticeboard display functionality. The dia-
gram illustrates how these classes interact, ensuring a structured and organized approach
to seat allocation and examination management.
31
CHAPTER-5
IMPLEMENTED CODES
This chapter presents the key implementation details of the Automated Exam Seat-
ing Planner. The system is developed using Flask for backend processing, HTML for
frontend templates, and integrated with database operations for handling student records
and seat allocations. The following sections provide the core Python backend logic and
associated HTML templates used for rendering input forms and displaying results.
32
from reportlab.lib import colors
from reportlab.lib.pagesizes import A4, landscape
from reportlab.pdfbase.ttfonts import TTFont
from reportlab.pdfbase import pdfmetrics
from reportlab.lib.units import inch
from reportlab.platypus import SimpleDocTemplate, Table, TableStyle,
Paragraph, Spacer, PageBreak, Image
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
from reportlab.pdfgen import canvas
app = Flask(__name__)
app.config["SESSION_PERMANENT"] = False
app.config["SESSION_TYPE"] = "filesystem"
Session(app)
app.secret_key = "supersecretkey12345"
LATEST_ATTENDANCE_DIR = None
count = 0
college_code = "H7"
HEADER_IMAGE_PATH =
"E:/paid_projects/exam_seating_system/static/Images/header.jpg"
OUTPUT_DIR = os.path.join(os.getcwd(), ’static’, ’output_files’)
os.makedirs(OUTPUT_DIR, exist_ok=True)
app.jinja_env.globals.update(zip=zip)
TEMP_DIR = os.path.join(os.getcwd(), ’temp’)
os.makedirs(TEMP_DIR, exist_ok=True)
@app.before_request
def make_session_non_permanent():
session.permanent = False
@app.route("/", methods=["GET", "POST"])
def index():
if request.method == "POST":
try:
num_departments = int(request.form["num_departments"])
33
department_names = request.form.getlist("department_names[]")
subject_codes = request.form.getlist("subject_codes[]")
subject_names = request.form.getlist("subject_names[]")
uploaded_file = request.files["roll_numbers_file"]
date = request.form["date"]
date = datetime.strptime(date, " exam_session =
request.form["exam_session"]
exam_type = request.form["exam_type"]
room_names = request.form["room_names"].split(’,’)
room_names = [room.strip() for room in room_names]
if uploaded_file.filename == "":
return "Error: No file uploaded."
try:
df = pd.read_excel(uploaded_file)
print("File uploaded and read successfully.")
except Exception as e:
return f"Error: Unable to read the uploaded file. str(e)"
if len(department_names) != num_departments or
len(subject_codes) != num_departments:
return "Error: Number of departments or subject codes doesn’t
match the provided details."
if not
set(department_names).issubset(set(df["Department"].unique())):
return "Error: Department names do not match with the uploaded
file."
department_subject_map = dict(zip(department_names,
subject_codes))
sub_code_name_map = dict(zip(subject_codes, subject_names))
df = df[df["Department"].isin(department_names)]
session_id = str(uuid.uuid4())
temp_file_path = os.path.join(TEMP_DIR, f"session_id.csv")
df.to_csv(temp_file_path, index=False)
34
session["session_id"] = session_id
session["num_departments"] = num_departments
session["department_subject_map"] = department_subject_map
session["sub_code_name_map"] = sub_code_name_map
session["date"] = date
session["exam_session"] = exam_session
session["exam_type"] = exam_type
session["room_names"] = room_names
print("Input validation successful and data stored.")
return render_template("index.html", buttons_visible=True)
except Exception as e:
print(f"Error during form submission: str(e)")
return "An error occurred while processing your request. Please try
again."
return render_template("index.html", buttons_visible=False)
Main Logic:
def seating_logic():
session_id = session.get("session_id")
department_subject_map = session.get("department_subject_map")
sub_code_name_map = session.get("sub_code_name_map")
room_names = session.get("room_names")
if not (session_id and department_subject_map):
return "Error: Missing data. Please submit the form first."
temp_file_path = os.path.join(TEMP_DIR, f"session_id.csv")
if not os.path.exists(temp_file_path):
return "Error: Data file not found. Please submit the form again."
df = pd.read_csv(temp_file_path)
df.sort_values(by=["Department","Roll Number","Student Name"],
inplace=True)
roll_name_dict = dict(zip(df["Roll Number"], df["Student Name"]))
g.large_data = roll_name_dict
department_counts = df["Department"].value_counts().to_dict()
35
total_students = df.shape[0]
print("Initial Student Count Per Department:")
for dept, count in department_counts.items():
print(f"dept: count students")
rooms = []
special_rooms=[]
room_number = 1
session["room_number"]=room_number
remaining_students = df.copy()
remaining_departments = df["Department"].unique().tolist()
available_departments = remaining_departments.copy()
remaining_students_dict =
dept: "students": [], "subject_code":
department_subject_map.get(dept)
for dept in remaining_departments:
36
Number"]]
dept_a_students = dept_a_students[dept_a_students["Roll
Number"] != student["Roll Number"]]
if dept_a_students.empty:
available_departments.remove(dept_a)
else:
remaining_students_dict[dept_a]["students"].extend(
[(student[’Department’], student[’Roll Number’])
for _, student in dept_a_students.iterrows()]
)
remaining_students =
remaining_students[remaining_students["Department"] != dept_a]
available_departments.remove(dept_a)
continue
if available_departments:
for dept_b in available_departments:
if department_subject_map[dept_b] != subject_code_a:
dept_b_students =
remaining_students[remaining_students["Department"] == dept_b]
if len(dept_b_students) >= 12:
while len(side_b) < 24 and not dept_b_students.empty:
student = dept_b_students.iloc[0]
side_b.append((student[’Department’], student[’Roll Number’]))
remaining_students =
remaining_students[remaining_students["Roll Number"] != student["Roll
Number"]]
dept_b_students =
dept_b_students[dept_b_students["Roll Number"] != student["Roll
Number"]]
if dept_b_students.empty:
available_departments.remove(dept_b)
break
37
5.2 Frontend - index.html
The ‘index.html‘ file is responsible for rendering the main page, allowing adminis-
trators to upload student data for processing.
<body>
<div class="container fade-in">
<h1><i class="fas fa-user-graduate"></i> Seating and Attendance Generator</h1>
<form method="POST" action="/" enctype="multipart/form-data">
<label for="num_departments">Number of Departments:</label>
<input type="number" name="num_departments" id="num_departments"
placeholder="Enter number of departments" required>
<div id="departments"></div>
<button type="button" onclick="generateDepartmentInputs()">Generate Department
Inputs</button>
<label for="roll_numbers_file">Upload Roll Numbers File:</label>
<input type="file" name="roll_numbers_file" id="roll_numbers_file" required>
<label for="exam_type">Type of Examination:</label>
<input type="text" name="exam_type" id="exam_type" required>
<label for="date">Date of examination:</label>
<input type="date" name="date" id="date" required>
<label for="room_names">Room Numbers (separated by commas):</label>
<input type="text" name="room_names" id="room_names" minlength="150"
maxlength="180" required>
<label for="exam_session">Session:</label> <label>
<input type="radio" name="exam_session" value="Forenoon"> Forenoon
</label><br>
<label> <input type="radio" name="exam_session" value="Afternoon"> Afternoon
</label><br>
<button type="submit"><i class="fas fa-paper-plane"></i> Submit</button>
</form>
<div class="success-message">
Data submitted successfully! You can now generate the seating plan and attendance
sheets.
38
5.3 Frontend - result.html
The ‘result.html‘ file displays the generated seating plan and provides a download
option for the seating plan in PDF format.
<body>
<div class="container">
<h1><i class="fas fa-chair"></i> Seating Plan Result</h1>
<button id="transformBtn" onclick="transformTables()"
>Transform Tables (6 Rows × 8 Columns per Room)</button>
<div id="seating-container">
<div class="room" id="room- room.room_number ">
<h2>Room room.room_number </h2>
<table class="seatingTable">
<thead>
<tr>
<th>Side A</th>
<th>Side B</th>
</tr>
</thead>
<tbody>
<tr>
<td> room.side_a[i][1] 0</td>
<td> room.side_b[i][1] </td>
</tr>
</tbody>
</table>
</div>
<!– Generate Attendance Sheets Button –>
<form action=" url_for(’generate_attendance_sheets’) "
method="GET"> <button id="generateBtn"><i class="fas fa-file-alt"></i>
Generate Attendance Sheets</button>
</form>
</div>
39
<div id="examDetails"
exam-type=" exam_type "
exam-date=" date "
college_code=" college_code ">
</div>
</div>
• The index.html page serves as the main interface for user input, allowing the
administrator to:
– Upload a student data file containing roll numbers, names, and departments.
– Implements the seating logic to ensure no two students from the same de-
partment or subject sit together.
40
The integration of Flask for backend processing and HTML for frontend interaction
ensures a seamless experience for exam administrators. The system effectively stream-
lines seat allocation, enforces constraints, and generates structured, downloadable seat-
ing arrangements, reducing manual effort and minimizing errors in examination seat
planning.
41
CHAPTER-6
RESULTS AND ANALYSIS
The results of the automatic exam seating planner system demonstrate its ability to
efficiently generate seating arrangements while ensuring that constraints are properly ap-
plied. The system takes student and exam-related input data, processes it, and generates
structured seating plans and nominal rolls in different formats. This section presents the
various outputs generated by the system, including input submission, seating allocation,
structured tables, and downloadable reports.
Figure 6.1: Input Page for Uploading Student and Examination Data
Before processing, the system performs input validation to check for inconsistencies
such as missing student details, duplicate roll numbers, and incorrect subject codes. If
errors are detected, the system prompts the user to rectify them before proceeding. This
ensures that only clean and structured data is used for seat allocation.
42
Furthermore, the input page allows administrators to configure additional examina-
tion constraints, such as session details, department-wise seating preferences, and room
allocations. Once all input fields are verified, the system stores this data for further
processing.
43
6.3 Seating Plan in 6×8 Table Format
To provide a structured representation, the generated seating plan is transformed into
a six by eight table format, as shown in Fig. 6.3.
Figure 6.3: Seating Plan in 6×8 Table Format for Structured Representation
• The tabular format allows for quick cross-checking and verification, reducing con-
fusion on the day of the exam.
• The six by eight format optimizes room space utilization, ensuring a systematic
seating distribution.
44
6.4 Nominal Rolls
The system generates nominal rolls containing student details, as illustrated in Fig.
6.4. These rolls include:
45
Nominal rolls significantly aid in streamlining attendance tracking during exami-
nations, ensuring better accountability. They also act as official records for audit and
verification purposes.
46
Additionally, the room-wise plan provides clarity when addressing last-minute room
modifications or reallocations due to space constraints or unexpected scheduling changes.
47
By integrating both room and department details, this seating plan allows for efficient
invigilation and provides a structured approach to managing student allocations.
The system effectively automates the exam seating arrangement process, signifi-
cantly reducing manual effort and ensuring compliance with all constraints. The seating
allocation process is efficient, ensuring that no two students from the same department
or subject are seated together. The structured seating plan in a six by eight table format
improves readability, while the generation of nominal rolls provides essential documen-
tation for invigilators. The ability to generate department-wise, room-wise, and room-
department plans enhances transparency in the seating arrangement. The automated
report generation and downloadable PDF outputs further streamline the administrative
workflow, making this system an effective solution for managing large-scale examina-
tion seating arrangements.
48
CHAPTER-7
CONCLUSION AND FUTUREWORK
49
tem could be extended to support automated email notifications, informing students of
their seat allocations before the examination. This feature would eliminate the need for
manual communication and provide students with direct access to their assigned seats.
Another potential enhancement involves the development of a real-time dashboard
for administrators, allowing them to visualize seating arrangements, monitor seat oc-
cupancy, and make last-minute modifications before finalizing the seating plan. This
feature would provide greater flexibility in seat allocation, particularly when accom-
modating last-minute student changes or room reassignments. Future iterations of the
project could also incorporate cloud integration, allowing institutions to store and man-
age seating data on platforms like Google Drive or Firebase for seamless remote access
and collaboration.
Furthermore, additional optimization techniques, such as machine learning-based
seat allocation models, can be explored to further enhance efficiency. By analyzing
historical seating data and student distribution patterns, AI-based models could dynam-
ically predict optimal seating assignments while balancing constraints more effectively.
The inclusion of multi-language support in the system’s user interface can make it ac-
cessible to a wider range of institutions, allowing educational organizations in different
regions to implement automated seating arrangements with ease.
In conclusion, this project provides a robust and scalable solution for examination
seat allocation, addressing key challenges faced in manual methods. By integrating real-
time validation, structured seat planning, and automated report generation, the system
significantly enhances examination management efficiency. With future enhancements
such as role-based authentication, automated email notifications, AI-driven seat allo-
cation, and cloud-based collaboration, the system can be further improved to meet the
evolving needs of educational institutions.
50
REFERENCES
[1] Sharma, A., & Gupta, R. (2021). Automated Examination Seating System Us-
ing Heuristic Algorithms. International Journal of Educational Technology, 15(3),
145-159.
[2] Patel, S., & Verma, K. (2022). AI-Based Exam Seating Arrangement Using Con-
straint Satisfaction. Journal of Artificial Intelligence and Applications, 9(1), 37-49.
[3] Lee, J., Kim, H., & Park, D. (2020). Graph Theory Approach for Exam Seat Plan-
ning. IEEE Transactions on Computational Intelligence, 12(4), 456-470.
[4] Khan, R., Ali, Z., & Rahman, M. (2021). Genetic Algorithm for Optimized Seating
Allocation in Examination Halls. Advances in Computational Science, 8(2), 110-
125.
[5] Reddy, N., Babu, R., & Srinivas, H. (2023). Reinforcement Learning for Exam
Seat Distribution. Neural Networks and Smart Systems, 14(2), 189-205.
[6] Wang, Y., & Zhang, X. (2022). Deep Learning-Based Exam Seating Arrangement
Prediction. Journal of Intelligent Systems, 17(1), 55-72.
[7] Kumar, A., & Nair, P. (2021). Case Study on Automated Exam Scheduling and
Seating Management. International Journal of Educational Administration, 10(3),
78-95.
[8] Bose, M., Singh, A., & Raghavan, K. (2023). Cloud-Based Seat Allocation Sys-
tem for Large-Scale Examinations. Journal of Cloud Computing and Data Man-
agement, 11(4), 312-329.
[9] Latif, J., Tu, S., Xiao, C., Ur Rehman, S., Imran, A., & Latif, Y. (2022). ODGNet:
a deep learning model for automated optic disc localization and glaucoma classifi-
cation using fundus images. SN Applied Sciences, 4(4), 98.
[10] Johnson, M., & Lee, T. (2020). Automating Academic Seat Allocation Using AI-
Powered Algorithms. Journal of Educational Data Science, 7(2), 200-220.
51
[11] Anjum, S., Chodey, M. D., & Afzal, M. C. (2021). Automation of Exam Hall Al-
lotment and Seating Arrangement. International Journal of Engineering Research
& Technology, 10(6).
[12] Sadiq, A., Abdulrahman, A., Dada, O., & Olajide, A. (2021). Automated Students
Examination Seat Allocation using Linear Congruential Generator Algorithm. In-
ternational Journal of Computer Trends and Technology, 69(1), 23-26.
[13] Papaioannou, E., Vardakis, A., & Kaklamanis, C. (2018). oPESA: Online Platform
for Automatic Exam-Hall Seat Allocation. International Journal of Engineering
Technologies and Management Research, 5(6), 51-65.
[14] Acharyya, A., Losalka, A., Gupta, P. S., & Panda, G. (2012). Development of an
Automated Examination Seating Arrangement Generation System Using Music In-
spired Harmony Search Algorithm. In Proceedings of the International Conference
on Soft Computing for Problem Solving (2011) (pp. 301-309).
[15] Fatima Alam, A. (2016). Automatic Seating Arrangement Tool for Examinations
in Universities/Colleges. International Journal of Engineering Applied Sciences
and Technology, 1(4), 8-10.
52