Sample
Sample
BACHELOR OF TECHNOLOGY
(Computer Engineering)
SUBMITTED TO
SUBMITTED BY
VISION
To become excellent knowledge enterprise.
MISSION
Creation of centre of excellence for learning and research in engineering & technology.
VISION
To produce professionally excellent, knowledgeable, globally competitive and socially
responsible computer engineers and entrepreneurs.
MISSION
I the undersigned solemnly declare that the project report Quiz Application using Java is based on my
own work carried out during our study under the supervision of Mrs. Meenakshi Chawla. I assert that the
statements made and conclusions drawn are an outcome of my Project work. I further certify that the
work contained in the report is original and has been done by our group under the general supervision of
my supervisor. The work has not been submitted to any other Institution for any other degree/diploma/
certificate in this university or any other University of India or abroad. We have followed the guidelines
provided by the university in writing the report. Whenever we have used materials (data, theoretical
analysis, and text) from other sources, we have given due credit other in the text of the report and giving
their details in the references.
Student’s Signature
ANANYA (20CE121)
i
Certificate
I hereby declare that the work presented in this report entitled “Quiz Application using Java” in
partial fulfillment of the requirements for the award of the degree of Bachelor of Technology in
Computer Engineering submitted in the department of Computer Engineering and Information
Technology, The Technological Institute of Textile & Sciences is an authentic record of my
own work carried out over a period from July 2023 to December 2023 under the supervision of
Mrs. Meenakshi Chawla.
Signature of Student
Ananya (20CE121)
Examined by:
ii
ACKNOWLEDGEMENT
I would like to express my sincere gratitude to our H.O.D. Dr. Jyoti Chaudhary,
Department of Computer Engineering, whose role as project guide was
invaluable for the project. I am extremely thankful for the keen interest she took
in advising me, for the books and reference materials provided and for the moral
support extended to me.
Also, I have a feel of immense gratitude towards my family, their moral boosting
and encouragement is a boon for me.
Student Name :
(Ananya)
Roll No.: 20CE121
iii
ABOUT PROJECT
The quiz application project is a dynamic and engaging platform designed to test and enhance
users' knowledge on various topics. Built with a user-friendly interface, the application
provides a seamless experience for participants to navigate through a diverse range of quizzes,
spanning subjects such as science, history, pop culture, and more. Users can choose quizzes
based on their interests and skill levels, making the platform suitable for both casual learners
and those seeking a more challenging experience.
The application incorporates features like real-time scoring, instant feedback on answers, and
a leaderboard to foster a sense of competition and motivation among users. Additionally, the
project leverages technologies such as responsive design to ensure accessibility across
different devices, creating a flexible and inclusive learning environment. The quiz application
aims not only to entertain but also to educate, serving as a valuable tool for individuals
looking to expand their knowledge in a fun and interactive way. Whether used for self-
assessment or friendly competition, the quiz application project provides a versatile and
engaging platform for continuous learning.
iv
TABLE OF CONTENTS
1 Chapter 1: Introduction 1
2 Chapter 2: Literature Review and 2-4
technology used
3 Chapter 3: Project Work 5-6
3.1 Objectives 5
3.2 DFD 5
3.3 H/W and S/W used 6
4 Chapter 4: Result and Discussion 7-21
4.1 Code 7
4.2 Screenshot 20
5 Chapter 5: Conclusion and 23-24
Future Scope
Chapter 1: Introduction
This “Quiz application” in Java is a software program designed to facilitate interactive quizzes or
assessments, typically for educational, training, or entertainment purposes. This application allows
users to answer a series of questions, and receive their scores or performance summaries at the end.
This application can commonly be used in schools, online learning platforms, and various other
contexts where knowledge assessment is required
This quiz application includes:
1. User Interface (UI):
The user interface is an essential component of any quiz application. It provides the
interaction point between the user and the quiz questions. The UI includes:
A welcome screen with instructions and a start button.
Question presentation with options
Navigation controls (next, previous, submit).
A timer (to impose time limits).
A score display.
4. Timer Functionality:
The quiz has a time limit for each question for which the timer functionality is
implemented.
Java's Timer or TimerTask classes can be used to manage time constraints.
8. Deployment:
The application is now ready for its execution.
1
Chapter 2: Literature Review and Technology Used
A literature review on quiz applications reveals a growing body of research focused on the
intersection of technology and education. Studies emphasize the potential of quiz applications to
enhance learning outcomes and engagement. Research by Hwang and Wu (2014) discusses the
benefits of mobile-assisted language learning through quiz applications, highlighting the positive
impact on vocabulary acquisition and language proficiency. This underscores the versatile
applications of quiz platforms beyond traditional subject areas.
Additionally, investigations into gamified learning platforms, such as quiz applications, have
demonstrated their ability to foster intrinsic motivation and active participation among learners.
Incorporating elements of gamification, such as points, badges, and leaderboards, has been found to
positively influence user engagement and knowledge retention. These findings suggest that quiz
applications have the potential to not only assess knowledge but also serve as effective tools for
promoting a playful and motivational learning environment.
Furthermore, the literature highlights the importance of adaptive learning features in quiz
applications. Research by Shute and Kim (2014) emphasizes the value of personalized feedback and
adaptive content delivery to cater to individual learning styles and preferences. This customization
enhances the effectiveness of quiz applications as educational tools, ensuring that users receive
targeted support and challenges based on their unique needs. Overall, the literature supports the
notion that quiz applications, when thoughtfully designed and aligned with pedagogical principles,
can play a significant role in modern educational strategies, providing engaging and effective
learning experiences.
-Core Java
Core Java refers to the fundamental and foundational components of the Java programming
language. It encompasses the basic features, libraries, and syntax that every Java developer should
be familiar with before delving into more advanced topics or specialized areas of Java
development. Core Java provides the essential building blocks for developing a wide range of
applications, from simple command-line tools to complex enterprise-level systems.
Core Java serves as a strong foundation for various application domains, including web
development (Java EE), mobile development (Java ME), and big data (Hadoop). It is often the
starting point for Java developers, providing them with the essential skills and knowledge needed
to create reliable, platform-independent, and scalable Java applications. Two main requirements
from core java for the development of this quiz application are:
1) Java Swing
Java Swing is a powerful and versatile GUI (Graphical User Interface) toolkit that is part of the
Java Standard Library. It allows Java developers to create rich, interactive, and platform-
independent desktop applications with a modern and consistent look and feel. Swing is an
integral part of Core Java and is often used for building applications ranging from simple
desktop utilities to complex enterprise software.
3
2) AWT
Java AWT, or Abstract Window Toolkit, is one of the original GUI (Graphical User
Interface) libraries provided by Java for creating platform-independent graphical user
interfaces for desktop applications. AWT was introduced with the first version of Java
and serves as the foundation for other GUI libraries like Swing and JavaFX.
Visual Studio Code (VS Code) is a popular, free, and open-source code editor developed by Microsoft.
It has gained widespread popularity among developers due to its versatility, rich set of features, and
extensive extension marketplace. Its combination of a lightweight design, extensibility, and robust
features has made it a top choice for many developers across different domains. Some key aspects and
features of Visual Studio Code are that it is cross platform, open source, comes with integrated
debugging, intelligent code editing, customizable interface, integrated terminal and IDE features.
4
Chapter 3: Project Work
3.1 Objectives
The objectives of a quiz application can vary depending on the target audience, educational
context, and specific goals of the developers. However, common objectives for a quiz
application typically include:
1. Knowledge Assessment:
Objective: To provide a platform for users to assess their knowledge on various
topics.
Rationale: The primary purpose of a quiz application is to evaluate users'
understanding of specific subjects or general knowledge. This objective is
fundamental for both educational and recreational quiz applications.
2. Engagement and Interactivity:
Objective: To engage users in an interactive and dynamic learning experience.
Rationale: The application should aim to captivate users' attention, making the
learning process enjoyable and encouraging active participation. Interactive
features, such as timed questions, multimedia content, and gamified elements,
contribute to increased engagement.
3. Learning Reinforcement:
Objective: To reinforce learning through instant feedback and explanations.
Rationale: Providing immediate feedback on users' responses helps in
reinforcing correct information and correcting misconceptions. This objective
aligns with educational principles that emphasize the importance of timely
reinforcement for effective learning.
4. Competition and Social Interaction:
Objective: To foster a sense of competition and social interaction among users.
Rationale: Including features such as leaderboards, achievements, and the ability
to challenge friends creates a competitive yet collaborative environment. Social
elements contribute to increased user motivation and a sense of community.
5. Accessibility and User-Friendliness:
Objective: To ensure the application is accessible across various devices and
user-friendly.
Rationale: A well-designed and accessible interface promotes ease of use,
making the application inclusive for a diverse user base. Compatibility with
different devices and platforms enhances the reach and usability of the quiz
application.
A comprehensive Data Flow Diagram (DFD) for a quiz application involves illustrating the flow of
data within the system. Below is a simplified representation, incorporating major components and
interactions.
1. Processes:
User Registration/Login: The process of user registration and login involves the creation
of user accounts or authentication of existing users.
Quiz Creation: This process allows quiz creators to generate new quizzes, including
questions, options, and correct answers.
Quiz Taking: Users engage in taking quizzes, answering questions, and submitting
responses.
5
Scoring and Feedback: The system evaluates user responses, calculates scores, and
provides feedback on correct and incorrect answers.
Result Generation: After completing a quiz, the system generates and displays results,
including scores and performance summaries.
2. Data Stores:
User Database: Stores user account information, including usernames, passwords, and
other relevant details.
Quiz Database: Contains data on quizzes, including questions, answer options, correct
answers, and metadata.
Result Database: Stores user quiz results, including scores, completion time, and
performance details.
3. Data Flows:
User Registration/Login Data Flow: User details flow from the user interface to the User
Database during registration/login processes.
Quiz Creation Data Flow: Quiz content, including questions and answers, is stored in the
Quiz Database.
Quiz Taking Data Flow: User responses flow from the user interface to the system for
evaluation.
Scoring and Feedback Data Flow: Results, including scores and feedback, are
communicated back to the user interface.
Result Generation Data Flow: Quiz results are stored in the Result Database for later
retrieval and analysis.
1. Server:
Processor: Multi-core processor (e.g., Intel Xeon, AMD Ryzen)
RAM: 8GB or higher
Storage: 50GB or more
2. Database Server:
DBMS: (e.g., MySQL, PostgreSQL)
RAM: 4GB or more
3. Networking:
Internet Connection: High-speed connection
4. Client Devices:
Desktops, Laptops, Tablets, and Smartphones: Standard configurations
1. Server-Side:
Operating System: Linux (e.g., Ubuntu) or Windows Server
Java: JDK 8 or later
Web Server: (e.g., Apache Tomcat, Jetty)
2. Database:
Connector: JDBC Driver
3. Development Tools:
IDE: (e.g., IntelliJ IDEA, Eclipse, VS Code)
6
Chapter 4: Result and Discussion
Login.java file
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("login.jpeg"));
JLabel image = new JLabel(i1);
image.setBounds(0,0,600,500);
add(image);
7
rules = new JButton("Rules");
rules.setBounds(735,270,120,25);
rules.setBackground(Color.BLUE);
rules.setForeground(Color.BLUE);
rules.setFont(new Font("Times New Roman",Font.BOLD,14));
rules.addActionListener(this);
add(rules);
setSize(1200,500);
setLocation(150, 200);
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[])
8
{
new Login();
}
}
Rules.java file
import javax.swing.*;
import java.awt.*;
public class Rules extends JFrame{
String name;
Rules(String name){
this.name = name;
getContentPane().setBackground(Color.WHITE);
setLayout(null);
setSize(800,650);
setLocation(350,100);
setVisible(true);
9
}
public static void main(String args[])
{
new Rules("User");
}
}
Quiz.java file
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
String name;
Quiz(String name) {
this.name = name;
setBounds(50, 0, 1440, 850);
getContentPane().setBackground(Color.WHITE);
setLayout(null);
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][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[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[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";
12
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";
start(count);
setVisible(true);
14
}
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) {
15
useranswers[count][0] = "";
} else {
useranswers[count][0] = groupoptions.getSelection().getActionCommand();
}
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) {
16
e.printStackTrace();
}
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();
}
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();
}
Score.java file
import java.awt.*;
import javax.swing.*;
18
import java.awt.event.*;
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);
setVisible(true);
}
19
public void actionPerformed(ActionEvent ae) {
setVisible(false);
new Login();
}
20
21
22
Chapter 5: Conclusion and Future Scope
5.1 Conclusion
Furthermore, the application's versatility accommodates a wide range of subjects and learning styles,
promoting a holistic approach to knowledge acquisition. As a result, it becomes a valuable resource
for self-assessment, skill enhancement, and fostering a community of knowledge enthusiasts.
Ongoing refinements, responsive design for various devices, and robust security measures contribute
to the application's longevity and relevance in the ever-evolving landscape of educational tools. In
essence, the quiz application stands as a beacon of innovation, embodying the fusion of technology
and education to create an interactive, enjoyable, and effective learning experience for users
worldwide.
The future scope of quiz applications is promising, with several potential developments and
advancements on the horizon:
23
Real-Time Collaborative Quizzing:
Collaborative learning is gaining prominence, and future quiz applications might facilitate real-time
collaborative quizzing. Users could join forces to answer questions collectively, fostering teamwork,
communication, and knowledge-sharing among participants.
Gamification Enhancements:
The gamification elements in quiz applications may evolve with more sophisticated features, such as
advanced leaderboards, virtual rewards, and interactive storytelling. These enhancements could further
motivate users and create a more immersive learning and gaming experience.
Integration with Emerging Technologies: As new technologies emerge, quiz applications may
integrate with cutting-edge innovations such as natural language processing, voice recognition, and
gesture control. These integrations could enhance user interfaces and create more diverse and
accessible ways for users to interact with quizzes.
24
BIBLIOGRAPHY
Books-
Websites-
https://www.w3schools.com/java/java_intro.asp
https://www.programiz.com/java-programming
https://www.digitalocean.com/community/tutorials/java-design-patterns-example-tutorial
https://www.geeksforgeeks.org/java-awt-tutorial/
25