Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

Quiz Management System March 2024

A PROJECT REPORT
ON

Employee Management System


FOR
AISSCE 2024 EXAMINATION
As a part of the Informatics Practices Course (065)

SUBMITTED BY:

Name of the Student Hall ticket Number


1) Muhammad Ali Siddiqui

Under the guidance of

Mr.SivaPrasad G

PGT in Informatics Practices

DEPARTMENT OF INFORMATICS PRACTICES

SRI CHAITANYA TECHNO SCHOOL


Kothanur Dinne Main Road, Near Bus Stop 8th Phase, JP Nagar, Jumbo Sawari, Dinne,
Bengaluru, Karnataka 560078

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 Student Signature of Teacher/Guide

Name: ……………………. Name: SivaPrasad G

Roll No.: …………………… Designation: PGT in IP

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

Si No. Topic Name Page No.

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

print("{:^110s}".format("WELCOME TO QUIZ MANAGEMENT SYSTEM"))


print("=" * 110)
print()
def end_quiz():
print("\n")
print("=" * 110)
print("{:^110s}".format("THANK YOU FOR USING QUIZ MANAGEMENT SYSTEM"))
print("=" * 110)
print()
def create_question():
question = input("\tEnter new question: ")
optiona = input("\tEnter Option A: ")
optionb = input("\tEnter Option B: ")
optionc = input("\tEnter Option C: ")
optiond = input("\tEnter Option D: ")
answer = input("\tEnter Answer: ")

sql = "INSERT INTO quiz_2023.questions(question, optiona, optionb, optionc, optiond,


answer) VALUES (%s,%s,%s,%s,%s,%s)"
record = (question, optiona, optionb, optionc, optiond, answer)
cursor.execute(sql, record)
db.commit()
print("\tQuestion Entered Successfully\n")
def display_all():
cursor.execute("SELECT * FROM quiz_2023.questions")
print("\n")
print(" ","-" * 101)
print('\t{0:4}{1:30}{2:15}{3:15}{4:15}{5:15}{6:1}'.format('NO.', 'QUESTION', 'OPTION A',
'OPTION B', 'OPTION C', 'OPTION D', 'ANSWER'))
print(" ","-" * 101)
for record in cursor:
print('\t{0:4}{1:30}{2:15}{3:15}{4:15}{5:15}{6:1}'.format(str(record[0]), record[1], record[2],
record[3], record[4], record[5], record[6]))
print(" ","-" * 101)

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

for record in cursor:


print('\t{0:4}{1:30}{2:15}{3:15}'.format(str(record[0]), record[1], record[2], record[3]))
print(" ","-" * 101)

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

new_optiona = input("\n\tEnter new Option A: ")


sql = "UPDATE quiz_2023.questions SET optiona = %s WHERE q_id = %s"
values = (new_optiona, id)
cursor.execute(sql, values)
db.commit()
print("\tQuestion updated successfully")
elif ch == 3:
new_optionb = input("\n\tEnter new Option B : ")
sql = "UPDATE quiz_2023.questions SET optionb = %s WHERE q_id = %s"
values = (new_optionb, id)
cursor.execute(sql, values)
db.commit()
print("\tQuestion updated successfully")
elif ch == 4:
new_optionc = input("\n\tEnter new Option C : ")
sql = "UPDATE quiz_2023.questions SET optionc = %s WHERE q_id = %s"
values = (new_optionc, id)
cursor.execute(sql, values)
db.commit()
print("\tQuestion updated successfully")
elif ch == 5:
new_optiond = input("\n\tEnter new Option D : ")
sql = "UPDATE quiz_2023.questions SET optiond = %s WHERE q_id = %s"
values = (new_optiond, id)
cursor.execute(sql, values)
db.commit()
print("\tQuestion updated successfully")
elif ch == 6:
new_answer = input("\n\tEnter new Answer : ")
sql = "UPDATE quiz_2023.questions SET answer = %s WHERE q_id = %s"
values = (new_answer, id)
cursor.execute(sql, values)
db.commit()
print("\tQuestion updated successfully")
elif ch == 7:
main()
else:
print("\t\nInvalid choice !!!\n")

def check_ans(record, ans, score):


if record[6].lower() == ans.lower():
print(f"\tCongratulations !!! Correct Answer! \n\tYour score is {score + 1}!")
return True

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

cursor.execute("SELECT * FROM quiz_2023.results where result = 'f'")


for record in cursor:
failed += 1
cursor.execute("SELECT * FROM quiz_2023.results where result = 'p'")
for record in cursor:
passed += 1
results.append("Passed")
results.append("Failed")
numPlayers.append(passed)
numPlayers.append(failed)
plt.title('Quiz Results Statistics')
plt.xlabel('Result Type')
plt.ylabel('No. of players')
plt.bar(results, numPlayers)
plt.show()

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()

ch = int(input("\tSelect Your Option (1-7): "))


print()
if ch == 1:
print("\n\tADD A NEW QUESTION")
print("\t------------------")
create_question()
elif ch == 2:
print("\n\tDISPLAY ALL QUESTIONS")
print("\t--------------------")
display_all()

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

Screen-1: Welcome Screen

Screen-2: Insert new question

Page 15
Quiz Management System March 2024

Screen-3: Display All questions

Screen-4: Delete Question : Successful

Page 16
Quiz Management System March 2024

Screen-5: Delete Question : Un-Successful Update

Page 17
Quiz Management System March 2024

Screen-6: Modify Question : Successful Update

Page 18
Quiz Management System March 2024

Screen-7: Modify Question : Un-Successful Update

Screen-8: Quiz Result Table and Graph

Page 19
Quiz Management System March 2024

Screen-9: Entire Data

Table : Questions

Table : Results

Page 20
Quiz Management System March 2024

Bibliography
www.google.com

www.python.org.

www.geeksforgeeks.org

www.stackoveflow.com

Martin Brown and Martin C Brown, “Python: The Complete Reference”,Mc-Graw-Hill,2001

Page 21

You might also like