0% found this document useful (0 votes)
46 views

Quizz Final (1) Merged

Uploaded by

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

Quizz Final (1) Merged

Uploaded by

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

ABSTRACT

The project: “Quiz Application” is a collection of number of different types of quizzes like
technical, games, sports, etc. A user can access/play all of the quiz and can attempt any ofthe
one. There will be limited number of questions and for each correct answer user will get a
credit score. User can see answers as well as can ask a query related to it. There are many quiz
applications available currently on internet. But there are few Which provide better
understanding between users and the application like, providing proper answers, user query
solving, uploading user questions as well as answer to it, etc.

To develop a user friendly quiz application which will contain : Numbers of quiz , Answers to
every question, Query solving regarding any question, Uploading of user question and answer,
and to improve the knowledge level of users. To develop an application which will contain
solution to the above problems. By this application the user will come to know about his/her
level and can learn additional knowledge. Also by this application a user can expand his/her
knowledge among the world.

i
CONTENTS

Chapter No CHAPTER NAME Page No


1 INTRODUCTION 1-2
1.1 OBJECTIVES
1.2 PROBLEM STATEMENT/ PROBLEM DEFINITION
1.3 EXISTING SYSTEM
1.4 PROPOSED SYSTEM
2 LITERATURE SURVEY 3-4
3 SOFTWARE AND HARDWARE REQUIREMENT 5
3.1 SOFTWARE REQUIREMENT
3.2 HARDWARE REQUIREMENT
4 SYSTEM DESIGN 6-7
4.1 SYSTEM ARCHITECTURE
5 IMPLEMENTATION 8-23
5.1 ALGORITHMS
6 SOFTWARE TESTING 24-27
6.1 TESTING METHODS
6.1.1 BLACK-BOX TESTING
6.1.2 WHITE-BOX TESTING
6.2 LEVELS OF TESTING
6.2.1 UNIT TESTING
6.2.2 INTEGRATION TESTING
6.2.3 SYSTEM TESTING
7 RESULTS AND SNAPSHOTS 28-29
8 ADVANTAGES AND APPLICATIONS 30
9 CONCLUSION AND FUTURE ENHANCEMENT 31
REFERENCES 32
QUIZ APPLICATION 2023-2024

CHAPTER 1

INTRODUCTION
1.1 Objective
The main objective of “Quiz Application” is to facilitate a user friendly environment for all
users and reduces the manual effort. In past days quiz is conducted manually but in further
resolution of the technology we are able to generate the score and pose the queries
automatically. The functional requirements include creating users that are going to participate
in the quiz, automatic score and report generation and administrative tasks like add, delete,
update for admin privilege users. In this application, all the permissions lies with the
administrator i.e., specifying the details of the quiz with checking result will show to
interviewee or not, addition of question and answers, marks for each question, Set timer for
each quiz and generate report with score for each quiz.

Functionalities provided by MCQ Quiz Application are as follows:


• Provides the searching facilities based on various factors. Such as Students, Marks,
Courses, Papers
• MCQ Quiz Application also manage the Results details online for Courses details,
Papers details, Students.
• It tracks all the information of Examinations, Results, Courses ect.
• Manage the information of Examinations Students, Marks.

1.2 Problem Definition


"Our aim is to develop a application for the users in which a user can attempt any number of
quiz related to his/her choice." Firstly, we have to make interfaces for Home Page, Registration,
Login Page, Questions Attempting forum, Result Page, & Profile of user. These all pages have
connectivity with the server and database. So, that it can work properly. Currently, there are
websites which only provide limited number of quizzes related to different domain. Many
websites do not have a single platform for quizzes related to technical, G.K, Aptitude, Games,
etc. And there is not a website where the users can upload his/her questions and answers for
the others. We have to develop a application which can resolve all of the above problems. By
this user can gain knowledge, can solve his/her query, and spread his/her knowledge
among the world.

1|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

1.3 Existing System


There are so many Projects are available on Quiz Application . There are as follow
Combining trivia and a social network, Quiz Up invites you to choose from more than 1,200
topics, take part in challenges and illustrated quizzes and post about your interests. You can
play against friends or go up against millions of the platform‟s users. Suitable for all the family,
this game sees players guess words/names/titles, which may include celebrities, characters,
movies, books and songs, which are described or acted out by their friends. Just think of it as
charades for the smartphone generation. The classic game which captured the hearts of
audiences worldwide is now available on mobile, meaning you can relive the nail-biting build
up as you bid to become a (virtual) millionaire. Features include 50:50, ask the Audience and
Ask the Expert. You can play against friends and family too.

1.4 Proposed System


Unlike the other Application where you need to make account for every quiz you want to
play. but using this application, you just have to login by user name and password and then
you will get access to all quizzes from it. The proposed system is an application will help in
improving the knowledge and accuracy.The aim of proposed system is to develop a system
of improved facilities. The proposed system can overcome all the limitations of the existing
system. The system provides proper security and reduces the manual work. Security of data,
Ensure data accuracy's, Proper control of the higher officials, Minimize manual data entry
,Minimum time needed for the various processing ,Greater efficiency, Better service, User
friendliness and interactive. Minimum time required. The existing quiz application
management systems typically encompass a structured approach to managing quiz and
questions operations, client interactions, and administrative tasks. These systems leverage
Java's object-oriented capabilities to model entities such as quiz question, answers and
whether the answer is correct or not.They often integrate with relational databases for
persistent data storage and retrieval, ensuring scalability and reliability. Functionally, these
systems enable functionalities such as rules for MCQ ,certain time for the question, attending
next question and administrative controls.

2|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 2
LITERATURE SURVEY

Web in simple terms means a network of Internet servers that are ready to support some
formatted documents and can be accessed by a web browser. About these formatted documents
these are formatted in HTML (Hypertext mark-up language). Not these formatted documents
create their links to their type but they also support links to some documents including video,
graphics and audio files. Terms Web and Internet are interchangeably used but they are not
same. While Internet refers to global network of servers that makes sharing of information,
Web is the collection of information being accessed via Internet. Also, we can say that Web is
a service and Internet is an infrastructure where web is a service on top of it.

Alternatively, we can say Web is just a portion of the Internet. Particularly whenever a client
surfing web makes a request to web server, it first find resources and then sends some return
response in HTML to the browser and a web browser know how to display them to client. Web
pages are the documents written in HTML which provides meaning and some structure to any
web content and collection of these web pages is called a website which consists of static files.
A web application however is same as a website but with dynamic functionality like where
user can manipulate the restricted data. A website seems to be too informational while a web
application is interactive. User spend more of its time reading, listening or viewing a website
but in a web application like social media applications where user spend a lot of interaction or
banking application that performs 13 transactions on customer’s input. Authentication can also
be a point of difference between website and web application.

Since in a web application, interaction of user is high and manipulation of data is there,
therefore user accounts must be secured in order to prevent unauthorized access and any
leakage of sensitive data. Most of the web application requires authentication but for the
informational websites it is not obligatory. An example for this can be that while reading any
news or article you don’t need to go through any authentication process but to comment on it
that includes interaction you have to go through a log in process. HTTP which is Hypertext
Transfer Protocol is a set of protocols that is used by clients and servers to communicate on
web. to deliver data which includes HTML files, image files, query results, etc. on the World
3|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

Wide Web. HTTP is the foundation of data communication for the World Wide Web since
1990. HTTP represents Hyper Text Transfer Protocol.

WWW is about correspondence between web customers and servers. Communication between
customer PCs and web servers is finished by sending HTTP Requests and accepting HTTP
Responses A client (a program or browser) sends a HTTP request to the web .A web server
gets the solicitation .The server runs an application to process the request . The server restores
an HTTP response.The client gets the response.
HTTP is a simple and powerful protocol because: Connectionless: 14 An HTTP client which
might be a browser will initiate an HTTP request to the server. The server processes the request
and sends a response back after which client disconnect the connection. In this way we can say
that client and server only know about each other only during the current request is initiated
and response is received. For further requests new connection is made like client and server
are new to each other .
Media Independent: It means, any type of data can be sent by HTTP as long as both the client
and the server know how to handle the data content. Stateless Protocol: By Stateless Protocols
we mean the type of network protocols in which Client send request to the server and server
response back according to current state.
For the execution of server response, it does not require the server to retain session information
or a status about each other. Some examples of Stateless Protocol are HTTP (Hypertext
Transfer Protocol), UDP (User Datagram Protocol), DNS (Domain Name System) As HTTP
is connectionless and it is because HTTP is a stateless protocol. Each command is executed
independently, without any knowledge of the commands that came before it. The server and
client are known about each other only during a particular request.
After execution of that request/response both of them forget each other. technology which
resides on the server side and is used to create web application. Because of the Java language
it is robust and scalable. It is also an API which provides many different classes as well as
interfaces.
The most important feature of servlet is that it extends capabilities of the server thus creating
dynamic web pages. They are also able to handle complex requests that is obtained from the
web server. Finally, the web browser handles the dynamically-generated HTML page inside
the HTTP response and we see the output exactly as if it was a static page.

4|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 3
SOFTWARE AND HARDWARE REQUIREMENT
3.1 Software Requirement
Aside from a Computer and internet connection, most of the tools you need to build an
Application are Software Program. Some of which may already be on your computer.
• Operating System Front End Back End Server Documentation : Windows 10
• Frontend Software: Java NetBeans 8.2 : JDK 8
• Backend Software: MySQL

S.NO NAME SOFTWARE

1. Platform Windows 7

2. Language Used Net beans

3. Database tool MySQL

3.2 Hardware Requirement


Most current Computers and Laptop have enough specifications to be used to create an
Application. The most important specification to check on the computer would be the size of
the RAM, which should be over 2 GB, more is better. This will ensure that the computer runs
quickly and smoothly, even with heavier programs. The computer should have a keyboard and
mouse attached and working as well.
• Computer Processor Core i3 Processor Speed 2.3 GHz Processor
• Hard Disk 400 GB
• RAM Minimum 2GB

S.NO NAME HARDWARE

1. Processor Intel dual core (32 bit)

2. RAM 2 GB

3. Processor Speed 2 GHz

5|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 4
SYSTEM DESIGN
This phase, a logical system is built which fulfils the given requirements. Design phase of
software development deals with transforming the clients's requirements into a logically
working system. Normally, design is performed in the following in the following two steps:

Primary Design Phase:


• In this phase, the system is designed at block level. The blocks are created on the basis
of analysis done in the problem identification phase. Different blocks are created for
different functions emphasis is put on minimising the information flow between blocks.
Thus, all activities which require more interaction are kept in one block.
Secondary Design Phase:
• In the secondary phase the detailed design of every block is performed.

4.1 System Architecture


well-define interface, the Three- tier architecture is intended to allow any of the three tier to be
upgraded or replace independently in response to changes in requirements or technology. For
example, a change of operating system in the presentation tier would only affect the use of
interface code. Typically, the user interface runs on a desktop pe or workstations and uses a
standard graphical user interface functional process logic that may consist of one or more
separate modules running on workstations on application server, and RDBMS on database
server or mainframe that contains the computer data storage logic. The middle tier may be
multi-tiered itself (in which case the overall architecture is called an "n-tier architecture").
Description of Architectural Diagram
• Presentation layer
• Buisness logics Tier Middleware
• Data Management Tier
• Internet
• Application
4.1.1 Presentation layer: This is the top most level of the application The presentation layer
provides the applications user interface Typically, this involves the use of GUI for smart client

6|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

interaction, and web based technologies for browser-based interaction. The presentation tier
displays information related to such services as browsing, merchandise, purchasing, and cart
contents.

4.1.2 Logic tier : The logic tier is pulled out from the presentation tier and, as its on layer it
controls an application functionalities by performing detailed processing Logic tier mission
critical business problems are solved. The component that makes up this layer can exist on
server machine, to assist in resource sharing. These components can be used to enforce business
rules, such as business algorithms and legal or governmental regulations, and data rules which
are designed to keep the data structures consistent within either specific or multiple databases.

4.1.3 Data tier : This tier consist of data base server, is the actual DBMS access layer .It can
be accessed through the business services layer and on occasion by the user services layer.
Here information is stored and retrieved. This tier keeps data natural and independent from
application server or business logic. Giving data is on tier also improves scalability and
performance This layer consist of data access component to aid in resources sharing and to
allow clients to be configured without installing the DBMS libraries and ODBC
drivers on each client.

4.1.4 Database normalization: is a technique of organizing the data in the database.


Normalization is systematic approach decomposing table to eliminate data redundancy an
undesirable characteristics like insertion, update and deletions Anomalies. Ti is a multi state
process that puts data into tabular form by removing duplicated data from the relation tables.
Normalization is used for mainly two purposes:
• Eliminating redundant data.
• Ensuring data dependence makes sense i.e. data is logically stored.
Our table in the database is in 1 NF form. A table is said to be in 1 NF if both the following
conditions hold:
A relation will be 1 NF if it contains an atomic value. It states that an attributes of a table cannot
hold multiple values. It must hold single valued attributed. I NF disallows the multi-valued
attribute, composite attribute, and their combinations.

7|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 5
IMPLEMENTATION
In implementation we start with the actual execution of the software application with the design
we have made. Implementation is done before we start with the coding of the software product
Implementation includes writing codes with the design in hand. Implementation is the process
of having systems personnel check out and put new equipment into use, train users, install the
new application depending on the size of the organization that will be involved in:

5.1 ALGORITHM
Login page:
package quiz.application;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Login extends JFrame implements ActionListener{

JButton rules, back;


JTextField tfname;

Login() {
getContentPane().setBackground(Color.WHITE);
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/login.jpeg"));


JLabel image = new JLabel(i1);
image.setBounds(0, 0, 600, 500);
add(image);

JLabel heading = new JLabel("Simple Minds");


heading.setBounds(750, 60, 300, 45);
8|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

heading.setFont(new Font("Viner Hand ITC", Font.BOLD, 40));


heading.setForeground(new Color(30, 144, 254));
add(heading);

JLabel name = new JLabel("Enter your name");


name.setBounds(810, 150, 300, 20);
name.setFont(new Font("Mongolian Baiti", Font.BOLD, 18));
name.setForeground(new Color(30, 144, 254));
add(name);

tfname = new JTextField();


tfname.setBounds(735, 200, 300, 25);
tfname.setFont(new Font("Times New Roman", Font.BOLD, 20));
add(tfname);

rules = new JButton("Rules");


rules.setBounds(735, 270, 120, 25);
rules.setBackground(new Color(30, 144, 254));
rules.setForeground(Color.WHITE);
rules.addActionListener(this);
add(rules);

back = new JButton("Back");


back.setBounds(915, 270, 120, 25);
back.setBackground(new Color(30, 144, 254));
back.setForeground(Color.WHITE);
back.addActionListener(this);
add(back);

setSize(1200, 500);
setLocation(200, 150);
setVisible(true);
}
9|Page
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == rules) {
String name = tfname.getText();
setVisible(false);
new Rules(name);
} else if (ae.getSource() == back) {
setVisible(false);
}
}

public static void main(String[] args) {


new Login();
}
}
Quiz Page:
package quiz.application;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Quiz extends JFrame implements ActionListener {

String questions[][] = new String[10][5];


String answers[][] = new String[10][2];
String useranswers[][] = new String[10][1];
JLabel qno, question;
JRadioButton opt1, opt2, opt3, opt4;
ButtonGroup groupoptions;
JButton next, submit, lifeline;

public static int timer = 15;


10 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

public static int ans_given = 0;


public static int count = 0;
public static int score = 0;

String name;

Quiz(String name) {
this.name = name;
setBounds(50, 0, 1440, 850);
getContentPane().setBackground(Color.WHITE);
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/quiz.jpg"));


JLabel image = new JLabel(i1);
image.setBounds(0, 0, 1440, 392);
add(image);

qno = new JLabel();


qno.setBounds(100, 450, 50, 30);
qno.setFont(new Font("Tahoma", Font.PLAIN, 24));
add(qno);

question = new JLabel();


question.setBounds(150, 450, 900, 30);
question.setFont(new Font("Tahoma", Font.PLAIN, 24));
add(question);

questions[0][0] = "Which is used to find and fix bugs in the Java programs.?";
questions[0][1] = "JVM";
questions[0][2] = "JDB";
questions[0][3] = "JDK";
questions[0][4] = "JRE";

11 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

questions[1][0] = "What is the return type of the hashCode() method in the Object class?";
questions[1][1] = "int";
questions[1][2] = "Object";
questions[1][3] = "long";
questions[1][4] = "void";

questions[2][0] = "Which package contains the Random class?";


questions[2][1] = "java.util package";
questions[2][2] = "java.lang package";
questions[2][3] = "java.awt package";
questions[2][4] = "java.io package";

questions[3][0] = "An interface with no fields or methods is known as?";


questions[3][1] = "Runnable Interface";
questions[3][2] = "Abstract Interface";
questions[3][3] = "Marker Interface";
questions[3][4] = "CharSequence Interface";

questions[4][0] = "In which memory a String is stored, when we create a string using new
operator?";
questions[4][1] = "Stack";
questions[4][2] = "String memory";
questions[4][3] = "Random storage space";
questions[4][4] = "Heap memory";

questions[5][0] = "Which of the following is a marker interface?";


questions[5][1] = "Runnable interface";
questions[5][2] = "Remote interface";
questions[5][3] = "Readable interface";
questions[5][4] = "Result interface";

questions[6][0] = "Which keyword is used for accessing the features of a package?";


questions[6][1] = "import";
12 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

questions[6][2] = "package";
questions[6][3] = "extends";
questions[6][4] = "export";

questions[7][0] = "In java, jar stands for?";


questions[7][1] = "Java Archive Runner";
questions[7][2] = "Java Archive";
questions[7][3] = "Java Application Resource";
questions[7][4] = "Java Application Runner";

questions[8][0] = "Which of the following is a mutable class in java?";


questions[8][1] = "java.lang.StringBuilder";
questions[8][2] = "java.lang.Short";
questions[8][3] = "java.lang.Byte";
questions[8][4] = "java.lang.String";

questions[9][0] = "Which of the following option leads to the portability and security of
Java?";
questions[9][1] = "Bytecode is executed by JVM";
questions[9][2] = "The applet makes the Java code secure and portable";
questions[9][3] = "Use of exception handling";
questions[9][4] = "Dynamic binding between objects";

answers[0][1] = "JDB";
answers[1][1] = "int";
answers[2][1] = "java.util package";
answers[3][1] = "Marker Interface";
answers[4][1] = "Heap memory";
answers[5][1] = "Remote interface";
answers[6][1] = "import";
answers[7][1] = "Java Archive";
answers[8][1] = "java.lang.StringBuilder";
answers[9][1] = "Bytecode is executed by JVM";
13 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

opt1 = new JRadioButton();


opt1.setBounds(170, 520, 700, 30);
opt1.setBackground(Color.WHITE);
opt1.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt1);

opt2 = new JRadioButton();


opt2.setBounds(170, 560, 700, 30);
opt2.setBackground(Color.WHITE);
opt2.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt2);

opt3 = new JRadioButton();


opt3.setBounds(170, 600, 700, 30);
opt3.setBackground(Color.WHITE);
opt3.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt3);

opt4 = new JRadioButton();


opt4.setBounds(170, 640, 700, 30);
opt4.setBackground(Color.WHITE);
opt4.setFont(new Font("Dialog", Font.PLAIN, 20));
add(opt4);

groupoptions = new ButtonGroup();


groupoptions.add(opt1);
groupoptions.add(opt2);
groupoptions.add(opt3);
groupoptions.add(opt4);

next = new JButton("Next");


next.setBounds(1100, 550, 200, 40);
14 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

next.setFont(new Font("Tahoma", Font.PLAIN, 22));


next.setBackground(new Color(30, 144, 255));
next.setForeground(Color.WHITE);
next.addActionListener(this);
add(next);

lifeline = new JButton("50-50 Lifeline");


lifeline.setBounds(1100, 630, 200, 40);
lifeline.setFont(new Font("Tahoma", Font.PLAIN, 22));
lifeline.setBackground(new Color(30, 144, 255));
lifeline.setForeground(Color.WHITE);
lifeline.addActionListener(this);
add(lifeline);

submit = new JButton("Submit");


submit.setBounds(1100, 710, 200, 40);
submit.setFont(new Font("Tahoma", Font.PLAIN, 22));
submit.setBackground(new Color(30, 144, 255));
submit.setForeground(Color.WHITE);
submit.addActionListener(this);
submit.setEnabled(false);
add(submit);

start(count);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == next) {
repaint();
opt1.setEnabled(true);
opt2.setEnabled(true);
15 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

opt3.setEnabled(true);
opt4.setEnabled(true);

ans_given = 1;
if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}

if (count == 8) {
next.setEnabled(false);
submit.setEnabled(true);
}

count++;
start(count);
} else if (ae.getSource() == lifeline) {
if (count == 2 || count == 4 || count == 6 || count == 8 || count == 9) {
opt2.setEnabled(false);
opt3.setEnabled(false);
} else {
opt1.setEnabled(false);
opt4.setEnabled(false);
}
lifeline.setEnabled(false);
} else if (ae.getSource() == submit) {
ans_given = 1;
if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}
16 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

for (int i = 0; i < useranswers.length; i++) {


if (useranswers[i][0].equals(answers[i][1])) {
score += 10;
} else {
score += 0;
}
}
setVisible(false);
new Score(name, score);
}
}

public void paint(Graphics g) {


super.paint(g);

String time = "Time left - " + timer + " seconds"; // 15


g.setColor(Color.RED);
g.setFont(new Font("Tahoma", Font.BOLD, 25));

if (timer > 0) {
g.drawString(time, 1100, 500);
} else {
g.drawString("Times up!!", 1100, 500);
}

timer--; // 14

try {
Thread.sleep(1000);
repaint();
} catch (Exception e) {
e.printStackTrace();
17 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

if (ans_given == 1) {
ans_given = 0;
timer = 15;
} else if (timer < 0) {
timer = 15;
opt1.setEnabled(true);
opt2.setEnabled(true);
opt3.setEnabled(true);
opt4.setEnabled(true);

if (count == 8) {
next.setEnabled(false);
submit.setEnabled(true);
}
if (count == 9) { // submit button
if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}

for (int i = 0; i < useranswers.length; i++) {


if (useranswers[i][0].equals(answers[i][1])) {
score += 10;
} else {
score += 0;
}
}
setVisible(false);
new Score(name, score);
} else { // next button
18 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

if (groupoptions.getSelection() == null) {
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}
count++; // 0 // 1
start(count);
}
}

public void start(int count) {


qno.setText("" + (count + 1) + ". ");
question.setText(questions[count][0]);
opt1.setText(questions[count][1]);
opt1.setActionCommand(questions[count][1]);

opt2.setText(questions[count][2]);
opt2.setActionCommand(questions[count][2]);

opt3.setText(questions[count][3]);
opt3.setActionCommand(questions[count][3]);

opt4.setText(questions[count][4]);
opt4.setActionCommand(questions[count][4]);

groupoptions.clearSelection();
}

public static void main(String[] args) {


new Quiz("User");
}
19 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

}
Rules Page:
package quiz.application;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Rules extends JFrame implements ActionListener{

String name;
JButton start, back;

Rules(String name) {
this.name = name;
getContentPane().setBackground(Color.WHITE);
setLayout(null);

JLabel heading = new JLabel("Welcome " + name + " to Simple Minds");


heading.setBounds(50, 20, 700, 30);
heading.setFont(new Font("Viner Hand ITC", Font.BOLD, 28));
heading.setForeground(new Color(30, 144, 254));
add(heading);

JLabel rules = new JLabel();


rules.setBounds(20, 90, 700, 350);
rules.setFont(new Font("Tahoma", Font.PLAIN, 16));
rules.setText(
"<html>"+
"1. You are trained to be a programmer and not a story teller, answer point to point"
+ "<br><br>" +
"2. Do not unnecessarily smile at the person sitting next to you, they may also not
know the answer" + "<br><br>" +
20 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

"3. You may have lot of options in life but here all the questions are compulsory" +
"<br><br>" +
"4. Crying is allowed but please do so quietly." + "<br><br>" +
"5. Only a fool asks and a wise answers (Be wise, not otherwise)" + "<br><br>" +
"6. Do not get nervous if your friend is answering more questions, may be he/she is
doing Jai Mata Di" + "<br><br>" +
"7. Brace yourself, this paper is not for the faint hearted" + "<br><br>" +
"8. May you know more than what John Snow knows, Good Luck" + "<br><br>" +
"<html>"
);
add(rules);

back = new JButton("Back");


back.setBounds(250, 500, 100, 30);
back.setBackground(new Color(30, 144, 254));
back.setForeground(Color.WHITE);
back.addActionListener(this);
add(back);

start = new JButton("Start");


start.setBounds(400, 500, 100, 30);
start.setBackground(new Color(30, 144, 254));
start.setForeground(Color.WHITE);
start.addActionListener(this);
add(start);

setSize(800, 650);
setLocation(350, 100);
setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


if (ae.getSource() == start) {
21 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

setVisible(false);
new Quiz(name);
} else {
setVisible(false);
new Login();
}
}

public static void main(String[] args) {


new Rules("User");
}
}
Score Page:
package quiz.application;

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;

public class Score extends JFrame implements ActionListener {

Score(String name, int score) {


setBounds(400, 150, 750, 550);
getContentPane().setBackground(Color.WHITE);
setLayout(null);

ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/score.png"));


Image i2 = i1.getImage().getScaledInstance(300, 250, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0, 200, 300, 250);
add(image);

22 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

JLabel heading = new JLabel("Thankyou " + name + " for playing Simple Minds");
heading.setBounds(45, 30, 700, 30);
heading.setFont(new Font("Tahoma", Font.PLAIN, 26));
add(heading);

JLabel lblscore = new JLabel("Your score is " + score);


lblscore.setBounds(350, 200, 300, 30);
lblscore.setFont(new Font("Tahoma", Font.PLAIN, 26));
add(lblscore);

JButton submit = new JButton("Play Again");


submit.setBounds(380, 270, 120, 30);
submit.setBackground(new Color(30, 144, 255));
submit.setForeground(Color.WHITE);
submit.addActionListener(this);
add(submit);

setVisible(true);
}

public void actionPerformed(ActionEvent ae) {


setVisible(false);
new Login();
}

public static void main(String[] args) {


new Score("User", 0);
}
}

23 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 6
SOFTWARE TESTING
6.1 Testing Methods
Software testing is a process which is used to measure the quality of software developed.
It is also a process of uncovering errors in a program and makes it a feasible task. It is useful
process of executing program with the intent of finding bugs. In order to prove that a piece of
software works, the software must be tested to determine if the requirements of the application
are met. There are several different types used throughout the development process.

6.1.1 Black-Box Testing


Black box testing is also known as Behavioral Testing, is a software testing. method in which
the internal structure/design/implementation of the item being tested is not known to the tester.
These tests can be functional or non- functional, through usually functional.
This method is named so because the software program, in the eyes of the tester, is like a black
box; inside which one cannot See.

Fig 6.1: Black-Box Testing

Test cases of Black Box Testing:


Test Case Name: Registration.
Input: Enter required details for registration.
Outcomes: Registered successfully.
Expected Outcomes: Registered successfully.
Result: Pass.
Test Case Name: Registration.
24 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

Input: Enter required details for registration.


Outcomes: Validation not correct.
Expected Outcomes: Registered not successfully.
Result: Fail.

6.1.2 White-Box Testing


White box testing is defined as the testing of software solution's internal structure, design, and
coding. In this type of testing, the code is visible to the tester. It focuses primarily on verifying
the flow of inputs and outputs through the application, improving design and usability,
strengthening security. White box testing is also called Clear testing, Open Box Testing,
Structural testing, Transparent Testing, Code-Based Testing and Glass Box Testing.

Test Cases of White Box Testing:


Test Case Name: Registration
Input: Enter name, dob mail-id, mobile no.,
Outcomes: Successfully register.
Expected Outcomes: Successfully register.
Result: Pass.
Test Case Name: Login.
Input: Enter Username correct, password correct.
Outcomes: login successful.
Expected Outcomes: login successful
Result: Pass.
Test Case Name: Login.
Input: Enter Username correct, password wrong.
Outcomes: login fail.
Expected Outcomes: login fail.
Result: Fail.
Test Case Name: Login.
Input: Enter Username null, password null.
Outcomes: login fail.
Expected Outcomes: login fail.
Result: fail.
25 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

6.2 Levels of Testing


Component Testing : Where each and every components related to the software project is
tested.
System Testing : The testing implemented on overall software project after component
integration is system testing.
Acceptance Testing : It is performed after software installation in user environment with data
supplied by customers.

6.2.1 Unit Testing


The first test in the development process is the unit test. Unit testing is a level of software
testing where individual units or componennts of a software are tested. The purpose is to to
validate that each unit of the software perforns ass designed. A unit is the smallest testable part
of aany softare. It usually has one or a few inputs ad ussaully a single output. The source code
is normally divided into modules, which in turn are divided into smaller unit called units. These
units have specific behaviour. The test done on these units of code is called unit test.
Unit test depends upon the language on which the project is developed. Unit tests ensur that
each unique path of the project performs accurately to the documented specifications and
contains clearly defined inputa and expected results. Unit tests are typically written and run by
software developers to ensure that code meets its design and behaves as intended.
Here are some of the objectives of unnit testing :
• To verify the correctness of code.
• To fix bugs early in the development cycle and save costs.
• To help developers to understand the testing code base and enable them to make
changesquickly.
• To help the code reuse.
• To isolate a section of code.
• To test every unction and procedure.
• To learn what funictonally is provided by a unnit.
• It improves design and allows better refrractoring of code and makes the integration
simple.

26 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

6.2.2 Integration Testing


Integration testing is a level of software testing where individual units are combined and tested
to verify if they are working properly. Integration testing carries a lot of significance as it helps
tester in determining the effectiveness as well as the functionality of he software.
Integration testing is critical to ensure the functional correctness of the integrated ssystem.
Integration testing is often the most time consumng and expensive part of testing. Testing
peformed to expose defects in the interfaces and in the interactionns between integrated
components or systems.

6.2.3 System Testing


System testing is one of the types of user acceptance testing, which adds value to the product
as the end user (intended real user) validates the product for functionally, usability, reliaility
and compatibility. The main goal of user acceptance testing is to check whether the developed
software product fulfill the user requirements.
System testing is performed in order to access the product by exposing to real end users.
After that, the feedback is taken from the users and the defects detected are fixed. Inputs
provided by the end users helps inn enhancing the quality of the product further and leads to
its success. It hels he software product to provide better user experience.

27 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 7
RESULTS AND SNAPSHOTS

Fig 7.1: Login Page

Fig 7.2 : Rules Page

28 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

Fig 7.3 : Questions Page

Fig 7.4: Score Page

29 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 8
ADVANTAGES AND APPLICATION
Advantage:
• Convenient and accessible from anywhere with an internet connection
• Automated grading saves time and reduces human error
• Can be easily updated and changed
• Can include multimedia elements like images, audio, and video
• Can track and analyze student performance data
• Easy to administer to a large number of students at once

Application:
• Provides the searching facilities based on various factors. Such as Students, Marks,
Courses, Papers
• MCQ Quiz Application also manage the Results details online for Courses details,
Papers details, Students.
• It tracks all the information of Examinations, Results, Courses ect
• Manage the information of Examinations
• Shows the information and description of the Students, Marks
• To increase efficiency of managing the Students, Examinations
• It deals with monitoring the information and transactions of Courses.
• Manage the information of Students
• Editing, adding and updating of Records is improved which results in proper resource
management of Students data.

30 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

CHAPTER 9
CONCLUSION AND FUTURE ENHANCMENT
The Scope of this project is very broad in terms of gaining knowledge and sharing knowledge
among world. mentioned the project is on java platform which is coded in NetBeans IDE with
help HTML, CSS and JavaScript and running as web page by Apache Tomcat web server. But
this project is only for MCQ test but in the future we have plan to extended it to support
subjective type of questions with more functionality. We will add Administrative part on it
which able the system to delete test, add user, delete user and so on graphically vie the web.

This online quiz application provides facility to play quiz anywhere and anytime. It save time
since user does need to wait for result. So student/user cannot wait for the result. All Student/
user get extra knowledge and skills. Administrator has a privilege to put as much as question
in any category given in application. User can register, log-in, and give the test with his/her
specific id, and can see the results as well.

31 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

REFERENCES
[1] Link 1 :https://en.wikipedia.org/
[2] Link 2: https://www.javatpoint.com/
[3] Link 3: https://www.w3schools.com/
[4] Link 4: https://www.tutorialspoint.com/

32 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

33 | P a g e
Dept. of CS&E SJMIT CHITRADURGA
QUIZ APPLICATION 2023-2024

34 | P a g e
Dept. of CS&E SJMIT CHITRADURGA

You might also like