0% found this document useful (0 votes)
34 views24 pages

IT Project File No1

Uploaded by

NARENDER Yadav
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)
34 views24 pages

IT Project File No1

Uploaded by

NARENDER Yadav
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/ 24

KALA NIKETAN INTERNATIONAL

SCHOOL

KIS

Gazipur, Delhi-110096

INFORMATION TECHNOLOGY
Project
on

QUIZ APPLICATION
USING

NETBEANS AND MYSQL

Academic year: 2022-23

Submitted to: Submitted by:


MRS. POOJA SINGH SAMSULNISHA
XII-A'
CONTENTS

Certificate
$ Acknowledgement

Introduction to java
Abstract

Technology and software requirements

Codings

& Sreenshots of output

Introduction to MySQL

Screen shot of MySQL

Conclusion

Bibliography
KIS
Kala Niketan
international School
St. Sec. Recognised &Affillated to CBSE

CERTIFICATE

This is hereby to certify that original and genuine work has been carried
towork on the matter and the related data collection and investigation
has been completed slowly, sincerely and satisfactorily by Samsulnisha
of class XI|A' of Kala Niketan International School regarding the project
title "Quiz Application".

eachoae|32

's `ignature
ACKNOVWLEDGEMENT

lam very thankful and expressing my deep sense of gratitude towards


MRS. POOJA SINGHmam for guiding me immensely through the course
of this project. She always evidenced keen interest in my work. Her
constructive advice and constant motivation have been responsible for
the successfulcompletion of this project. Il gained a lot of knowledge
from this project.

lam also thankful to my parents who provided me such an opportunity, for their inspiring words. Iam also thankful
to allmy colleagues and allthose who helpedme in completing this project.
ABSTRACT

Online quiz application is a web based quiz system for accessing


students. It is a system by which student can sit in a quiz, which need no
pencil and paper. Nowadays, students take quiz manually. Lecturers
heed to spend more time on grading. Other than that, the quiz paper
can be misplaced. Students need to wait for lecturers to finish grading
toget their result. It is time consuming. Therefore, this system will help
teachers save their time because of automated marking. Teachers can
set up quiz which willauto-grade itself. Students can answer the quiz
from any location and get fast result. This online quiz system is mabe by
using netbeans and mySQL.
TECHNOLOGIES USED

1. Front-End Development
" JavaScript
2. Back-End Development
" Java [JDK 8+]
o JDBC

3. Database

" MySQL

SOFTWARE AND TOOLS REQUIRED

o NetBeans IDE 16
" Java [JDK 8+]
" MySQL
CODING
" SRCCODE FOR LOGIN

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 () {
getContent Pane(0 .setBackground (Color . WHITE);
setLayout (null) ;

ImageIcon il = new
ImageIcon (ClassLo ader. getSystemResource ("icons /login.jpeg") ):
JLabel image = new JLabel (il) ;
image. setBounds (0, 0, 600, 500) ;
add (image) ;

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


heading. setBounds (750, 60, 300, 45):
heading.set Font (new Font ("Viner Hand ITC", Font. BOLD,
40) );
heading. setForeground(new Color (30, 144, 254) ):
add (heading) ;
JLabel name = new JLabel ( "Entér your name");
name.setBounds (810, 150, 300, 20);
name. set Font (new Font ("MÐngolian Baiti", Font.BOLD,
18) ) :
name. setForeground (new Color (30, 144, 254) ):
add (name ) ;

tfname = new JTextField () ;


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

rules = new JButton ("Rules");


rules. set Bounds(7 35, 270, 120, 25):
rules. setBackground (new Color (30, 144, 254) ) :
rules. set Foreground (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) ;
}

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 () ;
SRC CODE FOR QUIZ

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 [UD =new String [1 0] [2]:
String useranswers [] []= new String[10] [1];
JLabel qno, question;
JRadioButton optl, opt2, opt3, opt4;
ButtonGroup groupoptions;
JButton next, submit, lifeline;
public static int timer = 15;
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, 1140, 750) ;
getContent Pane () . setBackground (Color.WHITE) ;
setLayout (null) ;
ImageI con il = new
ImageIcon (ClassLoade r. getSystemResource ("i cons /quiz. jpg")):
JLabel image = new JLabel (il) ;
image. setBounds (0, 0, 1240, 392);
add (image) ;

qno = new JLabe l () ;


qno.setBounds (100, 50, 450, 30) ;
qno.set Font (new Font ("Iahoma", Font. PLAIN, 24) ):
add (qno) ;
question = new JLabe l () ;
question. setBounds (150, 450, 800, 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";
questions [1][O] = "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] [O] = "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] [O] = "In which memory String is stored,
when we create string using new operator?";
questions [4] [1] = "Stack" ;
questions [4] [2] = "String memory" ;
questions [4] [3] = "Random storage space";
questions [4] [4] = "Heap memóry";
questions [5] [0] = "Bhich 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 ";
accessing
questions [6] [O] = "Which keyword is used for
the features of a package?";
questions [6] [1] = "import";
questions [6] [2] = "package" ;
questions [6][3) = "extends":
questions [6] [4] = "export";

questions [7] [O] = "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";
mutable
questions [8] [O] = "Which of the following is a
class in java?";
questions [8] [1] = "java. lang. StringBuilder";
questions [8] [2] = "java.lang. Short";
questions [8] [3] java. lang. Byte";
questions [8] 4T ="java. lang.String" ;
questions [9] [O] = "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] = "Jaya Archive";
answers [8] [1] = "yáva.lang. StringBuilder";
answers[9] [1]= "Bytecode is executed by JVM";
opt1 = new JRadioButton ():
optl.setBounds (170, 500, 600, 30):
optl.setBackground ( Color. WHITE) ;
optl.setFont (new Font ("Dialog", Font. PLAIN, 20)):
add (opt1) ;
submit (next)
next.setFont (opt4)
add ; opt4
opt3.setBounds opt2.setBounds
opt3
opt2.setFont
add
add opt2.setBackground opt2
submit.
submit.setFont
addActionistener
submit. lifeline.
lifeline.
(lifeline); lifeline
lifeline.
next.addActionListener
lifeline.setFont next.setBounds
(this)
next.setBackground
next.setForeground
addlifeline. (Color.WHITE)
add ; ; ; opt4.setBackground
nextgroupoptions
groupoptions.add
groupoptions.
groupoptions. (opt2) ;opt4.setBounds
groupoptions opt3.set
opt3.setBackground
opt4.set
(opt3) 7 (opt
= = = =
new new 2) newnew
etBackground
setBounds = Font Font
new setFosetBounds
setBackground = ;
new JButton JRadioButton JRadioButton JRadioButton
JButton (new ButtonGroup();add .new = (new (new (new
(new (1000, add add (170, (170,
reground (170,
(1 (newJButton Font (opt3) (opt1)
(opt4) Font Font Font
Font 000, (1000, (new ("Next") ( (Color. (Color
(new("Submit" Color 620, 580, 540,
Font ("Tahoma" 530, ("Diatog",
; ("Dialog", ("Dialog",
(newColor
(eol ("50-50 Color ; ; (); ()
("Tahoma 710, . ();
Color ("Tahoma", 610, 200, WHITE); 700, WHITE) 700, .WHITE) 700, ;
(this); or. ;
200, ) (30,
; WHITE) Lifeline") 200, 30);
(30, ", 40) ;30) ;30)
40) (30, Font.PLAIN,
144, Font. Font. : Font ;
;
144,Font. ; ; 40)
PLAIN, PLAIN, .
144,Font. ; 255) PLAIN,
PLAIN, ;
255)
PLAIN,
255)
)
;)22)
;22) 20) 20) 20));
);
22)) ); ); );
;)
;
submit . setForeground (Color . WHITE) ;
submit . addActionListener (this) ;
submit , setEnabled (false) ;
add (submit) ;

start (count) ;

setVisible (true);

public void action Per formed (ActionEvent ae) (


if (ae.getSource () == next) (
repaint ();
opt1.setEnabled (true);
opt2.setEnabled (true );
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+tt;
start ( count) ;
} else if (ae.get Source () == lifeline)
if (count == 2 || count == 4 | | count == 6 || count
==8 | | count == 9) {
opt2. setEnabled (fal se);
opt3.setEnabled ( false);
} else {
optl.setEnabled (false) ;
opt4.setEnabled (fal se);
)
lifeline. setEnabled (false) ;
} else if (ae.getSource () == submit) {
ans given = 1l;
if (groupoptions . getSelection() == null) {
useranswers [count] [0] = "";
) else {
useranswers [count] [0] =
groupoptions . getSelection () . getActionCommand () ;

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


if (useranswers [i] [0] .equals (answers[i] [1])) {
score t= 10;
} else {
score t= 0;

setVisible (false) ;
new Score(name, score/
}

public void paint (Graphics g) {


super.paint (g) ;
seconds"; // 15
String time = "Time left - " + timer +
g.setColor (Color. RED) ;
g.setFont (new Font ("Tahoma", Font.BOLD, 25) ):
if (timer > 0) {
g.drawString (time, 1000, 500) ;
}else {
g.drawString (""Times up!!", 1000, 500) :

timer--; // 14

try {
Thread.sleep (1000) ;
repaint () ;
) catch (Exception e) {
e.printStackTrace () ;

if (ans given ==1) {


ans given = 0;
timer = 15;
} else if (timer < 0) {
timer = 15;
optl.setEnabl ed (true) ;
opt2.set Enabl ed (true) ;
opt3.set Enabled (true) ;
opt4. setEnabl ed (true) ;
if (count == 8) {
next.setEnabled (false) ;
submit. setEnabl ed (true) ;
button
if (count == 9) {// submit
getSelection() == null) {
if (groupoptions.
useranswers [count] [0] = "";
) else {
useranswers [count] [0] =
getActionCommand () :
groupoptions . getSelection () .

useranswers . length; it+) {


for (int i = 0; i < ))
if(useranswers [i] [0] . equals (answers [i][1]
SCore t= 10;
} else {
Score t= 0:

setVisible (false);
new Score (name, score);
) else { / / next button
() == null) {
if (groupoptions . getSelection
= "";
useranswers [count] [0]
} else {
useranswers [ count] [0] =
getActionCommand () ;
groupoptions . getSelection () .
count+t; //0 // 1
start (count) ;

public void start (int Count) {


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

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


opt2. setAction Command(questions
[count] [2] );

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

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

groupoptions.clearSelection () ;

(String [] args) {
public static void ma in
new Quiz ("User") ;

RULES
" SRC CODE FOR

package quiz.application;

import javax.swing. *;
import java.awt. *;
import java.awt.event. *;
ActionListener {
implements
extends JFrame
public class Rules
String name ;
JButton start, back;

Rules (String name) {


this.name = name;
(Color. WHITE) ;
getContent Pane () .setBackground
setLayout (null ) ;
JLabel heading = new JLabel ("Welcome + name + " to
simpl
e 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.set Font (new Font ("Tahoma ", Font. PLAIN, 16));
rules.setText(
"<html>"+
"1. There are 10 questions displayed on the
SCreen one after another." + "<br><br>" +
within the time. "
"2. You are reguired to answer
+ "<br><br>" +
time limit
"3. The question will disappear after
is finished. " + "<br><br>" +
marks. "
"4. Each question will give you 10
"<br><br>" +
"5. You can retry and do the quiz again if you
SCore less. " + "<br><br>" +

"6. We hope for yeú to s core full mark. " +


"<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) {
1I (ae.getSource () == start) (
setVisible (false) ;
new Quiz (name);
} else {
setVisible (false) ;
new Login();

public static void main (String[] args) {


new Rules ("User") ;

" SRC CODE FOR SCORE

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)A
setBounds (400, 150, 750, 550) :
getContent Pane () . setBackground (Color . WHITE) ;
setLayout (null);
ImageIcon il = new
Image Icon (ClassLoader.getSystemResource ("icons/s core. png") );
Image i2 = i1.getImage ().getScaled Instance (300, 250,
Image. SCALE DEFAULT);
lmageIcon i3 = new ImageIcon (i2) ;
JLabel image = new JLabel (i3) ;
lmage. setBounds (0, 200, 300, 250) ;
add (image) i
JLabel heading = new JLabe l ("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.set Bounds (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 (Co lor. WHITE) ;
submit.addActionListener (this);
add (submit) ;

setVisible (true) ;

public void action Performed (ActionEvent ae){


setVisible (false) ;
new Login () ;

public static void main (String{T args) {


new Score ( "User", 0) ;
}
Time left -9 seconds
Which is used to findand fix bugs in the Java programs.?
VM
Next
JDB
JDK
50-50 Lifeine
JRE

QUIZ
Which of the following option leads to the portability and security of Java? Time left- 4seconds
Bytecode is executed by JVM
oThe applet makes the Java code secure and portable
Use of exception handling
Dynamic binding between objects
Thankyou for playing Simple Minds

Your score is 30

Play Agan

ScORE
Welcome to Sinple Minds

1. There are 10 questions displayed on the screen one after another.


2. You are required to answer within the time.

3. The question willdisappear after time limit is finished.


4. Each question will give you 10 marks.
5. You can retry and do the quiz again if you score less.
6. We hope for you to score full mark.

Back Start
Simple Minds
Enter your name

QUIZ
TIME! Rules Back
CONCLUSION

The manualsystem which are available now is not efficient. For


instance,
the losing of quiz paper, no pencil and no pen to do quiz on time. The
lecturer cannot setup quiz for specific time and have to do quiz in class.
Lecturer also need spend more time on grading. While, student also
cannot take quiz from any location. This problems can be solved by
Online Quiz System. In addition, this kind of system can be replaced the
manual system in order to increase the efficiency of the quiz
management.
BIBLIOGRAPHY

*www.wikepedia.com

www.scribd.com

www.google.com

You might also like