Documentation Final
Documentation Final
TEST ANALYSER
SYSTEM
DONE BY:
K. DHARSHINI
INDEX
1. ABOUT PYTHON
2. ABOUT TKINTER
4. PROJECT DESCRIPTION
5. SOFTWARE SPECIFICATION
6. SOURCE CODE
7. SAMPLE OUTPUT
8. CONCLUSION
9. INSTALLATION PROCEDURE
10. BIBLIOGRAPHY
1
ABOUT PYTHON:
Python programming language was developed by Guido Van Rossum in February 1991. Python
is based on or influenced with two programming languages:
Modula-3
Often, programmers fall in love with Python because of the increased productivity it provides.
Since there is no compilation step, the edit-test-debug cycle is incredibly fast. Debugging Python
programs is easy: a bug or bad input will never cause a segmentation fault. Instead, when the
interpreter discovers an error, it raises an exception. When the program doesn't catch the exception,
the interpreter prints a stack trace. A source level debugger allows inspection of local and global
variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line
at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective
power. On the other hand, often the quickest way to debug a program is to add a few print
statements to the source: the fast edit-test-debug cycle makes this simple approach very effective.
2
ABOUT MYSQL:
MySQL, the most popular Open-Source SQL database management system, is developed,
distributed, and supported by Oracle Corporation.
A database is a structured collection of data. It may be anything from a simple shopping list
to a picture gallery or the vast amounts of information in a corporate network. To add, access,
and process data stored in a computer database, you need a database management system such
as MySQL Server. Since computers are very good at handling large amounts of data, database
management systems play a central role in computing, as standalone utilities, or as parts of
other applications.
A relational database stores data in separate tables rather than putting all the data in one big
storeroom. The database structures are organized into physical files optimized for speed. The
logical model, with objects such as databases, tables, views, rows, and columns, offers a
flexible programming environment. You set up rules governing the relationships between
different data fields, such as one-to-one, one-to-many, unique, required or optional,
and “pointers” between different tables. The database enforces these rules, so that with a well-
designed database, your application never sees inconsistent, duplicate, orphan, out-of-date, or
missing data.
The SQL part of “MySQL” stands for “Structured Query Language”. SQL is the most
common standardized language used to access databases. Depending on your programming
environment, you might enter SQL directly (for example, to generate reports), embed SQL
statements into code written in another language, or use a language-specific API that hides
the SQL syntax.
SQL is defined by the ANSI/ISO SQL Standard. The SQL standard has been evolving since
1986 and several versions exist. In this manual, “SQL-92” refers to the standard released in
1992, “SQL-1999” refers to the standard released in 1999, and “SQL:2003” refers to the
current version of the standard. We use the phrase “the SQL standard” to mean the current
version of the SQL Standard at any time.
3
MySQL software is Open Source.
Open Source means that it is possible for anyone to use and modify the software. Anybody
can download the MySQL software from the Internet and use it without paying anything. If
you wish, you may study the source code and change it to suit your needs. The MySQL
software uses the GPL (GNU General Public License), to define what you may and may not
do with the software in different situations. If you feel uncomfortable with the GPL or need
to embed MySQL code into a commercial application, you can buy a commercially licensed
version from us.
The MySQL Database Server is very fast, reliable, scalable, and easy to use.
If that is what you are looking for, you should give it a try. MySQL Server can run comfortably
on a desktop or laptop, alongside your other applications, web servers, and so on, requiring
little or no attention. If you dedicate an entire machine to MySQL, you can adjust the settings
to take advantage of all the memory, CPU power, and I/O capacity available. MySQL can
also scale up to clusters of machines, networked together.
MySQL Server was originally developed to handle large databases much faster than existing
solutions and has been successfully used in highly demanding production environments for
several years. Although under constant development, MySQL Server today offers a rich and
useful set of functions. Its connectivity, speed, and security make MySQL Server highly suited
for accessing databases on the Internet.
We also provide MySQL Server as an embedded multithreaded library that you can link into
your application to get a smaller, faster, easier-to-manage standalone product.
4
ABOUT TKINTER:
Tkinter is a python program binding to the Tk GUI toolkit. It is the standard Python interface to
the Tk GUI toolkit, and is Python’s de facto standard GUI.Tkinter is included with standard Linux,
Microsoft Windows and Mac OS X installs of Python.Tk is a, cross-platform widget toolkit that
provides a library of basic elements of GUI widgets for building a graphical user interface (GUI)
in many programming languages.
The name Tkinter comes from Tk interface. Tkinter was written by Steen Lumholt and Guido Van
Rossum, then later revised by Fredrik Lundh. Like Tcl, Tk support Unicode within the Basic
Multilingual Plane, but it has not yet been extended to handle the current extended
full Unicode (e.g., UTF-16 from UCS-2 that Tk supports).
Platform-independent: Like Tcl, Tk is interpreted. It has been ported to multiple platforms and
can easily run on all of them without modification.
Customizable: Almost all the features of a widget in Tk are customizable through options during
the creation of the widget or later on through the configure command.
Configurable: Many of the options can be stored in an option database, making it very easy to
parameterize the look of an application (such as the color scheme). This also means that storing
the application-specific options is only a matter of saving the option add commands and executing
them on loading the application.
5
FEATURES OF TK:
Tk provides various widgets. Basic widgets are embedded into toplevel widgets, which in turn are
usually hosted by the operating system in floating windows that can be moved around on the
screen.
Basic widgets
Language bindings
A library written in one programming language may be used in another language
if bindings are written; Tk is integrated with the Tcl language. Various other languages
have bindings for Tk, a partial list of which is on the Tk website. Bindings exist for
additional languages which might not be listed, including Ada (called
TASH),Haskell (called HTk), Perl, Python (called Tkinter), Ruby, Rexx, and Common
Lisp.
There are several ways to use Tk from Perl: the Tcl::Tk and Tkx Perl modules,both of
which use Tcl as a bridge to access Tk, and Perl/Tk, which provides native Perl access to
Tk structures. The Python binding uses Tcl as a bridge to Tk.
6
ABOUT PYTHON-MYSQL
CONNECTIVITY:
While designing real-life applications, certain situations arise pertaining to storing some important
and necessary information by the user. Usually, the data inputted by the user along with the
generated output are displayed but not stored, since all the program execution takes place inside
the RAM, which is a temporary memory, and as soon as we close the form, its contents (form input
and generated output) get erased. They can’t be retrieved since they are not getting saved on a hard
disk (or any secondary storage device). Thus, when the application is executed the second time, it
requires a new set of inputs from the user. This limitation can be overcome by sending the output
generated and saving the input fetched from the user in a database created at the back-end of the
application. The input is fetched from the user using Python Interface. This is termed as the Front
End Interface of the application.
7
Database (The Back-end)
While working with an application, it is required to save data permanently on some secondary
storage device, which is usually the hard disk, so that data can be stored on it for future reference,
modification, deletion and retrieval. An application usually stores a lot of data in the form of a
database which is not directly accessible to the user. This database is used by the application to
give suitable response to the user. This database is called Back-end Database.
In Class XI, we have learnt how to create databases, tables and how to perform query processing
on these tables using SQL commands like CREATE, UPDATE, ALTER, INSERT, DELETE,
SELECT and so on in various forms according to their specific syntax structures. We shall be
implementing all these DDL and DML commands of SQL through Python Interface.
WHY PYTHON
Python is a flexible, portable, easy to learn and modifiable language. So, we are integrating
MySQL with Python interface for executing any database applications. The various reasons to use
Python for programming database applications are:
It is platform-independent.
In many programming languages, the application developer needs to take care of the open
and closed connections of the database to avoid further exceptions and errors. In Python,
these connections are taken care of.
Python database APIs are compatible with various databases, so it is very easy to migrate
8
PROJECT DESCRIPTION:
Objective:
The objective of this project is to let the students apply the programming knowledge into a real-
world situation/problem and exposed the students how programming skills helps in developing a
good software.
5. Students will demonstrate ability to conduct research or applied Computer Science project,
requiring writing and presentation skills which exemplify scholarly style in computer
science.
Description:
The objective of Test Analyser System is to allow the administrator of a class to add the test details
of a student into a database. It will also facilitate keeping all the test records of students, such as
their roll number, name, class, grade, test scores,etc. It will also calculate the total marks of the
student and their grade. So, all the information about student’s performance will be available in a
few seconds.
Overall, the Test Analyser System makes the job easier for the administrator of any class.
9
MODULES:
The important modules used in the project are as follows:
Login
Menu page
Insert
Result
Ranking
The MySQL table used for storing student details in this project is:
TEST I
TEST 2
SOFTWARE SPECIFICATION:
Operating System : Windows10
Platform : Python IDLE 3.8.6
Database : MySQL
Language : Python
10
SOURCE CODE:
Login Page
from tkinter import *
import tkinter.messagebox as MessageBox
import mysql.connector as mysql
from PIL import ImageTk, Image
def check():
if e1.get()=="FCS" and e2.get()=="09876":
login.destroy()
import menu_page
else:
l1=Label(login, text="Login unsuccessful", font = ("simsun", 20, "bold"), bg= "RED")
l1.place(x=600, y=330)
login=Tk()
login.geometry("900x500")
login.configure()
login.title("TEST ANALYSER Login")
# Add the image file
bg=ImageTk.PhotoImage(file="LOGIN.png")
# Create a canvas
canvas = Canvas(login,width= 400, height= 200)
canvas.pack(fill= "both", expand=True)
# Display image
canvas.create_image(0, 0, image=bg, anchor="nw")
# Add a text in canvas
canvas.create_text(450,20,text="WELCOME TO FCS - TEST ANALYSER SYSTEM",
font=("Times New Roman", 24, "bold"))
11
l1=Label(login, text ="Enter User_Id", font=("Arial", 15, "bold"), bg= "Skyblue")
l1.place(x=50, y=150)
e1=Entry(login, width=10, font=(20))
e1.place(x=250, y=150)
l2=Label(login, text = "Enter Password", font=("Arial", 15, "bold"), bg = "Skyblue")
l2.place(x=50, y=250)
e2=Entry(login, width=10, font=(20), show="*")
e2.place(x=250, y=250)
b2=Button(login, text="Submit", font=("Arial", 15, "bold"), bg="green", command = check)
b2.place(x=200, y=330)
login.mainloop()
Menu Page
from tkinter import *
def insert():
import insert
def view():
import results
def rank():
import ranking
def exit1():
root.destroy()
12
root = Tk()
root.geometry("1200x600")
root.configure(bg="skyblue")
bg = ImageTk.PhotoImage(file="bglogin1.png")
# Create a canvas
# Display image
sname.place(x=200, y=0)
insert.place(x=150, y=100)
view.place(x=150, y=200)
rank.place(x=150, y=300)
closeButton.place(x=150, y=500)
root.mainloop()
13
Inserting Records
from tkinter import *
curs=mydb.cursor()
curs.execute('use Project_DHS')
root = Tk()
root.geometry("500x500")
root.configure(bg="skyblue")
def TT1():
import insert1
def TT2():
import insert2
new.place(x=150, y=100)
existing.place(x=150, y=300)
root.mainloop()
#for test 1
14
import tkinter.messagebox as msgBox
curs=mydb.cursor()
curs.execute('use Project_DHS')
rt1=Tk()
rt1.geometry ('500x500')
def add():
a=e1.get()
b=int(e2.get())
c=e3.get()
d=int(e4.get())
e=int(e5.get())
f=int(e6.get())
g=int(e7.get())
h=int(e8.get())
m=int(d+e+f+g+h)
if m in range (475,501):
n='A'
n='B'
n='C'
n='D'
15
elif m in range (200,300):
n='E'
else:
n='F'
curs.execute(st1)
mydb.commit()
rt1.destroy()
import exitscreen
l1.place(x=50, y=50)
e1.place(x=400, y=50)
l2.place(x=50, y=100)
e2.place(x=400, y=100)
l3.place(x=50, y=150)
e3.place(x=400, y=150)
l4.place(x=50, y=200)
16
e4=Entry(rt1, width=10, font=(20))
e4.place(x=400, y=200)
l5.place(x=50, y=250)
e5.place(x=400, y=250)
l6.place(x=50, y=300)
e6.place(x=400, y=300)
l7.place(x=50, y=350)
e7.place(x=400, y=350)
l8.place(x=50, y=400)
e8.place(x=400, y=400)
b.place(x=300, y=600)
rt1.mainloop()
17
Test 2
from tkinter import *
curs=mydb.cursor()
curs.execute('use Project_DHS')
rt1=Tk()
rt1.geometry ('500x500')
def add():
a=e1.get()
b=int(e2.get())
c=e3.get()
d=int(e4.get())
e=int(e5.get())
f=int(e6.get())
g=int(e7.get())
h=int(e8.get())
m=int(d+e+f+g+h)
if m in range (475,501):
n='A'
n='B'
n='C'
18
elif m in range (300,375):
n='D'
n='E'
else:
n='F'
curs.execute(st1)
mydb.commit()
rt1.destroy()
import exitscreen
l1.place(x=50, y=50)
e1.place(x=400, y=50)
l2.place(x=50, y=100)
e2.place(x=400, y=100)
l3.place(x=50, y=150)
19
e3.place(x=400, y=150)
l4.place(x=50, y=200)
e4.place(x=400, y=200)
l5.place(x=50, y=250)
e5.place(x=400, y=250)
l6.place(x=50, y=300)
e6.place(x=400, y=300)
l7.place(x=50, y=350)
e7.place(x=400, y=350)
l8.place(x=50, y=400)
e8.place(x=400, y=400)
b.place(x=300, y=600)
rt1.mainloop()
20
Ranking (Scoreboard) Module
import mysql.connector as connector
import tkinter as tk
rooti= tk.Tk()
rooti.geometry("800x800")
curs=mydb.cursor()
curs.execute('use Project_DHS')
rooti.configure(bg='skyblue')
rooti.title('SCOREBARD')
def scorei():
rooti.destroy()
import scoretesti
def score2():
rooti.destroy()
import scoretest2
test1.place(x=150, y=200)
test2.place(x=150, y=500)
rooti.mainloop()
21
#Ranking for test 1
import mysql.connector as connector
import tkinter as tk
my_w = tk.Tk()
my_w.geometry("800x800")
curs=mydb.cursor()
curs.execute('use Project_DHS')
e=Label(my_w,width=10,text='class',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=0)
e=Label(my_w,width=10,text='Rollno',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=1)
e=Label(my_w,width=10,text='Name',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=2)
e=Label(my_w,width=10,text='English',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=3)
e=Label(my_w,width=10,text='Tamil',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=4)
e=Label(my_w,width=10,text='Science',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=5)
e=Label(my_w,width=10,text='SocialScience',borderwidth=2,
relief='ridge',anchor='w',bg='yellow')
22
e.grid(row=0,column=6)
e=Label(my_w,width=10,text='Mathematics',borderwidth=2,
relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=7)
e=Label(my_w,width=10,text='TotalMarks',borderwidth=2,
relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=8)
e=Label(my_w,width=10,text='Grade',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=9)
i=1
for j in range(len(student)):
e.grid(row=i, column=j)
e.insert(END, student[j])
i=i+1
def erg():
my_w.destroy()
import exitscreen
closeButton.place(x=400, y=500)
my_w.mainloop()
import tkinter as tk
23
from tkinter import *
my_w = tk.Tk()
my_w.geometry("800x800")
curs=mydb.cursor()
curs.execute('use Project_DHS')
e=Label(my_w,width=10,text='class',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=0)
e=Label(my_w,width=10,text='Rollno',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=1)
e=Label(my_w,width=10,text='Name',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=2)
e=Label(my_w,width=10,text='English',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=3)
e=Label(my_w,width=10,text='Tamil',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=4)
e=Label(my_w,width=10,text='Science',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=5)
e=Label(my_w,width=10,text='SocialScience',borderwidth=2,
relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=6)
e=Label(my_w,width=10,text='Mathematics',borderwidth=2,
relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=7)
24
e=Label(my_w,width=10,text='TotalMarks',borderwidth=2,
relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=8)
e=Label(my_w,width=10,text='Grade',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=9)
i=1
for j in range(len(student)):
e.grid(row=i, column=j)
e.insert(END, student[j])
i=i+1
def erg():
my_w.destroy()
import exitscreen
closeButton.place(x=400, y=500)
my_w.mainloop()
25
View Results Module:
import mysql.connector as connector
import tkinter as tk
my_w = tk.Tk()
my_w.geometry("800x800")
curs=mydb.cursor()
curs.execute('use Project_DHS')
my_w.configure(bg='pink')
def FT():
my_w.destroy()
import test1rec
def ST():
my_w.destroy()
import test2rec
test1.place(x=150, y=200)
test2.place(x=150, y=500)
my_w.mainloop()
26
Results of Test 1
import mysql.connector as connector
import tkinter as tk
curs=mydb.cursor()
curs.execute("use Project_DHS")
w=Tk()
w.geometry('800x700')
w.configure(bg='skyblue')
w.title('TEST 1 records')
e=Label(w,width=10,text='class',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=0)
e=Label(w,width=10,text='Rollno',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=1)
e=Label(w,width=10,text='Name',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=2)
e=Label(w,width=10,text='English',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=3)
e=Label(w,width=10,text='Tamil',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=4)
e=Label(w,width=10,text='Science',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=5)
e=Label(w,width=10,text='SocialScience',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
27
e.grid(row=0,column=6)
e=Label(w,width=10,text='Mathematics',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=7)
e=Label(w,width=10,text='ToatalMarks',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=8)
e=Label(w,width=10,text='Grade',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=9)
i=1
for j in range(len(student)):
e.grid(row=i, column=j)
e.insert(END, student[j])
i=i+1
def erg():
w.destroy()
import exitscreen
closeButton.place(x=400, y=500)
w.mainloop()
28
Results of Test 2
import mysql.connector as connector
import tkinter as tk
curs=mydb.cursor()
curs.execute("use Project_DHS")
w=Tk()
w.geometry('800x700')
w.configure(bg='skyblue')
w.title('TEST 2 records')
e=Label(w,width=10,text='class',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=0)
e=Label(w,width=10,text='Rollno',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=1)
e=Label(w,width=10,text='Name',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=2)
e=Label(w,width=10,text='English',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=3)
e=Label(w,width=10,text='Tamil',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=4)
e=Label(w,width=10,text='Science',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=5)
29
e=Label(w,width=10,text='SocialScience',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=6)
e=Label(w,width=10,text='Mathematics',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=7)
e=Label(w,width=10,text='ToatalMarks',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=8)
e=Label(w,width=10,text='Grade',borderwidth=2, relief='ridge',anchor='w',bg='yellow')
e.grid(row=0,column=9)
i=1
for j in range(len(student)):
e.grid(row=i, column=j)
e.insert(END, student[j])
i=i+1
def erg():
w.destroy()
import exitscreen
closeButton.place(x=400, y=500)
w.mainloop()
30
Exit Module
from tkinter import *
thank=Tk()
thank.geometry("900x500")
thank.configure()
canvas.pack()
thank.mainloop()
exit
31
SAMPLE OUTPUT:
LOGIN PAGE:
MAIN MENU:
32
INSERTING TEST RECORDS:
33
VIEW RESULTS:
34
SCOREBOARD (SCORES FROM HIGHEST TO
LOWEST):
35
EXIT PAGE:
36
CONCLUSION:
Test Analyser System stands as a pivotal tool in modern educational landscapes, fostering a
interface and functionalities, this system empowers administrator, teachers and students alike to
engage in the academic to access and analyse academic performance data with ease.
The implementation of this project provides a platform to effectively display and manage student
results. The main aim of the program is to make the work easier and faster in school. This project
is much closer to teacher as well as student. This project is very easy to store the marks of the
37
INSTALLATION PROCEDURE:
Install Python and MySQL from the web
Open the source code
Then run the login_page.pyfile
Work on the software
38
BIBLIOGRAPHY:
1. Computer science With Python - Class XII By : SumitaArora
3. Website: https://www.tutorialsteacher.com
4. Website: https://www.javatpoint.com
5. Website: https://www.w3resource.com
39