You are on page 1of 25

COMPUTER SCIENCE

PROJECT ON
TEACHER’S ASSISTANT

Academic Year: 2023-24

Project submitted in partial fulfilment of Practical Examination for Class XII,


All India Senior Secondary Certificate Examination

SUBMITTED TO : SUBMITTED BY :
Mr.Sathasivan H Name : Pranav.N
Reg No. : 2923
Class : 12-AN1

SUGUNA PIP SCHOOL, COIMBATORE.


(CBSE, Affiliation No. 1930213)
CONTENTS
S.No. TOPIC Pg.No.

1. Certificate

2. Acknowledgement

3. Introduction

4. Objectives

5. Scope

6. Hardware and Software requirements

7. Description

8. Future Scope

9. Drawbacks

10. Coding

11. Outputs

12. Conclusion

13. Bibliography

Teacher’s Signature
CERTIFICATE

This is to certify that Mr. Pranav N, Roll No. 20219324 of class XII (Session 2022-23),
Suguna Pip School has completed the project based on the topic “Teacher’s Assistant” as a part
of the paper of Computer Science (083).

It is a bona-fide piece of work done under my supervision and guidance to the best of my
knowledge. It is the original work of the candidate and is a result of her/his effort in partial
fulfillment of requirement as per AISSCE curriculum of class XII.

TEACHER In-charge PRINCIPAL

EXTERNAL

Date of the Examination


ACKNOWLEDGEMENT

I would like to thank Mr. POOVANNAN, Principal, Coimbatore for his immeasurable
direction towards course of action and support throughout the project.

I would also like to thank my Faculty Guide, Mr.SATHASIVAN, for her/his valuable
mentoring throughout the project. The interesting lectures of my knowledgeable teacher has helped
me understand the various concepts related to Teacher’s Assitant and see their presence in the actual
world.

I got ample opportunity to do research, which enriched and broadened my knowledge


and understanding of this area. I am seriously indebted to them.

Thanks to my parents, friends and everyone else who have been directly or indirectly
supportive during the course of my project.

Student Name: Pranav N

Register No. : 20219324

Class : XII – AN1

Date of Submission :
Introduction

Teacher Assistant Application is a Python-based project tailored for educational


environments. This comprehensive tool seamlessly integrates features like
attendance tracking, grade management, and timetable creation, all backed by a
secure MySQL database. With an emphasis on user-friendliness and functionality,
educators can effortlessly navigate through tasks such as recording attendance and
updating student marks. This project stands as a testament to streamlined
administrative processes, providing a valuable resource for educators seeking
efficiency in their daily tasks.
Objectives

The objective of this project is to conduct research and create a program designed
to alleviate the challenges encountered by educational institutions in the effective
management and updating of teacher timetables. By addressing this aspect, the
project seeks to contribute to the overall organizational efficiency of educational
institutions. The program aims to streamline the process of timetable creation,
modification, and organization, providing a comprehensive solution that optimizes
time management and enhances the operational effectiveness of educational
establishments.
Scope

The Teacher Assistant Application aspires to revolutionize administrative


processes within educational institutions, focusing on attendance tracking, grade
management, and timetable creation. The project aims to provide educators with a
user-friendly platform for efficiently managing attendance records, updating
student grades, and creating and modifying teacher timetables. By leveraging a
MySQL database, the application prioritizes data security and integrity. The scope
extends to designing an intuitive user interface, implementing robust error
handling, ensuring scalability for future enhancements, and offering
comprehensive documentation for easy maintenance. The project envisions a
seamless and secure solution, contributing to the overall organizational
effectiveness of educational institutions.
Hardware and Software Requirements

Hardware Requirements:

1. Processor: Dual-core processor or higher for optimal performance.


2. RAM: 4 GB or more to handle database operations and application
functionalities.
3. Storage: 10 GB of free storage space for the application and database.

Software Requirements:

1. Operating System:
-Windows 10, macOS, or Linux for broad compatibility.

2. Python:
-Python 3.7 or later installed to execute the Python script.
-Download Python from the official website: [Python
Downloads](https://www.python.org/downloads/).

3. MySQL Database:
-MySQL Server installed and running.
-MySQL Connector/Python library for Python to connect to the MySQL
database. Install it using:
```
pip install mysql-connector-python
```

4. CSV Module:
-Built-in CSV module in Python for handling timetable data.

5. Text Editor or Integrated Development Environment (IDE):


-Choose a preferred text editor (e.g., Visual Studio Code, Sublime Text) or IDE
(e.g., PyCharm, VSCode with Python extension) for code development.
6. Additional Python Libraries:
-Install any additional libraries used in the code, such as `csv` (already included
in the standard library).

7. Optional: MySQL GUI Tool (e.g., MySQL Workbench):


-A graphical user interface for MySQL may be useful for database management.
Install MySQL Workbench from [MySQL
Downloads](https://dev.mysql.com/downloads/workbench/).
Description

The Python script comprises functions for managing attendance, marks, and
timetables in an educational setting. It utilizes MySQL for data storage, provides a
user-friendly interface, and includes features for recording, updating, and deleting
student attendance and marks. The code ensures efficient organizational
effectiveness for educators through streamlined administrative processes.

1. `attendance()` Function:
- Purpose: Manages attendance-related operations.
- Steps:
1. Connects to a MySQL database and creates an "attendance" table if not
exists.
2. Defines functions for taking attendance, updating attendance, and deleting
attendance.
3. Allows the user to choose between these operations based on input.
4. Closes the database connection after the chosen operation.

2. `take_attendance()` Function:
- Purpose: Takes input for student name, attendance status, and class date, inserts
the data into the "attendance" table, and commits the changes to the database.

3. `update_attendance()` Function:
- Purpose: Takes input to update attendance for a specific student, class date, and
status. Updates the "attendance" table accordingly and commits changes to the
database.

4. `delete_attendance()` Function:
- Purpose: Takes input to delete attendance records for a specific student and
class date. Deletes the records from the "attendance" table and commits the
changes to the database.

5. `timetable()` Function:
- Purpose: Manages timetable-related operations.
- Steps:
1. Defines functions for creating, updating, and deleting timetables.
2. Allows the user to choose between these operations based on input.
3. Closes the database connection after the chosen operation.

6. `create_timetable()` Function:
- Purpose: Takes input for a teacher's name and generates a timetable for each
weekday and period. Writes the timetable data to a CSV file.

7. `update_timetable()` Function:
- Purpose: Takes input to update a teacher's timetable for a specific day and
period. Reads the existing timetable from a CSV file, updates the data, and writes
it back to the file.

8. `delete_timetable()` Function:
- Purpose: Takes input to delete a teacher's timetable. Removes the corresponding
CSV file if it exists.

9. `marks()` Function:
- Purpose: Manages student marks-related operations.
- Steps:
1. Connects to a MySQL database and creates a "student_marks" table if not
exists.
2. Defines functions for storing, updating, and deleting student marks.
3. Allows the user to choose between these operations based on input.
4. Closes the database connection after the chosen operation.

10. `store_marks()` Function:


- Purpose: Takes input for student name, subject, and marks, inserts the data into
the "student_marks" table, and commits the changes to the database.

11. `update_marks()` Function:


- Purpose: Takes input to update student marks for a specific student, subject,
and new marks. Updates the "student_marks" table accordingly and commits
changes to the database.
12. `delete_marks()` Function:
- Purpose: Takes input to delete student marks for a specific student and subject.
Deletes the records from the "student_marks" table and commits changes to the
database.

13. `main()` Block:


- Purpose: Executes the main program, prompting the user to choose between
attendance, marks, and timetable operations.

Each function is designed to perform specific tasks related to attendance, marks,


and timetables, providing a modular and organized structure to the code.
Future Scope

The future scope of the code envisions a comprehensive evolution into an advanced
educational management system. Key areas for expansion include implementing
user authentication for enhanced security, developing a graphical user interface
(GUI) to improve user experience, and integrating email notifications to keep
stakeholders informed. Additionally, exploring machine learning for predictive
analysis, mobile application development, and integration with Learning
Management Systems (LMS) will empower educators with data-driven insights
and convenient access. Automated report generation, multi-tenant support, and
enhanced security measures will contribute to the code's scalability and
effectiveness, while cloud integration ensures broader accessibility and data
management capabilities. Overall, the future holds immense potential for the code
to become a versatile and sophisticated tool, catering to the evolving needs of
educational institutions globally.
Drawbacks

The code exhibits certain drawbacks that warrant consideration. Notably, it may
lack comprehensive error-handling mechanisms, potentially leading to unexpected
behavior. The reliance on a CSV file for timetable management could pose
scalability challenges and limit flexibility as the educational institution grows.
Security concerns arise regarding the handling of sensitive data, necessitating
additional measures for protection. The absence of a graphical user interface limits
accessibility, potentially hindering user adoption. Furthermore, the code lacks a
detailed suite of unit tests, making it challenging to ensure reliability and
correctness in various scenarios. To enhance the code's robustness, scalability, and
user-friendliness, addressing these drawbacks through improved error handling,
security measures, and scalability considerations is recommended.
Coding

import mysql.connector
import csv
import os

def attendance():
conn = mysql.connector.connect(host="localhost",user="root",password="root",database="project")
cursor = conn.cursor()
create_table_query = "CREATE TABLE IF NOT EXISTS attendance (id INT AUTO_INCREMENT PRIMARY KEY, student_name
VARCHAR(255) NOT NULL, status VARCHAR(10) NOT NULL, class_date DATE NOT NULL)"
cursor.execute(create_table_query)

def take_attendance():
student_name = input("Enter student name: ")
status = input("Enter attendance status (Present/Absent): ")
class_date = input("Enter class date (YYYY-MM-DD): ")
insert_query = "INSERT INTO attendance (student_name, status, class_date) VALUES (%s, %s, %s)"
data = (student_name, status, class_date)
cursor.execute(insert_query, data)
conn.commit()
print("Attendance recorded successfully!")

def update_attendance():
student_name = input("Enter student name to update attendance: ")
new_status = input("Enter new attendance status (Present/Absent): ")
class_date = input("Enter class date to update (YYYY-MM-DD): ")

update_query = "UPDATE attendance SET status = %s WHERE student_name = %s AND class_date = %s"
data = (new_status, student_name, class_date)
cursor.execute(update_query, data)
conn.commit()
print("Attendance updated successfully!")

def delete_attendance():
student_name = input("Enter student name to delete attendance: ")
class_date = input("Enter class date to delete (YYYY-MM-DD): ")

delete_query = "DELETE FROM attendance WHERE student_name = %s AND class_date = %s"


data = (student_name, class_date)
cursor.execute(delete_query, data)
conn.commit()
print("Attendance deleted successfully!")

choice = input("Choose operation (1: Take Attendance, 2: Update Attendance, 3: Delete Attendance): ")
if choice == "1":
num_students = int(input("Enter the number of students: "))
for _ in range(num_students):
take_attendance()
elif choice == "2":
update_attendance()
elif choice == "3":
delete_attendance()
else:
print("Invalid choice. Please choose 1, 2, or 3.")

cursor.close()
conn.close()

def timetable():
def create_timetable():
teacher_name = input("Enter teacher's name: ")

timetable = [["Teacher", teacher_name]]

for day in ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]:


schedule = [day]
for period in range(1, 9):
subject = input(f"Enter class for {day} - Period {period}: ")
schedule.append(subject)
timetable.append(schedule)

filename = f"{teacher_name}.csv"
try:
with open(filename, 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerows(timetable)

print(f"Schedule for {teacher_name} has been added to {filename}.")


except (FileNotFoundError, PermissionError) as e:
print(f"Error: {e}. Could not write to the CSV file.")

import csv

def update_timetable():
teacher_name = input("Enter teacher's name to update timetable: ")
day = input("Enter day to update timetable: ")
period = int(input("Enter period to update: "))
new_subject = input("Enter new class for the period: ")

filename = f"{teacher_name}.csv"

try:
with open(filename, 'r', newline='') as csvfile:
reader = csv.reader(csvfile)
timetable = list(reader)
except FileNotFoundError:
print(f"Error: {filename} not found. Please create the timetable first.")
return

day_index = None
for i, row in enumerate(timetable):
if row and row[0] == day:
day_index = i
break

if day_index is not None:


timetable[day_index][period] = new_subject

try:
with open(filename, 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerows(timetable)

print(f"Timetable for {teacher_name} has been updated.")


except PermissionError as e:
print(f"Error: {e}. Could not write to the CSV file.")
else:
print(f"Error: Could not find {day} in the timetable.")

def delete_timetable():
teacher_name = input("Enter teacher's name to delete timetable: ")
filename = f"{teacher_name}.csv"

try:
os.remove(filename)
print(f"Timetable for {teacher_name} has been deleted.")
except FileNotFoundError:
print(f"Timetable file for {teacher_name} not found.")

choice = input("Choose operation (1: View Timetable, 2: Update Timetable, 3: Delete Timetable): ")

if choice == "1":
create_timetable()
elif choice == "2":
update_timetable()
elif choice == "3":
delete_timetable()
else:
print("Invalid choice. Please choose 1, 2, or 3.")

def marks():
conn = mysql.connector.connect(host="localhost",user="root",password="root",database="project")
cursor = conn.cursor()
create_table_query = "CREATE TABLE IF NOT EXISTS student_marks ( id INT AUTO_INCREMENT PRIMARY
KEY,student_name VARCHAR(255) NOT NULL,subject VARCHAR(255) NOT NULL,marks INT NOT NULL)"
cursor.execute(create_table_query)

def store_marks():
student_name = input("Enter student name: ")
subject = input("Enter subject: ")
marks = int(input("Enter marks: "))

insert_query = "INSERT INTO student_marks (student_name, subject, marks) VALUES (%s, %s, %s)"
data = (student_name, subject, marks)
cursor.execute(insert_query, data)
conn.commit()
print("Marks recorded successfully!")

def update_marks():
student_name = input("Enter student name to update marks: ")
subject = input("Enter subject to update: ")
new_marks = int(input("Enter new marks: "))

update_query = "UPDATE student_marks SET marks = %s WHERE student_name = %s AND subject = %s"
data = (new_marks, student_name, subject)
cursor.execute(update_query, data)
conn.commit()
print("Marks updated successfully!")

def delete_marks():
student_name = input("Enter student name to delete marks: ")
subject = input("Enter subject to delete: ")

delete_query = "DELETE FROM student_marks WHERE student_name = %s AND subject = %s"


data = (student_name, subject)
cursor.execute(delete_query, data)
conn.commit()
print("Marks deleted successfully!")
choice = input("Choose operation (1: Store Marks, 2: Update Marks, 3: Delete Marks): ")
if choice == "1":
store_marks()
elif choice == "2":
update_marks()
elif choice == "3":
delete_marks()
else:
print("Invalid choice.")
cursor.close()
conn.close()

print('-' 33)
print("Welocme to teacher assistant app!")
print('-' 33)
print("What operation do you want to perform?\n 1.Attendance\n 2.Marks\n 3.Timetable\n")
opt = int(input("Your choice:"))
if opt == 1:
attendance()
elif opt == 2:
marks()
elif opt == 3:
timetable()
else:
print("Invalid option.")
Outputs

ATTENDANCE INPUT:

UPDATING ATTENDANCE:

DELETING ATTENDANCE:
MARKS INPUT:

UPDATING MARKS:

DELETING MARKS:
TIMETABLE INPUT:
UPDATING TIMETABLE:

DELETING TIMETABLE:

HARRISH.CSV FILE:
Conclusion

In conclusion, the Teacher Assistant Application code provides a foundational


framework for managing attendance, marks, and timetables in educational
institutions. While functional, the code exhibits certain drawbacks, including
limited error handling, potential scalability challenges, and security concerns.
Addressing these issues through improved error management, enhanced security
measures, and scalability considerations would elevate the application's reliability
and usability. Additionally, future enhancements, such as a graphical user interface
and integration with learning management systems, could further optimize its
utility. The code serves as a starting point for an efficient educational management
system, with the potential for refinement and expansion to meet evolving
institutional needs.
Bibliography

1.https://www.w3schools.com/
2.https://www.github.com/

You might also like