CBSE 2026 results are out, Mukul scored a perfect 100/100 in Computer ScienceSee all toppers →

KwickAcademy Course Topics · 6 min · free

Case Study - Online Quiz

6 min1 KwickClipsFull text belowFree
Next lesson →Kajal Ma'am (MCA), teaching since 2004Remembered in this browser

This case study designs an online quiz: roles, requirements, Questions and Attempts tables, quiz flow, marking and fair play.

Follows the syllabus of: CBSE Class 12 Information Technology (802)

On screen in this lesson

The problem

Teachers add MCQ questions with answers
Students log in and take a timed quiz
The system marks answers automatically
Results shown to the student and teacher

Users and what they do

UserCan do
AdminAdds teachers
TeacherQuiz, marks
StudentTakes quiz, result

Requirements

TypeRequirement
FunctionalLogin by role
FunctionalTimer auto-submits
FunctionalAuto marking
Non-functional200 users at once
Non-functionalAnswers kept secret

Table: Questions

FieldTypeNote
q_idINTPrimary key
quiz_idINTForeign key
questionVARCHAR(300)The question
opt_a to opt_dVARCHAR(100)Four options
correctCHAR(1)A, B, C or D

Table: Attempts

FieldTypeNote
attempt_idINTPrimary key
student_idINTForeign key
quiz_idINTForeign key
scoreINTMarks scored
submittedDATETIMESubmit time

Marking scheme

AnswerMarks
Correct+4
Wrong-1
Not attempted0

Quick answers

Aman gets 7 correct, 2 wrong, 1 blank at +4, -1, 0. Score?

26.

Why is the timer checked on the server?

To keep the quiz fair.

KwickClips from this lesson

Short clips, one idea each. Good for revision the night before.

The full lesson, in text

Hello students, welcome to Kwickprep. Your teacher wants a quiz that marks itself and shows results instantly. How would you build it? Today we will study a complete online quiz application, from the problem and requirements to the database, logic and testing.

Here is our case. A school wants an online quiz for class tests. Teachers add multiple choice questions, each with four options and one correct answer. Students log in and take the quiz within a fixed time. The system checks the answers automatically, so no manual checking is needed. Results are shown to the student at once and stored for the teacher.

The quiz has three kinds of users, and each has different rights. The admin creates teacher accounts and classes. The teacher adds questions, creates quizzes and views everyone's marks. The student can only take the quiz and see his or her own result, not other students' answers.

Now the requirements. Functional requirements say what the system must do, and first, every user logs in and sees only the pages for their role. Second, a timer runs, and the quiz is submitted on its own when time is up. Third, answers are marked automatically. Non-functional requirements say how well it works, so the system should handle about two hundred students at the same time. And the correct answers must never be sent to the student's browser before submission.

Let us design the database, starting with the Questions table. Q ID is the primary key, a unique number for each question. Quiz ID is a foreign key that links the question to one quiz. The question field stores the question text. Option a to option d are four fields that store the four choices. Correct stores one letter, the right option, and it stays on the server.

The Attempts table stores one row each time a student takes a quiz. Attempt ID is the primary key. Student ID links the attempt to the student who took it. Quiz ID links it to the quiz that was taken. Score stores the marks the student scored. Submitted stores the date and time of submission, which helps teachers see late or early submissions.

Let us trace the quiz as a flowchart. The student logs in with a username and password. The student starts the quiz, and the timer begins. The system shows a question and records the chosen answer. It asks, is there time left? If yes, the student repeats this for each question. If no, the server marks all the answers. After marking, the score and the correct answers are shown to the student.

Our teacher chooses a marking scheme with negative marking. A correct answer gives plus four marks. A wrong answer takes away one mark, so guessing is risky. A question left unanswered gives zero marks. The server calculates this, never the browser, so nobody can change their own score.

Pause and predict. The quiz has ten questions with the same marking scheme. Aman gets seven correct, two wrong, and leaves one blank. What is his score? Seven correct give twenty eight, two wrong take away two, and the blank gives zero. So Aman scores twenty six out of forty.

The teacher sees class results using a simple SQL query. It selects the student ID and score from the Attempts table. The where clause keeps only the attempts for quiz number five. Order by score, descending, lists the highest score first, like a merit list.

A quiz is useful only if it is fair. Shuffle the order of questions and options, so neighbours cannot simply copy. Allow only one attempt per student, by checking the Attempts table before starting. Check the time on the server, because a student can change the clock on a phone. And show the correct answers only after the quiz is submitted.

Before launch, we check planned test cases. If all ten answers are correct, the score must be forty. If time runs out without a submit click, the quiz must be submitted automatically. If a student tries to start the same quiz again, it must be blocked. If a student opens a teacher page, the system must deny access.

Let us revise this case study. The quiz has three roles, admin, teacher and student, each with different rights. The Questions and Attempts tables store the data, linked by keys. The flow is login, start the timer, answer, submit and mark. Marks are calculated on the server, with plus four, minus one and zero. And the quiz stays fair with shuffling, one attempt and a server side timer.

Courses that teach this

CourseUnit
CBSE Class 12 Information Technology (802)Operating Web Based Applications

Voice-over in this lesson is AI-generated. The script is written and checked by Kajal Ma'am. Boards can revise a syllabus mid-year, so confirm anything you plan around against the official board circular. Keep your passwords, OTPs and ID numbers to yourself — we never ask for them. To reach Kajal Ma'am, use the WhatsApp button; sharing your number there is how we call you back.

Free to watch, no sign-up. Live classes with Kajal Ma'am are the paid course; these lessons stay free either way.

Want a plan that actually fits your board dates?

Ask Kajal Ma'am directly, 20+ years teaching computer science. Free demo class first, no payment.

Talk to Kajal Ma'am on WhatsApp

Or see the Class 12 Computer Science course →

Studying outside India?

We coach CBSE, IGCSE & international students across the globe, one-to-one, in your local time zone.

Visit International →