Java Report
Java Report
Submitted in partial fulfillment of the Requirements for the award of the Degree of
By
IT-1252
Assistant Professor
MAHARASHTRA
2021-22
Date: …………………
Seat no. 2010270 has successfully completed the Project work, titled Quiz
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.
ACKNOWLEDGEMENT
I have taken efforts in this project. However, it would not have been possible without the
kind support and help of many individuals and organizations. I would like to extend our sincere
thanks to all of them.
I am highly indebted to Dr. SAVITA KHURANA for his guidance and constant
supervision as well as for providing necessary information regarding the project and also for their
support in completing the project.
DECLARATION
I hereby declare that the project entitled, “JAVA QUIZ” done at SETH JAI PARKASH
MUKAND LAL INSTITUTE OF ENGINEERING AND TECHNOLOGY, has not been in any
case duplicated to submit to any other university for the award of any degree. To the best of my
knowledge other than me, no one has submitted to any other university.
The project is done in partial fulfillment of the requirements for the award of degree of
BACHELOR OF TECHNOLOGY (INFORMATION TECHNOLOGY) to be submitted as a
final semester project as part of our curriculum.
Ashwani kumar
Vishal Saini
TABLE OF CONTENTS
Chapter 1: Introduction
1.1 Background 1
1.2 Aim and Objectives 1
1.3 Purpose & Scope & Applicability 2
1.3.1 Purpose 2
1.3.1 Scope
1.3.3 Applicability 2
1.4 Description 2
1.5 Methodology 2
1.6 Assumptions 2
1.7 Limitations and Issues covered 3
1.8 Achievement 3
Schema Design
Data integration and constraints
Event table
Test case table
LIST OF FIGURES
Figure 1: Gantt chart
Figure 2: Waterfall model
Figure 3: ER Diagram
Figure 4: Use Case Diagram
Figure 5: Flow chart
Figure 6: Activity Diagram
6.1 Activity diagram for Login
6.2 Activity diagram for Submit Quiz
6.3 Activity diagram for Play Quiz
Figure 7: Class diagram
Figure 8: Sequence Diagram
8.1 Sequence diagram for login
8.2 Sequence diagram for Play Quiz
8.3 Sequence diagram for Submit Question
8.4 Sequence diagram for Logout
Figure 9: Deployment Diagram
Figure10:Component Diagram
Figure 11: Welcome Page
Figure 12 Home Page
Figure 13: Register Page
Figure 14: Login Page
Figure 15: Welcome Page
Figure 16: Home Page
Figure 17: Admin Login Page
Figure 18: Admin Login error Page
Figure 19: Add New Question Page
Figure 20: Update Question Page
Figure 21: Delete Question Page
Figure 22: All Question Page
Figure 23: User Login Page
Figure 24: Login Error Page
Figure 25: Registration Page
Figure 26: Registration error Page
Figure 27: Forget Password Page
Figure 28: Forget Password Page
Figure 29: Contact Us Page
Figure 30: About Us Page
Chapter 1
Introduction
1.1 Background:
The project: “ JAVA QUIZ ” is a collection of number of different types of quizzes like
technical, games, sports, etc. A user can access/play the entire quiz and can attempt any of the
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.
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.
1
1.3 Purpose, Scope and Applicability:
Purpose:
This web application provides facility to Play online quiz and practice Grammar, Aptitude, and
G.K. It provides a good platform, where a student not only judges there knowledge/skill but also
they can improve knowledge/skill at the same time
Scope:
The Scope of this project is very broad in terms of gaining knowledge and sharing knowledge
among world.
Few points are:-
Can be used anywhere any time as it is a web based application.
This application will be used in educational institutions as well as in corporate world.
Applicability:
Anyone, whether a newcomer or professional, willing to learn they can choose it .
All users will have access to all subject containing sub topics
Users will receive best experience without any interruptions.
1.4 Description:
Firstly, we have to make interfaces for Home Page, 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 an 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.5 Methodology:
The programming language used for the development of the project is JAVA.
MySQL is used for Database.
1.6 Assumptions:
We assume that the users of our Application should have a minimal Knowledge of computer
system and should have an availability of internet. We are dependent on the sources from where
we have gathered the data and the data are authenticated.
2
1.7 Limitations and Issues covered:
Limitations:
No face to face interaction between the students and teacher.
User cannot add Questions for others.
User cannot see profile of other user.
Questions may take time to arrive due to slow internet connections
Issues covered:
Students may have option to select subject that meets their level of Knowledge and Interest.
Beneficial for those users who cannot afford studying in a class.
This quiz application is free of cost.
1.8 Achievement:
With the help of our Application user will get complete knowledge of their respective subject.
This application helpful for all competitive exam like UPSC, MPSC, SSC, CDS, NDA and much
more .
3
Chapter 2
Survey of Technology
Quiz Up
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.
Heads Up!
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.
Popcorn Trivia
Test out your knowledge of the silver screen with this addictive movie trivia app. Questions, based
on classic films, blockbusters and fan favorites, span picture rounds and multiple choices. Each
question is followed with an interesting fact. Play solo or against others.
4
2.2 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.
2. RAM 2 GB
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 .
1. Platform Windows 7
5
2.4 Justification of Platform:
Justification means why I choose this project to make because not just for making Project
for College It is for improving my skills.
Apache Net beans provides editors, wizards and templates to help you create applications in
JAVA, PHP and many other languages. The IDE simplifies the development of web, enterprise,
desktop and mobile applications that use .The JAVA and HTML5 platforms.
Advantages:
Why MySQL:
Advantages:
MySQL is more secure.
MySQL is available for free to download and use from the official site of MySQL.
6
Chapter 3
Requirements and Analysis
3.1 Problem Definition:
Quiz Contest is an application developed to conduct a quiz based on time constraints. Quiz
Contest system is accessed by entering the user name and password which is added to the database.
Before start of the quiz, the rules and regulations are displayed that includes description of the
time limit, number of questions to be answered and scoring methods. Quiz is started by displaying
one question with four options each based on computer and general knowledge. if the answer is
correct, 7 score is incremented by four and no negative marks for wrong answers . If the time
exceeds 20secs next question will come automatically after giving few limited question's answer
quiz application will finally direct you to the score page. Final score will be displayed and updated
in the database with username.
Functional Requirements:
System Feature-
This section gives a functional requirement that applicable to the online Quiz.
There are two modules in this phase:
Student/user module.
Admin module.
Student/user module:
The student/user have to login in application. They can choose any of the given Quiz. Then
the student/user will get result immediately after the completion of test.
Admin module:
The admin can see all the tables in the Database and can add the
Question by selecting the particular topic.
7
Performance Requirements
Response Time-
The system shall give responses in 2 sec after user login.
Safety Requirements
All logged information, updates, user activities are securely stored.
Security Requirement
Any modification for the Database shall be synchronized and done by system admin.
Phase
LITERATURE
SURVEY
REQUIREMENT
GATHERING
SYSTEM
DESIGN
RESEARCH &
TRAINING
CODING
TESTING
DOCUMENTATION
1. Platform Windows 7
Hardware Requirements:
The Quiz Application is an educational platform built for those students and professionals who
have interest in Government exams and gaining knowledge. The admin of our application can keep
all the Quizzes updated all the time so that members get updated information. Here, various
Quizzes will be available with different topics and description. Users can provide their valuable
feedback and even contact us if there is any issue. The main users are : Admin (who can add,
update or remove any Quiz and information)and Members (who are here to study).
9
Waterfall Process model
The Classical Life Cycle or waterfall Process Model was the first process model to present a
sequential framework, describing basic stages that are mandatory for a successful software
development model. It formed the basis for most software development standards and consists of
the following phases: Requirement analysis, design, coding, testing, and maintenance.
Simple goal.
Simple to understand and use.
Clearly defined stages.
Easy to arrange tasks.
Process and result are well documented.
Customers / end users already know about it.
Easy to manage.
Waterfall model faced “Inflexible point solution” which meant even small amendments in
the design were difficult to incorporate later design phase.
As the requirement were froze before moving to the design phase, using the incomplete set
of requirement, a complete design was worked amendments In case of a large project,
completing a phase and then moving back to reconstruct the same phase, incurred a large
overhead.
Once a phase is done, it is not repeated again that is movement in the waterfall goes one to
the next and the vice versa is not supported, deadlines are difficult to meet I case of large
projects.
10
Design
Implementation
11
3.5 ER Diagram
Figure 3: ER Diagram
12
3.6 UML Diagrams
3.6.1 Use Case Diagram :
To model a system, the most important aspect is to capture the dynamic behavior. Dynamic
behavior means the behavior of the system when it is running/operating. Only static behavior is
not sufficient to model a system; rather dynamic behavior is more important than static behavior.
In UML, there are five diagrams available to model the dynamic nature and use case diagrams are
one of them. A use case diagram is a graphical depiction of a user's possible interactions with a
system. A use case diagram shows various use cases and different types of users the system has
and will often be accompanied by other types of diagrams as well. A use case diagram is used to
represent the dynamic behavior of a system. It encapsulates the system‟s functionality by
incorporating use cases, actors and their relationships. Use case diagrams consist of actors, use
cases and their relationships. The diagram is used to model the system/subsystem of an application.
A single use case diagram captures a particular functionality of a system. Hence to model the entire
system, a number of use case diagrams are used.
The purpose of a use case diagram is to capture the dynamic aspect of a system.
● Purpose The main purpose of use case diagrams is to portray the dynamic aspect of a system.
➔ It recognizes the internal as well as external factors that influence the system.
Use case diagrams are used to gather the requirements of a system including internal and external
influences. These requirements are mostly design requirements. Hence, when a system is analyzed
to gather its functionalities, use cases are prepared and actors are identified. When the initial task
is complete, use case diagrams are modelled to present the outside view.
13
● Show the interaction among the requirements are actors.
14
3.6.2 Flow Chart
15
3.6.3 Activity diagram
Activity diagram is another important diagram in UML to describe the dynamic aspects of the
system. Activity diagram is basically a flowchart to represent the flow from one activity to another
activity. The activity can be described as an operation of the system. An activity diagram is a
behavioral diagram i.e. it depicts the behavior of a system. An activity diagram portrays the control
flow from a start point to a finish point showing the various decision paths that exist while the
activity is being 28 executed. An activity diagram shows business and software processes as a
progression of actions. These actions can be carried out by people, software components or
computers. Activity diagrams are used to describe business processes and use cases as well as to
document the implementation of system processes
16
Figure 6.1 : Activity diagram for Login
17
Figure 6.2 : Activity Diagram For Submit Quiz
18
Figure 6.3: Activity Diagram For Play quiz
19
3.6.4 class diagram
The class diagram is the main building block of object oriented modeling. It is used for general
conceptual modeling of the structure of the application, and for detailed modeling, translating the
models into programming code. Class diagrams can also be used for data modeling. The classes in
a class diagram represent both the main elements, interactions in the application, and the classes
to be programmed. Class diagram is a static diagram. It represents the static view of an application.
Class diagram is not only used for visualizing, describing, and documenting different aspects of a
system but also for constructing executable code of the software application.
20
3.6.4 Sequence Diagram :
A sequence diagram is a type of interaction diagram because it describes how and in what order a
group of objects works together. These diagrams are used by software developers and business
professionals to understand requirements for a new system or to document an existing process. A
sequence diagram is the most commonly used interaction diagram. An interaction diagram is used
to show the interactive behaviour of a system.
● See how objects and components interact with each other to complete a process.
21
Figure 8.1: Sequence Diagram For Login
22
Figure 8.2: Sequence diagram For Play Quiz
23
Figure 8.3: Sequence Diagram for Submit Question
24
Figure 8.4: Sequence Diagram For Logout
25
3.6.5 Deployment Diagram
26
Chapter 4
System Design
2) User Login:
Browse Quiz
Take a Quiz
27
User Table:
Quiz Table:
28
Relationship between tables:
Quiz Table:
29
admin_lname Varchar Not Null The last name of the admin
User Table:
30
Quiz Table:
31
4.3 User Interface
User Interface:
32
Figure 8: Homepage
This is the main Homepage of the Application. The user can log into the system through
log in, the service options will take you to the service page and Admin can login from this page.
33
Figure 9: Register page
This is the Register page. Where user have fill information like Name, Mobile Number,
Username, Password, Retype Password, Birthdate, Address. Then user can login in login page.
34
This is the Login page. The User have to enter their Username and password to avail
further services.
ISSUES SOLUTION
Customer‟s Data Customer‟s Data will be kept in encrypted form in the database
● Proactive
An approach in which the test design process is initiated as early as possible in order to
find and fix the defects before the build is created.
● Reactive
An approach in which the testing is not started until after design and coding are completed.
35
4.5.2 Test Cases Design:
Index Test Case Test data Test State Expected
input result
values
1. Admin Username Invalid Invalid Check with the
logins with And Username database and
username Password or display message
and Validation password username or
password password is
incorrect
Username Correct Valid Check with the
And Username database and
Password or redirect to the
Validation password home page of
Admin
2. User logins Username Invalid Invalid Check with the
with And Username database and
username Password or display message
and Validation password username or
password password is
incorrect
Username Correct Valid Check with the
And Username database and
Password or redirect to the
Validation password home page of
User
3. Course Username Invalid Invalid Check with the
provider And Username database and
logins with Password or display message
username Validation password username or
and password is
password incorrect
Username Correct Valid Check with the
And Username database and
Password or redirect to the
Validation password home page of
Course provider
4. The ID Alphabets or user@78 Invalid Please enter
should any special 9 digits only
contain character is
only used
numbers
ranging
(0-9) and
without
36
decimal
numbers
Any decimal 12.34 Invalid ID cannot be a
number is decimal
used number
37
8 character
and
maximum
of 12
character
and
password
must
contain a
special
symbol
TPassword abhijeet@ Invalid Password must
length is 55300 contains
more than 12 characters less
characters than 12
and without
special
symbol
Password abhi@424 Valid Password is
length is 4 accepted,
between 8-12 redirected to the
and contains home page
a special
symbol
8. Phone Phone 99452344 Invalid Please enter 10
number number digit mobile
must length is less number
contain than 10 digits
only 10
digits
Phone 98704441 Invalid Please enter 10
number 0078 digit mobile
length is number
more than 10
digits
Negative -9870444 Invalid Phone number
number is 1007 cannot be
used negative
Mobile 98927511 Valid Mobile number
number with 48 is accepted
proper 10
digit number
38
proper special
format symbols “@”
and “.”
At least one yah@554. Invalid Please enter
character co valid email
before”@” address
and three
characters
after “.”
Proper email abhi101@ Valid Email ID is
address gmail.co accepted
m
10. Course id ID is not Invalid Choose
unique another ID
ID is unique Valid Accepted!
39
Chapter 5
IMPLEMENTATION AND TESTING
This is the phase in the software life cycle where the actual software is implemented. The
result of this phase consists of source code, together with documentation to make the code
reliable. Implemenetation is the action that must follow any preliminary in order for something
to actually happen. It encompasses all the processes involved in getting new software and
hardware operating properly in its environment, including installation, configuration, running,
testing and making necessary changes.
In implementation we start with the atual execution of the software application with the
design we have made. Implemnetation 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 thenew application depending on the size of the organization that will be involved in
Login Admin:
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
public class LoginAdmin extends javax.swing.JFrame {
/**
* Creates new form LoginAdmin
*/
public LoginAdmin() {
initComponents();
}
@SuppressWarnings("unchecked")
40
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true);
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
41
jButton2ActionPerformed(evt);
}
});
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(41, 41, 41)
42
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap(134, Short.MAX_VALUE)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addComponent(jCheckBox1)
.addGap(85, 85, 85))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
TRAILING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jButton1,
javax.swing.GroupLayout.PREFERRED_SIZE, 69,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton2,
javax.swing.GroupLayout.PREFERRED_SIZE, 37,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addComponent(jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 198,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(38, 38, 38))))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addGap(53, 53, 53)
.addComponent(jLabel1)
.addGap(27, 27, 27)
.addComponent(jPasswordField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 33,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
43
.addComponent(jCheckBox1)
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.
LEADING)
.addComponent(jButton2)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE,
34, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(85, Short.MAX_VALUE))
);
getContentPane().add(jPanel1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(560, 240, 370, 330));
pack();
}// </editor-fold>
44
jPasswordField1.getText().equals("1234"))
{
setVisible(false);
new AdminHome().setVisible(true);
}
else
{
ImageIcon icon=new ImageIcon("Incorrect Password.PNG");
JOptionPane.showMessageDialog(null,"<html><b style=\"color: red; font-size:
10px\">Incorrect <br>Username or
Password</b></html>","Show",JOptionPane.INFORMATION_MESSAGE,icon);
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new LoginAdmin().setVisible(true);
}
});
}
45
Admin Home Page :
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class AdminHome extends javax.swing.JFrame {
public static int open=0;
public AdminHome() {
initComponents();
private void jMenu6MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
int a=JOptionPane.showConfirmDialog(jf,"Do you really want to
Logout","select",JOptionPane.YES_NO_OPTION);
if(a==0)
{
setVisible(false);
new LoginAdmin().setVisible(true);
}
}
private void jMenu7MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
int a=JOptionPane.showConfirmDialog(jf,"Do you really want to Exit
Application","select",JOptionPane.YES_NO_OPTION);
if(a==0)
{
System.exit(0);
}
}
private void jMenu1MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
if(open==0)
{
new AddNewQuestion().setVisible(true);
open=1;
}
else
{
JFrame jf=new JFrame();
46
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,"one form is already open");
}
}
47
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf,"one form is already open");
}
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new AdminHome().setVisible(true);
}
});
}
private javax.swing.JLabel jLabel1;
private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenu jMenu6;
private javax.swing.JMenu jMenu7;
private javax.swing.JMenuBar jMenuBar1;
}
48
else
jLabel4.setText("1");
}
catch(Exception e)
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf, e);
}
}
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
49
}
catch(Exception e)
{
JFrame jf=new JFrame();
jf.setAlwaysOnTop(true);
JOptionPane.showMessageDialog(jf, e);
}
50
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JTextField jTextField4;
private javax.swing.JTextField jTextField5;
private javax.swing.JTextField jTextField6;
}
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","root","123
4");
Statement st=con.createStatement();
st.executeUpdate("insert into student
(mobileno,email,username,password,securityQ,answer,name)
values('"+mobileno+"','"+email+"','"+username+"','"+password+"','"+securityQ+"','
"+answer+"','"+name+"')");
51
JOptionPane.showMessageDialog(null, "Thank you for Registration");
setVisible(false);
new LoginUser().setVisible(true);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, "Something went wrong ! Please try
again");
}
}
52
User Login Page:
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class LoginUser extends javax.swing.JFrame {
public LoginUser() {
initComponents();
}
private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
String username=jTextField1.getText();
String password=jPasswordField1.getText();
if (username.trim().equals("") || password.trim().equals(""))
{
JOptionPane.showMessageDialog(null, "all fields are required");
}else{
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","root","123
4");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select *from student where
username='"+username+"' and password='"+password+"'");
if(rs.next())
{
setVisible(false);
new InstructionUser().setVisible(true);
}
else
{
JOptionPane.showMessageDialog(null,"wrong password");
53
}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Connection");
}
}
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
setVisible(false);
new RegisterUser().setVisible(true);
}
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
setVisible(false);
new index().setVisible(true);
}
54
});
}
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JPanel jPanel1;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
// End of variables declaration
}
55
String email=jTextField1.getText();
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","root","123
4");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select securityQ from student where
email='"+email+"'");
if(rs.next())
{
jTextField2.setText(rs.getString(1));
}
else
JOptionPane.showMessageDialog(null,"Please write correct email");
con.close();
rs.close();
}
catch(Exception e)
{
}
}
try
{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/project","root","123
4");
Statement st=con.createStatement();
56
ResultSet rs=st.executeQuery("select *from student where email='"+email+"'
and answer='"+answer+"'");
if(rs.next())
{
st.executeUpdate("update student set password='"+newPassword+"' where
email='"+email+"' and answer='"+answer+"'");
JOptionPane.showMessageDialog(null,"Your Password is Successfully
updated");
setVisible(false);
new LoginUser().setVisible(true);
}
else
JOptionPane.showMessageDialog(null,"Please write correct Email or
Answer");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Error in Connection");
}
}
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
setVisible(false);
new LoginUser().setVisible(true);
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ForgetPassword().setVisible(true);
}
});
}
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JButton jButton5;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
57
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JPasswordField jPasswordField1;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
}
Connection Provider:
package Project;
import java.sql.*;
public class ConnectionProvider {
public static Connection getCon()
{
try{
Class.forName("com.mysql.jdbc.Driver");
Connection
con=DriverManager.getConnection("jdbc:mysql://localhost:3306/qems","root","1234
");
return con;
}
catch(Exception e)
{
return null;
}
}
}
Quiz Page:
}
import Project.ConnectionProvider;
import java.util.Date;
import java.sql.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import javax.swing.JOptionPane;
58
import javax.swing.Timer;
public class QuizPage extends javax.swing.JFrame {
if(studentAnswer.equals(answer))
{
marks=marks+1;
String marks1=String.valueOf(marks);
jLabel8.setText(marks1);
}
//clear jRadioButton
jRadioButton1.setSelected(false);
59
jRadioButton2.setSelected(false);
jRadioButton3.setSelected(false);
jRadioButton4.setSelected(false);
answerCheck();
try
{
Connection con=ConnectionProvider.getCon();
60
Statement st=con.createStatement();
st.executeUpdate("update question set marks='"+marks+"'");
String marks1=String.valueOf(marks);
setVisible(false);
new Successfully(marks1).setVisible(true);
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e);
}
}
/**
* Creates new form QuizPage
*/
public QuizPage() {
initComponents();
//date
SimpleDateFormat dFormat=new SimpleDateFormat("dd-MM-yyyy");
Date date=new Date();
jLabel10.setText(dFormat.format(date));
//timer program
setLocationRelativeTo(this);
time=new Timer(1000,new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
jLabel15.setText(String.valueOf(sec));
jLabel14.setText(String.valueOf(min));
if(sec==60)
{
sec=0;
min++;
if(min==10)
{
time.stop();
answerCheck();
submit();
}
}
sec++;
61
}
});
time.start();
Timer time;
private void jRadioButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(jRadioButton1.isSelected())
{
jRadioButton2.setSelected(false);
jRadioButton3.setSelected(false);
jRadioButton4.setSelected(false);
}
}
62
answerCheck();
question();
}
}
}
}
}
63
jRadioButton1.setSelected(false);
jRadioButton2.setSelected(false);
jRadioButton3.setSelected(false);
}
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new QuizPage().setVisible(true);
}
});
}
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JRadioButton jRadioButton1;
private javax.swing.JRadioButton jRadioButton2;
private javax.swing.JRadioButton jRadioButton3;
private javax.swing.JRadioButton jRadioButton4;
// End of variables declaration
}
64
5.3 Testing Approach
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. These are
various types of testing. Some of which are mentioned below :
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.
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.
65
To help developers to understand the testing code base and enable them to make changes
quickly.
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.
It helps find problems and resolve them before further testing so they won’t impact other
bits of code.
It makes the process of debuggung easier.
Beta testing is performed in order to accss the product by exposing itto 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 furtherr and leads to its
success. It hels he software product to provide better user experiance. This also helps in decision
66
making to invest further in the products or the same product forr improvisation. Since Beta
Testing happens at the end user’s side, it cannot be the controlled activity.
Beta testing helps in providing the actual position of the quality. Beta testing generally is
done for testing software products like utilities, operating systems and application etc.
Beta testing focuses on the customers satisfaction.
It helps to reduce the risk of project failure via user validations.
Beta testing helps to get direct feedback from users.
It helps to detect the defect and issues in the system. which is overlooked and undetected
by the team of software testers.
Beta tsting helps the user to install, test and send feedback regarding the developed
software.
67
5.5 Test Cases
Module Name : Login
68
Button
TC_LOGIN_ verify the Enter Need a Enter <valid A
005 login of valid valid user usernam message
student userna Gmail name e> “The
me and Acont to Enter <invalid username
invalid do login Passwo passwor and
passwo rd d> password
rd Click is
without “Login incorrect”
numeri ” is shown
c value Button
TC_LOGIN_ verify the Enter Need a Enter <valid A
006 login of valid valid user usernam message
student userna Gmail name e> “The
me and Acont to Enter <invalid username
empty do login Passwo passwor and
passwo rd d> password
rd Click is
“Login incorrect”
” is shown
Button
TC_LOGIN_ verify the Enter Need a Enter <valid A
007 login of empty valid user usernam message
student userna Gmail name e> “The
me and Acont to Enter <invalid username
valid do login Passwo passwor and
passwo rd d> password
rd Click is
“Login incorrect”
” is shown
Button
69
Module Name : Registration
70
student Mobile Acont to Number Number ng went
Numbe do login , Email ><valid wrong
r, ID, Email ID Please try
Email userna ><valid again
ID, me, username later” is
userna passwor ><valid shown
me, d and password><va
passwo Securit lid Security
rd and y Question
Securit Questio Answer>
y n
Questio Answer
n Click
Answer “Regist
er”
Button
TC_ verify the Enter Need a Enter <valid Name> A
Registrat Registrat valid valid Name, <valid Mobile message
ion _004 ion of Name, Gmail Mobile Number “Somethi
student Mobile Acont to Number ><invalid ng went
Numbe do login , Email Email ID wrong
r, ID, ><valid Please try
Email userna username again
ID, me, ><valid later” is
userna passwor password><va shown
me, d and lid Security
passwo Securit Question
rd and y Answer>
Securit Questio
y n
Questio Answer
n Click
Answer “Regist
er”
Button
TC_ verify the Enter Need a Enter <valid Name> A
Registrat Registrat valid valid Name, <valid Mobile message
ion _005 ion of Name, Gmail Mobile Number “Somethi
student Mobile Acont to Number ><valid ng went
Numbe do , Email Email ID wrong
r, Registrati ID, ><invalid Please try
Email on userna username again
ID, me, ><valid later” is
userna passwor password><va shown
me, d and lid Security
passwo Securit Question
71
rd and y Answer>
Securit Questio
y n
Questio Answer
n Click
Answer “Regist
er”
Button
TC_ verify the Enter Need a Enter <valid Name> A
Registrat Registrat valid valid Name, <valid Mobile message
ion _006 ion of Name, Gmail Mobile Number “Somethi
student Mobile Acont to Number ><invalid ng went
Numbe do , Email Email ID wrong
r, Registrati ID, ><valid Please try
Email on userna username again
ID, me, ><invalid later” is
userna passwor password><va shown
me, d and lid Security
passwo Securit Question
rd and y Answer>
Securit Questio
y n
Questio Answer
n Click
Answer “Regist
er”
Button
TC_ verify the Enter Need a Enter <valid Name> A
Registrat Registrat valid valid Name, <valid Mobile message
ion _007 ion of Name, Gmail Mobile Number “Somethi
student Mobile Acont to Number ><valid ng went
Numbe do , Email Email ID wrong
r, Registrati ID, ><valid Please try
Email on userna username again
ID, me, ><valid later” is
userna passwor password><in shown
me, d and valid Security
passwo Securit Question
rd and y Answer>
Securit Questio
y n
Questio Answer
n Click
Answer “Regist
er”
Button
72
Module Name : Contact Us
73
Chapter 6
RESULTS AND DISCUSSIONS
6.1 Test Reports
EXECUTED PASSED 17
FAILED 0
TEST EXECUTED IN 17
TOTAL
PENDING 0
IN PROGRESS 0
BLOCKED 0
(PENDING+IN 17
PROGRESS+BLOCKED+TEST
EXECUTED)
74
6.2 User Documentation
Welcome page of Application: This is the welcome Page of Application
Home Page: This Home Page of Application. After Clicking „Lets Start‟ Button in Welcome
Page Home page will be displayed.
75
Admin Login Page: This is the Login Page for Admin of the system .
If the Admin enters incorrect details then the error message is displayed.
76
Add New Question Page: This is the Add Question Page where admin can add the question for
quiz.
Update Question Page: This is the Update Question Page where Admin can update question
includes question number, question options etc.
77
Delete Question Page: This is the Delete Question Page where admin can delete question from
the quiz.
All Question Page : This is the All question Page where admin can view all question.
78
Student Login Page: This is the Login page for student of the system.
If the Student enters incorrect details then the error message is displayed.
79
Registration Page : This is the Registration Page where new students can register on this page.
If the Student enters incorrect details then the error message is displayed.
80
Forgot Password Page: This is the Forgot Password Page for Student of the system. If student
forgot the password then he/she will reset password with the help of this page.
If the Student enters incorrect details then the error message is displayed.
81
Contact Us: This is the Contact Us page. With the help of Contact us page student can connect
directly with admin.
82
Quiz Schedule Page: This is the Quiz Schedule Page of the application. Student will get quiz
Schedule on this Page. He/She can attempt Quiz according to schedule.
83
Chapter 7
CONCLUSIONS
7.1 Conclusion
Quiz application provides facility to attempt 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 given Quiz in
application. User can register, log-in to atempt Quiz. If user forget thier password then he/ she
can reset password with the help of Forgot Pasword option. There is instruction page for students
o get imformation about quiz like number of question, given time etc. After that student get the
result of quiz. so, student cannot wait for result. also admin is resposible to add, delete and
update quetion in the system. also he can view result of all students.
It hass been a great pleasure for me to work on this exciting and challenging project. This
project proved good for me as it provided practical knowledge of programming in JAVA and
MYSQL server and also about all handling procedure related with Quiz System. It also provides
knowledge about the latest technology used in developing application and server technology tha
will be great demand in future. This will provide better opportunities and guidance in future in
developing projects independently. This Quiz Application can be efficiently used by any students
and Educational platforms. During the course of this assignment I have gone through many
obstacle which made me to research and aalso increase mu knowledge.
At last it can be concluded that the “Quiz Application” was the real learning experience.
The project has been made as per as the given specification. The sytem has been made as
userfriendly as possible.
84
7.2 Limitations of the System
The admin needs to be regularly be in contact with other users for any update in the
user’s information.
We want to implement a concept where user itself can add question for others.
We want to implement a concept where the user can solve any query related to each
question at that time only.
We also want to implement a concept where every user can see profile of other user.
The Scope of this project is very broad in terms of gaining knowledge and sharing
knowledge among world.
Can be used anywhere any time as it is a application.
This application will be used in educational institutions as well as in corporate world.
Reference:
https://en.wikipedia.org/
https://www.javatpoint.com/
https://www.w3schools.com/
https://www.tutorialspoint.com/
85