0% found this document useful (0 votes)
4 views39 pages

Quiz Master

Quiz Master

Uploaded by

gungun cybercafe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views39 pages

Quiz Master

Quiz Master

Uploaded by

gungun cybercafe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 39

QUIZMASTER

MADE BY:Mohd Farzam


CERTIFICATE

CLASS:XII A YEAR:2024-2025

THIS IS TO CERTIFY THAT INVESTIGATORY


PROJECT IS SUCCESSFULLY COMPLETED BY Mohd
Farzam OF CLASS XIIA FOR THE ACADEMIC YEAR
2024-2025 IN THE SCHOOL COMPUTER LAB

HEAD TEACHER EXTERNAL


EXAMINER INTERNALEXAMINER SIGNATURE

(SUBJECTTEACHER)
DEPARTMENTOFCOMPUTERSCIENCE
ACKNOWLEDGEMENT

I Mohd Farzam OF CLASS XIIA WOULD


LIKE TO EXPRESS MY SINCERE GRATITUDETO
MY COMPUTER SCIENCE TEACHER MR.ABDUL
HADI,PGT COMPUTER SCIENCE, FOR HIS
VITAL SUPPORT, GUIDANCE,AND
ENCOURAGEMENT WITHOUT WHICH THIS
PROJECT WOULD NOT HAVE COME FORTH.
I WOULD ALSO LIKE TO EXPRESS MY
GRATITUDE TO MY SCHOOL BROWNWOOD
PUBLIC SCHOOL FOR LETTING ME USE THE
SCHOOL LABORATORY.
I NDEX
❖ BRIEF OVER VIEW OF PROJECT

❖ SOFTWARE AND
HARDWARE REQUIREMENTS

❖ ADVANTAGES OF PROJECT
❖ SOURCE CODE IN PYTHON

❖ OUTPUT SCREEN

❖ BIBLIOGRAPHY
BriefOverviewOFProject
Quizmasterisbasedonpopularrealityquiz
showswhereaplayerhastoanswersome
questionsbasedonvariousthemes.Theplayer
getstochoosethecorrectanswerfromfour
differentsetsofoptions.Iftheplayerchooses
therightoptionhegetsonepointandproceeds.
Iftheoptionwaswrongnopointswillbe
allotted. Quiz Competitions are other
events
wheresimilarmechanismisused.Programmi
ng language used for this projects are
python and
MySQL.Wholeprogramisonpythonwhereas
databaseisstoredonMySQLserverdatabase
.
Uponrunningtheprogram,Playerhastoenter
his/her name followed by starting the
quiz. At
theendtotalpointsscoredbytheplayerare
shown.SimilarmechanismcanbeseeninQui
z competitions too. Whether it be of
school level orregionallevel.
NeedOfComputerization
The use of computerized quizzes is highly
recommended for any instructor teaching
a course that is either large in size(with a
typical lecture format)or that requires
that students to
engageinasignificantamountofassigned
readings. Students appear to benefit from
the useofsuchcomputerizedquizzesasthey
becomeactivelyengagedinthecoursemater
ial and study with greater frequency
throughout the semester Computerized
settings can be
designed to provide students with
immediate
feedbackregardingtheirquizgrades,andallo
w themtotakeeachquizmorethanonceto
provide greater mastery of the material. It
may
behelpfultolimitthenumberofquizattemp
ts to three. Automatic, computerized
grading and
entryofeachstudent’shighestquizgradesint
o the course gradebook will generate
significant
timesavingsfortheinstructor,andprovide
studentswithimmediatefeedbackontheirqu
iz performance.
SoftwareANDHardwareRequirements

#SOFTWARESPECIFICATION
Operating
System:Window
s 10/8/7
Platform:PythonIDLE3.7/3.8
Database:MySQLLanguages:
Python

#HARDWARESPECIFICATION
Processor:Dualcoreorabove
HardDisk:40GB
RAM:1024MB
Advantages of Project
Present day everything is virtually
presented. Quiz master is very simple yet
has attractive interface which makes quiz
completions easier and more
enjoyable.Specific recommendations for
the use of Quiz Master can be made
including:
•To encourage students to engage in
long-term learning, include some of the
individual online quiz questions on mid
term and final exams
•To deter student cheating,the order
of quiz questions as well as their
multiple choice
Answers is randomized.
•User friendly
•Responsive design
•Automatically checks answers
•It saves paper
•Publishes score instantaneously
after quiz ends.
#SOURCE CODE IN PYTHON

importsys
importmysql.connector
import random
mydb=mysql.connector.connect(host= "localh
ost"
,user="root",\passwd="root",database="quiz")
mycursor=mydb.cursor()
defHome():
f=1
whilef!=3:
print("WelcometoQuiz")print("******************
**") print("1. Enter Questions")
print("2.TakeQuiz")
print("3. Exit")
f=int(input("Enteryourchoice:
")) if f==1:
Question(
) elif
f==2:
Quiz()
eliff==
3:
print("ExitingtheQuiz")
mycursor.close()
mydb.close()
sys.exit();
else:
Home()
defQuestion():
ch='Y'
while ch=='Y' or ch=='y':
print("Welcome to Question
Portal")
print("***********************")
q=input("Enter the question :")
op1=input("Enter the option
1 :") op2=input("Enter the
option 2 :") op3=input("Enter
the option 3 :")
op4=input("Enter the option
4 :")
ans=0whileans==0:
op=int(input("Which option is
correct answer
(1,2,3,4) :"))
if op==1:
ans=op1
elifop==
2:
ans=op2
elifop==
3:
ans=op3
elifop==
4:
ans=op
4 else:
print("Pleasechoosethecorrectoptionasanswe
r") mycursor.execute("Select * from
question") data=mycursor.fetchall()
qid=(mycursor.rowcount)+1
mycursor.execute("Insert into
question
values(%s,%s,%s,%s,%s,%s,%s)",
(qid,q,op1,op2,op3,op4,ans))
mydb.commit()
ch=input("Questionaddedsuccessfully..Doyo
uwant to add more (Y/N)")
Home()
defQuiz()
:
print("Welcome to Quiz portal")
print("***********************")
mycursor.execute("Select * from
question")
data=mycursor.fetchall()name=input
("Enter your name :")
rc=mycursor.rowcount
noq=int(input("Enterthenumberofquestionstoat
tempt (max %s):"%rc))
l=[]
while len(l)!=noq:
x=random.randint(1,
rc) if l.count(x)>0:
l.remove(
x) else:
l.append(x)
print("Quizhasstarted")
c=1
score=0
foriin range(0,len(l)):
mycursor.execute("Select*fromquestionwhereq
id=%s",(l[i],))
ques=mycursor.fetchone()
print("
")
print("Q.",c,":
",ques[1],"\nA.",ques[2],"\t\tB.",ques[3],"\
nC.",ques[4]
,"\t\tD.",ques[5])
print("
")
c+=1
ans=None
while ans==None:
choice=input("Answer(A,B,C,D)
:") if choice=='A' or
choice=='a': ans=ques[2]
elifchoice=='B'orchoice=='b'
: ans=ques[3]
elifchoice=='C'orchoice=='c':
ans=ques[4]
elifchoice=='D'orchoice=='d
': ans=ques[5]
else:
print("KindlyselectA,B,C,Dasoptiononly
") if ans==ques[6]:
print("Correc
t")
score=score
+1 else:
print("Incorrect..Correctansweris:",ques[6])
print("Quizhasended!!Yourfinalscoreis:",score)
input("Press any key to continue") Home()

Home()

#OUTPUTSCREEN
#MYSQLTABLE
#LIMITATIONS
•Needtoaddquestionsflrstbeforeplaying
quiz.
•Nopermanentscoreboard
importsysimport mysql.connector
import random
mydb=mysql.connector.connect(h
ost= "localhost" ,user= "root",\
passwd="root",database="quiz")
mycursor=mydb.cursor() def
Home():f=1whilef!=3:
print("Welcome to Quiz")
print("********************") print("1.
Enter Questions")
print("2.TakeQuiz")print("3. Exit")
f=int(input("Enter your
choice:"))iff==1:Question()elif f==2:
Quiz() elif f==3: print("Exiting the
Quiz") mycursor.close()
mydb.close()sys.exit();else: Home()
def Question(): ch='Y'
whilech=='Y'orch=='y':
print("Welcome to Question Portal")
print("***********************")
q=input("Enter the question :")
op1=input("Enter the option 1 :")
op2=input("Enter the option 2 :")
op3=input("Enter the option 3 :")
op4=input("Enter the option 4 :")
ans=0whileans==0:
op=int(input("Which option is
correctanswer(1,2,3,4):"))if
op==1:ans=op1elifop==2:
ans=op2elifop==3:ans=op3elif
op==4: ans=op4 else:
print("Pleasechoosethecorrectoptiona
s answer")
mycursor.execute("Select*from
question") data=mycursor.fetchall()
qid= (mycursor.rowcount)+1
mycursor.execute("Insertinto
question values (%s,%s,%s,%s,%s,
%s,%s)",
(qid,q,op1,op2,op3,op4,ans))
mydb.commit() ch=input("Question
added
successfully..Doyouwanttoadd more
(Y/N)") Home() def Quiz():
print("Welcome to Quiz portal")
print("***********************")
mycursor.execute("Select*from
question") data=mycursor.fetchall()
name=input("Enter your name :")
rc=mycursor.rowcount
noq=int(input("Enter the number of
questions to attempt (max
%s):"%rc)) l=[] while len(l)!=noq:
x=random.randint(1,rc) if
l.count(x)>0:l.remove(x)else:
l.append(x) print("Quiz has
started")c=1score=0foriin
range(0,len(l)):
mycursor.execute("Select*from
questionwhereqid=%s",(l[i],))
ques=mycursor.fetchone()print("-
-------------------------------------------
-------------------------------------------
-----")print("Q.",c,":
",ques[1],"\nA.",ques[2],"\t\tB.",que
s[3],"\nC.",ques[4],"\t\tD.",ques[5])
print("-----------------------------------
-------------------------------------------
--------------")c+=1ans=Nonewhile
ans==None:
choice=input("Answer(A,B,C,D):")ifch
oice=='A'or
choice=='a':ans=ques[2]elif
choice=='B'orchoice=='b':
ans=ques[3]elifchoice=='C'or
choice=='c':ans=ques[4]elif
choice=='D'orchoice=='d':
ans=ques[5] else: print("Kindly
selectA,B,C,Dasoptiononly")if
ans==ques[6]: print("Correct")
score=score+1 else: print("Incorrect..
Correct answer
is:",ques[6])print("Quizhasended
!!Yourflnalscoreis:",score)
input("Pressanykeytocontinue")
Home()Home()#OUTPUTSCREEN

You might also like