Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

ABSTRACT

ONLINE QUIZ SYSTEM is a web-based quiz system where quiz is given online, either
through the internet or internet using computer system. The main goal of this online quiz
system is to effectively evaluate the student thoroughly through a totally automated system
that not only reduce the required time but also obtain fast and accurate results.

ONLINE QUIZ SYSTEM is an online test simulator is to take online quiz, test in an
efficient manner and no time wasting for manually checking of the test paper. The main
objective of this web based online quiz system is to efficiently evaluate the student
thoroughly through a fully automated system that not only saves lot of time but also gives
fast and accurate results. For students they give papers according to their convenience from
any location by using internet and time and there is no need of using extra thing like paper,
pen etc.
TABLE OF CONTENTS

CHAP.NO TITLE PAGE.NO

1 INTRODUCTION 1
2 REQUIREMENT SPECIFICATION 2-4
3 DATABASE DESIGN 5-9
4 IMPLEMENTATION 10-16
5 SNAPSHOTS 17-19
6 CONCLUSION AND FUTURE
ENHANCEMENT 20
REFERENCE 21
Online Quiz System 2021-22

CHAPTER 1

INTRODUCTION
Online quiz System refers to service as conduct online quiz or test. It will use for students
progress evaluation using modern computer technology. It replaced the paperwork and
overcome the outcomes of traditional way of examinations using paper or pen. It is web
based platform can be used by Admin at any remote location. Online Quiz System is fully
developed automated system is to efficiently evaluate the candidate progress that not only
save the time of Examination Controller and also gives fast result.

1.1 Purpose and scope of the work


This application is developed for educational purposes, allowing the users to prepare the
multiple choice questions for different examinations conducted provincial at different
levels.

1.2 Scope of the work


Online quiz system can be used in private institutes as well as educational institution. As it
is user friendly web base application it can be used anywhere and anytime.

1.3 Importance
The quizzes help the student to learn with practice, as they allow students to think back to
the information previously learned and remember them while quizzing. With the practicing
quizzes, students can do critical thinking, and get into a habit of innovative learning.

Dept of CS&E Page | 1


Online Quiz System 2021-22

CHAPTER 2

REQUIREMENT SPECIFICATION
System requirements are the configuration that a system have in order for a hardware or
software application to run smoothly and efficiently. Failure to meet these requirements
can result in installation problems or performance problems or performance problems.the
former may prevent a device or application from getting installed, whereas the latter may
cause a product to malfunction or perform below expectation or even to hang or crash.

2.1 Functional requirements


A description of the facility or feature required. Functional requirements deal with what the
system should do or provide for users. They include description of the required functions,
outlines of associated reports or online queries, and details of data to be held in the system.

2.1.1 Interface Requirements


The system shall provide an option to add/delete quizzes with questions. The system shall
provide an option to see and attend the quizzes. The system should give option for login
for staffs and students. The system shall provide option to see scores.

2.2 Hardware and Software requirement


2.2.1 Hardware requirements

CPU: Pentium IV 2.4 GHz or above

Memory (Primary):512MB,1 GB OR above

Hard Disk: 40 GB,80 GB or above

Monitor:15 VGA color

2.2.2 Software requirements

Operating system: WINDOWS

Frontend: HTML, CSS, JavaScript

Dept of CS&E Page | 2


Online Quiz System 2021-22

Backend: PHP, MYSQL

PHP
PHP is Hypertext Pre-processor is a general-purpose programming language originally
designed for web development.

HTML
Hypertext Markup Language is the standard markup language for documents designed to
be displayed in a web browser. It can be assisted by technologies such as Cascading Style
Sheets and scripting languages such as JavaScript.

CSS
Cascading Style Sheets is a style sheet language used for describing the presentation of a
document written in a markup language like HTML. CSS is a cornerstone technology of
the World Wide Web, alongside HTML and JavaScript.

JavaScript

Java script, often abbreviated as JS, high-level, interpreted scripting language that conform
to the ECMAScript specification.Javasacript has curly-bracket syntax,dynamic,dynamic
typing, prototype-based object-orientation, and first-class functions.

MYSQL

MySQL is an open-source relational database management system. It is based on the


structure query language (SQL), which is used for adding, removing, and modifying
information in the database. Standard SQL commands, such as ADD, DROP, INSERT,
and UPDATE used in MySQL. MySQL used for a variety of applications but it usually
used on Web servers. A website that uses MySQL may include Web pages that access
information from a database.

2.3 Software Tools Used


VS CODE

Visual Studio Code is a lightweight but powerful source code editor which runs on your
desktop and is available for Windows, macOS and Linux. It comes with built-in support
for JavaScript, TypeScript and Node.js and has a rich ecosystem of extensions for other

Dept of CS&E Page | 3


Online Quiz System 2021-22

languages (such as C++, C#, Java, Python, PHP, Go) and runtimes (such as .NET and
Unity).

XAMPP

XAMPP is a cross-platform web server that is free and open-source. XAMPP is a short
form for Cross-Platform, Apache, MySQL, PHP, and Perl. XAMPP is a popular cross-
platform web server that allows programmers to write and test their code on a local
webserver. It includes MariaDB, Apache HTTP Server, and interpreters for PHP and Perl,
among other computer languages.

Dept of CS&E Page | 4


Online Quiz System 2021-22

CHAPTER 3
DATABASE DESIGN
Database design is the process of producing a detailed data model of database. This data
model contains all the needed logical and physical design choices and physical storage
parameters needed to generate a design in a data definition language, which can then used
to create a database. A fully attributed data model contains detailed attributes for each
entity.

3.1 ER Diagram
An entity-relationship model is a systematic way of describing and defining a business
process. An ER model is typically implemented as a database. The main component of ER
model is entity set and relationship set and attribute set.

Fig 3.1: ER Diagram for Online Quiz System

Dept of CS&E Page | 5


Online Quiz System 2021-22

3.2 Schema Diagram


It formulates all the constraints that are applied on the data. A database schema defines its
entities and the relationship among them. It contains a descriptive detail of the database. It
shows how data will be stored in a secondary storage.

Fig 3.2: Schema diagram for online quiz system

Dept of CS&E Page | 6


Online Quiz System 2021-22

Table 3.1:Relationships in Relational Schema

Entity Entity Relationship Description Ratios

Student Quizzes Take 1 student takes 1:N


N number of
quizzes
Student Score Check 1 student check 1:1
1 score
Staff Quizzes Create 1 staff create N 1:N
number of
quizzes
Staff Score View 1 staff view N 1:N
number of
scores
Quizzes Questions Contains 1 quiz contains 1:N
N number of
questions
Quizzes Score Store 1 quiz store 1 1:1
score

Student Table

Student has to log in to the system and can then view all the quizzes. Student can see the
quiz list and attend the quizzes. After attending the quizzes students will get instant result
and the same will be stored in the database.

Staff Table

Staff also has to log in to the system first, then they can add/remove quizzes. They can see
the progress and they can also update the existing quiz.

Quiz and Question Table

Staff can add, remove the quiz. And also they can add extra questions to an existing quiz.

Dept of CS&E Page | 7


Online Quiz System 2021-22

Score Table

Staff can see the scoreboard of the quiz which is added by him/her. And student can see the
score of the quiz which he/she is attended.

3.3 Design Constraints


Constraints are the rules that we can apply on the type of data in a table. That is, we can
specify the limit on the type of data that can be stored in a particular column in a table
using constraints.

The available constraints in SQL are:

NOT NULL: This constraint tells that we cannot store a null value in a column. That is,
if a column is specified as NOT NULL then we will not be able to store null in this
particular column any more.

UNIQUE: This constraint when specified with a column, tells that all the values in the
column must be unique. That is, the values in any row of a column must not be repeated.
Example:
UNIQUE KEY `qs` (`qs`)

PRIMARY KEY: A primary key is a field which can uniquely identify each row in a
table. And this constraint is used to specify a field in a table as primary key.
Example:
PRIMARY KEY (`mail`)
PRIMARY KEY (`slno`)
PRIMARY KEY (`dept_id`)

FOREIGN KEY: A Foreign key is a field which can uniquely identify each row in a
another table. And this constraint is used to specify a field as Foreign key.
Example:
ADD CONSTRAINT `quiz_ibfk_1` FOREIGN KEY (`mail`) REFERENCES `staff`
(`mail`) ON DELETE CASCADE;
ADD CONSTRAINT `score_ibfk_1` FOREIGN KEY (`quizid`) REFERENCES `quiz`
(`quizid`) ON DELETE CASCADE,

Dept of CS&E Page | 8


Online Quiz System 2021-22

ADD CONSTRAINT `score_ibfk_2` FOREIGN KEY (`mail`) REFERENCES `student`


(`mail`) ON DELETE CASCADE ON UPDATE CASCADE;

DEFAULT: This constraint specifies a default value for the column when no value is
specified by the user.
Example:
`date_created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP

Dept of CS&E Page | 9


Online Quiz System 2021-22

CHAPTER 4

IMPLEMENTATION
Implementation is a realization of technical specification or algorithm as a program,
software component, or other computer system through computer programming and
deployment Scripting languages used in project are HTML (Hyper Text Mark-up
Language), CSS (Cascading Style Sheets), PHP (Hypertext Pre-processor) are used to
create front end. Data was stored in local host server provided by XAMPP.

4.1 Table Design


The syntax of CREATE TABLE statement consists of the table name and column
descriptions in parenthesis. The primary key phrase is used to indicate the primary
key column.

CREATE TABLE questions(

qs varchar(200) NOT NULL,

op1 varchar(30) NOT NULL,

op2 varchar(30) NOT NULL,

op3 varchar(30) NOT NULL,

answer varchar(30) NOT NULL,

quizid int(11) NOT NULL,

UNIQUE KEY qs (qs),

KEY quizid (quizid),

KEY quizid_2 (quizid),

KEY quizid_3 (quizid)

);

Dept of CS&E Page | 10


Online Quiz System 2021-22

CREATE TABLE quiz(

quizid int(11) NOT NULL AUTO_INCREMENT,

quizname varchar(20) NOT NULL,

date_created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,

mail varchar(30) DEFAULT NULL,

PRIMARY KEY (quizid),

KEY mail(mail)

);

CREATE TABLE score(

slno int(11) NOT NULL AUTO_INCREMENT,

score int(11) NOT NULL,

quizid int(11) NOT NULL,

mail varchar(30) DEFAULT NULL,

totalscore int(11) DEFAULT NULL,

remark varchar(20) DEFAULT NULL,

PRIMARY KEY (slno),

KEY quizid (quizid),

KEY mail (mail)

);

CREATE TABL staff(

staffid varchar(10) NOT NULL,

name varchar(20) NOT NULL,

Dept of CS&E Page | 11


Online Quiz System 2021-22

mail varchar(30) NOT NULL,

phno varchar(10) NOT NULL,

gender varchar(1) NOT NULL,

DOB varchar(10) NOT NULL,

pw varchar(200) NOT NULL,

dept varchar(3) DEFAULT NULL,

PRIMARY KEY (`mail`),

UNIQUE KEY mail(mail,phno),

UNIQUE KEY staffid(staffid)

);

CREATE TABLE student(

usn varchar(10) NOT NULL,

name varchar(20) NOT NULL,

mail varchar(30) NOT NULL,

phno varchar(10) NOT NULL,

gender varchar(1) NOT NULL,

DOB varchar(10) NOT NULL,

pw varchar(200) NOT NULL,

dept varchar(3) DEFAULT NULL,

PRIMARY KEY (mail),

UNIQUE KEY mail (mail),

UNIQUE KEY phno(phno),

UNIQUE KEY usn(usn),

Dept of CS&E Page | 12


Online Quiz System 2021-22

KEY dept (dept)

);

ALTER TABLE `quiz`

ADD CONSTRAINT `quiz_ibfk_1` FOREIGN KEY (`mail`) REFERENCES `staff`


(`mail`) ON DELETE CASCADE;

ALTER TABLE `score`

ADD CONSTRAINT `score_ibfk_1` FOREIGN KEY (`quizid`) REFERENCES `quiz`


(`quizid`) ON DELETE CASCADE,

ADD CONSTRAINT `score_ibfk_2` FOREIGN KEY (`mail`) REFERENCES `student`


(`mail`) ON DELETE CASCADE ON UPDATE CASCADE;

4.2 Form Design


<form name="student" method="POST" style="width: 80vw;background-
color:#fff;"><br>

<h1 class="formname">Sign-Up as Student</h1><br><br>

<label for="name1">NAME</label><br>

<input type="text" name="name1" required><br><br>

<label for="usn">USN</label><br>

<input type="text" name="usn1" required><br><Br>

<label for="mail1">Email</label><br>

<input type="email" name="mail1" required><br><Br>

<label for="phno1">Ph No.</label><br>

<input type="tel" name="phno1" required><br><Br>

<label for="dept1">Department</label><br>

<select name="dept1" class="selc" required>

Dept of CS&E Page | 13


Online Quiz System 2021-22

<option value="CSE">CSE</option>

<option value="ISE">ISE</option>

<option value="ECE">ECE</option>

<option value="EEE">EEE</option>

</select><br><br>

<label for="dob1">DOB</label><br>

<input type="date" name="dob1" required><br><Br>

<label for="gender1">Gender</label><br>

<input type="radio" name="gender1" value="M" class="gen" required


style="height: 1vw !important;">MALE

<input type="radio" name="gender1" value="F" class="gen" required


style="height: 1vw !important;">FEMALE<br><Br>

<label for="password1">Password</label><br>

<input type="password" name="password1" required><br><Br>

<label for="cpassword1">Confirm Password</label><br>

<input type="password" name="cpassword1" required><br><Br>

<input type="submit" class="su" name="studsu" value="Sign-Up as


Student">

</form>

4.3 Trigger
Triggers are stored programs, which are automatically executed or fired when some event
occur. Triggers can be defined on the table, view, schema, or database with which the event
is associated.

Dept of CS&E Page | 14


Online Quiz System 2021-22

CREATE TRIGGER `remarks` BEFORE INSERT ON `score`

FOR EACH ROW BEGIN

IF NEW.score between 1 and 3 THEN

SET NEW.remark = 'bad';

ELSEIF NEW.score between 4 and 7 THEN

SET NEW.remark = 'average';

ELSEIF NEW.score between 8 and 10 THEN

SET NEW.remark = 'good'

END IF;

END

CREATE TRIGGER `ondeleteqs` AFTER DELETE ON `quiz`


FOR EACH ROW delete from questions where questions.quizid=old.quizid

4.4 Stored Procedure


Stored procedure is a prepared SQL code that can be saved and can be reused over and over
again. So if a query has to be written over and over again, instead of having to write that
query each time, it can be saved as a stored procedure and can be executed just by calling
the procedure.

DELIMITER $$

CREATE DEFINER=`root`@`localhost` PROCEDURE `leaderboard`()

select q.quizname,s.score,s.totalscore,st.name,s.mail

from score s,student st,quiz q

where s.mail=st.mail and q.quizid=s.quizid

order by score DESC$$

DELIMITER ;

Dept of CS&E Page | 15


Online Quiz System 2021-22

4.5 Database Access


<?php

$host='localhost';

$user='root';

$project='project';

$ps='';

?>

$conn = mysqli_connect($host, $user, $ps, $project);

if (!$conn) {

echo "<script>alert(\"Database error retry after some time !\")</script>";

Dept of CS&E Page | 16


Online Quiz System 2021-22

CHAPTER 5

SNAPSHOTS

Fig 5.1 :Home Page

Fig 5.2 :Signup page for Student

Dept of CS&E Page | 17


Online Quiz System 2021-22

Fig 5.3:Adding Quiz by Staff

Fig 5.4:Quiz taking by Student

Dept of CS&E Page | 18


Online Quiz System 2021-22

Fig 5.5 Leaderboard

Dept of CS&E Page | 19


Online Quiz System 2021-22

CHAPTER 6

CONCLUSION AND FUTURE ENHANCEMENT


The online examination system provides better functionality for an examination to be more
efficient and reduce manual paperwork in order to automate all possible tasks. The system
comprises of following features: Management of quiz, Automated grading, Adding/delete
quizzes and questions.

There are also few features which can be integrated with the system to make it more
flexible. The future points to be considered: Implementing the timer for the quiz, Sending
mails on sign up and when students takes quiz, Supporting all type of questions including
MCQ’s, Including Programming Questions where user can compile or interpret on site
only.

Dept of CS&E Page | 20


Online Quiz System 2021-22

REFERENCE
[1]Fundamentals of Database Systems, Ramez Elmasri and Shamkant B. Navathe, 7th
Edition, 2017, Pearson.
[2]Database management systems, Ramakrishnan, and Gehrke, 3rd Edition, 2014, McGraw
Hill
[3] https://www.campcodes.com/projects/php/
[4] https://developer.mozilla.org/en-US/docs/Web/javascript
[5] https://developer.mozilla.org/en-US/docs/Web/CSS

Dept of CS&E Page | 21

You might also like