Professional Documents
Culture Documents
Ip Project 2
Ip Project 2
A PROJECT REPORT
ON
SUBMITTED BY:
Mr.SivaPrasad G
Page 1
Quiz Management System March 2024
CERTIFICATE
This is to certify that the Project / Dissertation entitled Quiz Management System is a
bonafide work done by Mr. Ali Siddiqui of class XII in partial fulfillment of CBSE’s AISSCE
Examination 2020-21 and has been carried out under my direct supervision and guidance.
This report or a similar report on the topic has not been submitted for any other examination
and does not form a part of any other course undergone by the candidate.
Signature of Principal
Name:
Place: JP Nagar
Date:……………..
Page 2
Quiz Management System March 2024
ACKNOWLEDGEMENT
I would like thank the institution for giving the opportunity to encase and display our talent
through this project.
I would like to thank my Informatics Practices teacher Mr.SivaPrasad G for having the
patience to guide me at every step in the project
I am also grateful to the CBSE BOARD for challenging and giving us this project in which we
all were so engrossed.
I would also like to thank my parents and friends who helped me in getting the right
information for this project.
Page 3
Quiz Management System March 2024
TABLE OF CONTENTS
Abstract
1
5
2 System requirements 6
3 Database design 7
4 Coding 8
5 Output screens 15
6 Bibliography 21
ABSTRACT
Page 4
Quiz Management System March 2024
The Purpose of Quiz Management System is to automate the existing manual system by the
help of computerized equipment and full-fledged computer Software, fulfilling their
Requirements, So that their valuable data/information can be stored for a longer period with
easy accessing and manipulation of the same.
The required software and hardware are easily available and easy to work with. Quiz
Management System, as described above, can lead to error free, secure, reliable and fast
management system. It can assist the user to concentrate on their other activities rather to
concentrate on the record keeping.
Basically the project describes how to manage for good performance and better services to
the peoples who are taking part in the quiz. The system will show result after the examination
is finished. A teacher has control in the question bank and is supposed to make schedule for
the quiz. The system carries out the examination and auto-grading for multiple choice
questions which is fed into the system. Administrative control of the whole system is provided
SYSTEM REQUIREMENTS
Page 5
Quiz Management System March 2024
Hardware Components
1. VGA Monitor
2. Qwerty keyboard
3. 2GB RAM
4. 2.6 GHz Processor
5. Graphics card
Software Components
1. Windows 7
2. Python 3.7 with suitable modules
3. MySQL Command Client
DATABASE DESIGN
Page 6
Quiz Management System March 2024
In the following “questions” table, we will store the details of all questions for the quiz.
In the following “results” table, we will store the score of each participant and the quiz
result ‘p’ for PASS and ‘f’ for FAIL
CODING
Page 7
Quiz Management System March 2024
import mysql.connector
import time
import matplotlib.pyplot as plt
db = mysql.connector.connect(
host="127.0.0.1",
user="root",
password="SaiAnirudh_2011",
database="quiz_2023"
)
cursor = db.cursor()
try:
cursor.execute("""
CREATE TABLE IF NOT EXISTS quiz_2023.questions
(
q_id int primary key NOT NULL AUTO_INCREMENT,
question varchar(30) not null,
optiona varchar(20)not null,
optionb varchar(20)not null,
optionc varchar(20)not null,
optiond varchar(20)not null,
answer varchar(1) not null
);
""")
except mysql.Error as err:
print(err)
try:
cursor.execute("""
CREATE TABLE IF NOT EXISTS quiz_2023.results
(
r_id int primary key NOT NULL AUTO_INCREMENT,
name varchar(30) not null,
score varchar(20)not null,
result varchar(20)not null
);
""")
except mysql.Error as err:
print(err)
def intro():
print("\n")
print("=" * 110)
Page 8
Quiz Management System March 2024
def display_all_res():
cursor.execute("SELECT * FROM quiz_2023.results")
print(" ","-" * 101)
print('\t{0:4}{1:30}{2:15}{3:15}'.format('NO.', 'NAME', 'SCORE', 'RESULT'))
print(" ","-" * 101)
Page 9
Quiz Management System March 2024
def delete_question(id):
sql = "DELETE FROM quiz_2023.questions WHERE q_id = %s"
value = (id,)
cursor.execute(sql, value)
db.commit()
if cursor.rowcount == 0:
print("\tQuestion with id " + id + " not found")
else:
print("\tQuestion with id " + id + " deleted successfully")
def modify_question(id):
sql = "SELECT * FROM quiz_2023.questions WHERE q_id = %s"
value = (id,)
cursor.execute(sql, value)
record = cursor.fetchone()
if record is None:
print("\tNo such question exists")
else:
while True:
print("\n\tPress the option you want to edit: ")
print("\n\t1. Question")
print("\t2. Option A")
print("\t3. Option B")
print("\t4. Option C")
print("\t5. Option D")
print("\t6. Option ANSWER")
print("\t7. Go to main menu")
print()
ch = int(input("\tSelect Your Option (1-7): "))
if ch == 1:
new_question = input("\n\tEnter new Question: ")
sql = "UPDATE quiz_2023.questions SET question = %s WHERE q_id = %s"
values = (new_question, id)
cursor.execute(sql, values)
db.commit()
print("\tQuestion updated successfully")
elif ch == 2:
Page 10
Quiz Management System March 2024
Page 11
Quiz Management System March 2024
else:
print(f"\tSORRY!!! Your answer is incorrect :-(. \n\tYour score is {score}!")
return False
def quiz_savescore(name, score):
if score > 0:
result = 'p'
else:
result = 'f'
sql = "INSERT INTO quiz_2023.results(name, score, result) VALUES (%s,%s,%s)" record
= (name, score, result)
cursor.execute(sql, record)
db.commit()
print("\tScore saved successfully\n")
def play_quiz():
name = input("\n\tEnter player name: ")
score = 0
cursor.execute("SELECT * FROM quiz_2023.questions")
for record in cursor:
print(f"\n\tQUESTION {record[0]}: {record[1]}\n")
print(f"\tA. {record[2]}")
print(f"\tB. {record[3]}")
print(f"\tC. {record[4]}")
print(f"\tD. {record[5]}")
answer = input("\n\tEnter Answer : ")
check = check_ans(record, answer, score)
if check:
score += 1
print(f"\n\tYour final score is {score}!\n\n")
quiz_savescore(name, score)
print("\tThanks for playing!\n")
print(" ","-" * 101)
def quiz_report():
passed = 0
failed = 0
results=[]
numPlayers=[]
Page 12
Quiz Management System March 2024
def main():
intro()
while True:
print("\n")
print("{:^110s}".format("MAIN MENU"))
print("{:^110s}".format("---------"))
print("\n\t1. ADD A NEW QUESTION")
print("\t2. DISPLAY ALL QUESTIONS")
print("\t3. DELETE QUESTION")
print("\t4. MODIFY QUESTION")
print("\t5. PLAY QUIZ")
print("\t6. REPORT")
print("\t7. EXIT")
print()
Page 13
Quiz Management System March 2024
elif ch == 3:
print("\n\tDELETE QUESTION")
print("\t---------------")
id = input("\n\tEnter Question id: ")
delete_question(id)
elif ch == 4:
print("\n\tMODIFY QUESTION")
print("\t---------------")
id = input("\n\tEnter Question id: ")
modify_question(id)
elif ch == 5:
print("\n\tPLAY QUIZ")
print("\t---------")
play_quiz()
elif ch == 6:
print("\n\tREPORT")
print("\t-------")
display_all_res()
quiz_report()
elif ch == 7:
end_quiz()
db.close()
break
else:
print("\tInvalid choice")
main()
OUTPUT SCREEN
Page 14
Quiz Management System March 2024
Page 15
Quiz Management System March 2024
Page 16
Quiz Management System March 2024
Page 17
Quiz Management System March 2024
Page 18
Quiz Management System March 2024
Page 19
Quiz Management System March 2024
Table : Questions
Table : Results
Page 20
Quiz Management System March 2024
Bibliography
www.google.com
www.python.org.
www.geeksforgeeks.org
www.stackoveflow.com
Page 21