THE SCHOLARS' HOME
Topic: JEE Question Bank and Quiz
Academic Year: 2025-26
Submitted By:
Name: Shrey Bansal (1218-NM) and
Prasham (1215-NM)
Class: XII - Non Medical
Subject: Computer Science
Subject Code: 083
Project Guide: Mrs. Pooja Arora
(HOD Computer Science)
Page: 1
Certificate
This is to certify that Shrey, a student of class
XII Non Medical has successfully completed
the project on the Topic: JEE Question Bank
and quiz, under the guidance of Mrs. Pooja
Arora during the year 2025-26 in partial
fulfillment of Computer Science practical
examination conducted by CBSE.
Signature of Signature of Signature of
External Principal Internal
Examiner Examiner
Page: 2
Certificate
This is to certify that Prasham, a student of class
XII Non Medical has successfully completed
the project on the Topic: JEE Question Bank
and quiz, under the guidance of Mrs. Pooja
Arora during the year 2025-26 in partial
fulfillment of Computer Science practical
examination conducted by CBSE.
Signature of Signature of Signature of
External Principal Internal
Examiner Examiner
Page: 3
Acknowledgement
I would like to thanks my Computer Science
teacher, Mrs. Pooja Arora for guiding me
throughout this project work. I would also
wish to thank my parents for their support
whenever required. I also cannot forget to
thank my friends who helped me to finish
this project within the timeframe.
Finally, I would wish to thank everyone
involved during this project work.
Page: 4
Contents
S. No. Descriptions Page No.
1 Introduction 6
2 Objective 7
Hardware and Software
3 8
Requirements
4 Source Code 9-20
5 Database 21-22
6 Output 23-28
7 Bibliography 29
8 Teacher's Remarks 29
Page: 5
Introduction
The JEE Question Bank & Quiz Manager is a
Python–MySQL project that helps students
practice JEE questions in Physics, Chemistry,
and Mathematics. It allows users to add, view,
update, and delete questions, and also take
quizzes with automatic scoring. The quiz
follows the JEE pattern of +4 for correct and –
1 for wrong answers. All results are stored in
the MySQL database, making it easy to track
student performance.
Page: 6
Objective
• To create a Python–MySQL-based
quiz application for JEE preparation.
• To manage questions efficiently
using database operations.
• To automatically store student
performance after each quiz.
• To develop logical and database
management skills among
students.
• To make learning interactive and
engaging using technology.
Page: 7
Hardware and Software
Requirements
Hardware Requirements
• Processor: Intel i3 or higher
• RAM: Minimum 4 GB
• Hard Disk: 500 MB free space
• Keyboard & Mouse
Software Requirements
• Operating System: Windows 10 / 11
• Python Version: 3.8 or above
• MySQL Server 8.0
• MySQL Connector for Python
• IDE: IDLE / PyCharm / VS Code
Page: 8
SOURCE
CODE
Page: 9
SQL
CREATE DATABASE jee_project;
USE jee_project;
CREATE TABLE questions (
qid INT AUTO_INCREMENT PRIMARY KEY,
subject VARCHAR(50),
question TEXT,
opt1 VARCHAR(255),
opt2 VARCHAR(255),
opt3 VARCHAR(255),
opt4 VARCHAR(255),
correct INT);
CREATE TABLE results
( student
VARCHAR(100), score
INT,
total INT, percentage
FLOAT, taken_on
DATE);
Page: 10
PYTHON
import [Link]
from datetime import date
con =
[Link]( ho
st="localhost", user="root",
password="Shrey@12345",
database="jee_project"
)
cursor = [Link]()
# ADD QUESTION
def add_question():
subject = input("Subject: ")
question = input("Question: ")
opt1 = input("Option 1: ")
opt2 = input("Option 2: ")
opt3 = input("Option 3: ")
Page: 11
opt4 = input("Option 4: ")
correct = int(input("Correct option (1-4): "))
[Link]( "I
NSERT INTO
questions(subject,question,opt1,opt2,opt3,opt4,corre
ct) VALUES(%s,%s,%s,%s,%s,%s,%s)",
(subject, question, opt1, opt2, opt3, opt4,
correct)
)
[Link]()
print("Question Added!\n")
# -------------- DISPLAY QUESTIONS ---------------
def display_questions():
print("\n1. All Questions")
print("2. Physics")
print("3. Chemistry")
print("4. Maths")
ch = input("Choice: ")
Page: 12
if ch == "1":
[Link]("SELECT * FROM questions")
elif ch == "2":
[Link]("SELECT * FROM questions
WHERE subject='Physics'")
elif ch == "3":
[Link]("SELECT * FROM questions
WHERE subject='Chemistry'")
elif ch == "4":
[Link]("SELECT * FROM questions
WHERE subject='Maths'")
else:
print("Invalid selection!")
return
for r in [Link]():
print(r)
# UPDATE QUESTION
def update_question():
qid = input("Enter QID: ")
Page: 13
print("What do you want to update?")
print("1. Subject")
print("2. Question
Text") print("3. Option
1")
print("4. Option 2")
print("5. Option 3")
print("6. Option 4")
print("7. Correct Option (1/2/3/4)")
choice = input("Choice: ")
fields = {
"1": "subject",
"2": "question",
"3": "opt1",
"4": "opt2",
"5": "opt3",
"6": "opt4",
"7": "correct"
}
Page: 14
if choice not in fields:
print("Invalid choice!")
return
new_value = input("Enter new value: ")
[Link](f"UPDATE questions SET
{fields[choice]}=%s WHERE qid=%s", (new_value,
qid))
[Link]() print("Updated!\
n")
# DELETE QUESTION
def delete_question():
qid = input("Enter QID to delete: ")
[Link]("DELETE FROM questions
WHERE qid=%s", (qid,))
[Link]() print("Deleted!\
n")
# VIEW RESULTS
Page: 15
def view_results():
[Link]("SELECT student, score, total,
percentage, taken_on FROM results ORDER BY
percentage DESC")
rows = [Link]()
print("----- RESULTS (Highest to Lowest)-----")
for r in rows:
print(r)
print()
# QUIZ
def quiz(student_name):
print("1. Physics")
print("2. Chemistry")
print("3. Maths")
print("4. Random (All Subjects)")
ch = input("Choice: ")
qcount = int(input("How many questions do you
want to attempt? "))
Page: 16
if ch == "1":
[Link]("SELECT * FROM questions
WHERE subject='Physics' ORDER BY RAND()
LIMIT %s", (qcount,))
elif ch == "2":
[Link]("SELECT * FROM questions
WHERE subject='Chemistry' ORDER BY RAND()
LIMIT %s", (qcount,))
elif ch == "3":
[Link]("SELECT * FROM questions
WHERE subject='Maths' ORDER BY RAND()
LIMIT %s", (qcount,))
elif ch == "4":
[Link]("SELECT * FROM questions
ORDER BY RAND() LIMIT %s", (qcount,))
else:
print("Invalid choice!")
return
data = [Link]()
score = 0
Page: 17
for q in data:
print("Q", q[0], "(", q[1], ")")
print(q[2])
print("1:", q[3])
print("2:", q[4])
print("3:", q[5])
print("4:", q[6])
ans = input("Your choice (1-4): ")
if ans == str(q[7]):
print("Correct! +4")
score += 4
else:
print("Wrong! -1")
score -= 1
total = qcount * 4
percentage = (score / total) * 100
print("Final Score:", score, "/", total)
print("Percentage:", round(percentage, 2), "%")
Page: 18
[Link]("INSERT INTO
results(student,score,total,percentage,taken_on)
VALUES(%s,%s,%s,%s,%s)",(student_name, score,
total, percentage, [Link]()))
[Link]()
print("Result Saved!\n")
# MENU
while True:
print("""
==== JEE QUESTION BANK SYSTEM ====
1. Add Question
2. Display Questions
3. Update Question
4. Delete Question
5. Take Quiz
6. View Results
7. Exit
""")
c = input("Choice: ")
Page: 19
if c == "1":
add_question()
elif c == "2":
display_questions()
elif c == "3":
update_question()
elif c == "4":
delete_question()
elif c == "5":
name = input("Enter your name: ")
quiz(name)
elif c == "6":
view_results()
elif c == "7":
break
else:
print("Invalid choice!\n")
Page: 20
DATABASE
Page: 21
Page: 22
OUTPUT
Page: 23
Page: 24
Page: 25
Page: 26
Page: 27
Page: 28
Bibliography
• [Link] (Official Documentation)
• [Link] (Official MySQL Docs)
• W3Schools – Python MySQL Tutorial
• NCERT & JEE Reference Books
• Online learning resources and tutorials
Teacher's Remarks
Page: 29