Ajeenkya DY Patil School of Engineering (Charholi) Via Lohegaon, Pune-412 105
Ajeenkya DY Patil School of Engineering (Charholi) Via Lohegaon, Pune-412 105
On
Submitted By:
SEMESTER V 2024-25
CERTIFICATE
This is to certify that report titled ONLINE CLASS TEST
is submitted in the partial fulfillment of requirement for the award of the
Diploma in Computer Engineering by Maharashtra State Board of Technical
Education as record of students' own work carried out by them under the
guidance and supervision at Ajeenkya DY Patil School Of Engineering
(Charholi), during the academic year 2024-25.
Place: Charholi(BK)
Date: / /2024
1. Brief Introduction:
Creating an online class test application using Java, specifically with the Swing
framework, involves designing a graphical user interface (GUI) that facilitates the
creation, administration, and management of tests in a digital environment. Implement
login and registration functionalities for students and instructors.
Secure authentication mechanisms to ensure user data privacy.
Allow instructors to create tests with various question types, such as multiple-choice,
true/false, and short answer.
Provide options for setting time limits and randomizing questions.
Set up the development environment with necessary tools and libraries (e.g., Java
Development Kit, Swing libraries). Use Swing components to build the application's
interface. Design forms for login, test creation, test taking, and results viewing.
The Swing Components are lightweight. Swing Supports a Pluggable look and feels
And Swing provides more powerful components such as tables, lists, Scrollpanes,
Colourchooser, tabbedpane, etc
Name of
Sr. No. Specification
resources/Material
Introduction
Swing is a Java Foundation Classes [JFC] library and an extension of the Abstract
Window Toolkit [AWT]. Swing offers much-improved functionality over AWT, new
components, expanded components features, and excellent event handling with drag-
and-drop support. Swing is a Set Of API ( API - Set Of Classes and Interfaces). Swing
is Provided to Design Graphical User Interfaces
Desktop Applications: Ideal for creating complex, rich GUI desktop applications..
Prototyping: Useful for quickly prototyping application interfaces.
Often used in educational environments to teach GUI development in Java..
ONLINE CLASS TEST
Creating an online class test with Swing in Java refers to the process of developing a
desktop application that enables the creation, administration, and management of online tests.
The application leverages the Swing framework to provide a visually appealing and
interactive interface for users.
Instructor Tools
These tools are designed to assist instructors in creating, managing, and analyzing tests:
Test Creation: Instructors can design tests with various question types (multiple-
choice, true/false, short answer, etc.).
Test Scheduling: Set the date and time for when tests will be available.
Question Banks: Store and reuse questions for different tests.
Results Analysis: Automatically grade tests and provide detailed performance
reports.
Student Management: Track student progress and performance over time.
2. Student Interface
These features are aimed at providing a seamless test-taking experience for students:
Test Taking: Students can take tests within a specified time frame with features like
timers and submission options.
Instant Feedback: Get immediate results and feedback after submitting a test (if
enabled by the instructor).
Progress Tracking: View test scores and progress over time.
ALGORITHM
Step 1: Start
Step 2: Select the right answers of the questions
Step 3: Click on the next button
Step 4: Complete all the questions
Step 5: Check the results by clicking on RESULT button
Step 5: Message Dialog appears which shows the number of correct answers.
Step 6: Enter OK
Step 8: Stop.
Program Code (Length)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import
javax.swing.BorderFactory;
import
javax.swing.border.Border;
b1.setBackground(Color.green);
b1.setBorder(border);
b1.setForeground(Color.black);
b2.setBackground(Color.blue);
b2.setBorder(border);
b2.setForeground(Color.white);
b1.addActionListener(this);
b2.addActionListener(this);
f.add(b1);f.add(b2);
set();
l.setBounds(30,40,700,20);
jb[0].setBounds(50,80,150,20);
jb[1].setBounds(50,110,150,20);
jb[2].setBounds(50,140,150,20);
jb[3].setBounds(50,170,150,20);
b1.setBounds(100,240,150,30);
b2.setBounds(270,240,150,30);
f.setDefaultCloseOperation(f.EX
IT_ON_CLOSE);
f.setLayout(null);
f.setLocation(550,450);
f.setVisible(true);
f.getRootPane().setBorder(Borde
rFactory.createMatteBorder(7, 7,
7, 7, Color.red));
f.setSize(700,400);
}
public void
actionPerformed(ActionEvent e)
{
if(e.getSource()==b1)
{
if(check())
count=count+1;
current++;
set();
if(current==9)
{
b1.setEnabled(false);
b2.setText("Result");
}
}
if(e.getActionCommand().equals
("Bookmark"))
{
JButton bk=new
JButton("Bookmark"+x);
bk.setBounds(480,20+30*x,100,
30);
add(bk);
bk.addActionListener(this);
m[x]=current;
x++;
current++;
set();
if(current==9)
b2.setText("Result");
setVisible(false);
setVisible(true);
}
for(int i=0,y=1;i<x;i++,y++)
{
if(e.getActionCommand().equals
("Bookmark"+y))
{
if(check())
count=count+1;
now=current;
current=m[y];
set();
((JButton)e.getSource()).setEnabl
ed(false);
current=now;
}
}
if(e.getActionCommand().equals
("Result"))
{
if(check())
count=count+1;
current++;
JOptionPane.showMessageDialo
g(this,"correct ans="+count);
System.exit(0);
}
}
void set()
{
jb[4].setSelected(true);
if(current==0)
{
l.setText("Que1: Which
class provides many methods for
graphics programming?");
jb[0].setText("java.awt");jb[1].set
Text("java.Graphics");jb[2].setTe
xt("java.awt.graphics");jb[3].setT
ext("None of the above");
}
if(current==1)
{
l.setText("Que2: By
Which methods you can set or
change the text in a label?");
jb[0].setText("setText()");jb[1].se
tText("getText()");jb[2].setText("
Both A &
B");jb[3].setText("None of the
above");
}
if(current==2)
{
l.setText("Que3: Public
class MenuBar
extends___________?");
jb[0].setText("MenuComponent"
);jb[1].setText("MenuContainer")
;jb[2].setText("ComponentMenu"
);jb[3].setText("MenuBar");
}
if(current==3)
{
l.setText("Que4:The
getContentPane() method is of
which class?");
jb[0].setText("JApplet");jb[1].set
Text("JFrame");jb[2].setText("JB
utton");jb[3].setText("None of
these");
}
if(current==4)
{
l.setText("Que5: MVC
architecture is ________?");
jb[0].setText("Modeling-
visual-
controller");jb[1].setText("Model
-view-
controll");jb[2].setText("Many-
View-
controller");jb[3].setText("Model
-viewable-controller");
}
if(current==5)
{
l.setText("Que6:Select
full form of DNS________?");
jb[0].setText("Data
Network
system");jb[1].setText("Domain
Name
System");jb[2].setText("Domain
Name
Server");jb[3].setText("Domain
Naming Service");
}
if(current==6)
{
l.setText("Que7: Which
event is genrated when the
position of scrollbar is changed?
");
jb[0].setText("AdjustmentEvent"
);jb[1].setText("MouseEvent");jb
[2].setText("keyEvent");jb[3].set
Text("ItemEVent");
}
if(current==7)
{
l.setText("Que8: UDP
Stands For___?");
jb[0].setText("User Data
Port");jb[1].setText("User data
provider");jb[2].setText("User
data protocol");
jb[3].setText("User Datagram
Protocol ");
}
if(current==8)
{
l.setText("Que9: Port
Number of FTP is____?");
jb[0].setText("21");jb[1].setText(
"80");jb[2].setText("25");jb[3].se
tText("23");
}
if(current==9)
{
l.setText("Que10: SQL
Stands For____?");
jb[0].setText("Structured
Qurey
Language");jb[1].setText("Sequentail Qurey
Language");jb[2].setText("Struct
ured Question Language");
jb[3].setText("sequentail Qurey
Language");
}
l.setBounds(30,40,450,20);
for(int
i=0,j=0;i<=90;i+=30,j++)
jb[j].setBounds(50,80+i,200,20);
}
boolean check()
{
if(current==0)
return(jb[0].isSelected());
if(current==1)
return(jb[0].isSelected());
if(current==2)
return(jb[3].isSelected());
if(current==3)
return(jb[1].isSelected());
if(current==4)
return(jb[1].isSelected());
if(current==5)
return(jb[2].isSelected());
if(current==6)
return(jb[0].isSelected());
if(current==7)
return(jb[3].isSelected());
if(current==8)
return(jb[0].isSelected());
if(current==9)
return(jb[0].isSelected());
return false;
}
public static void main(String
s[])
{
new OnlineExam("Online
Exams");
}
}
Output
Conclusion
It was a great experience to design and implement the Swing using Advanced
Java programming and also to work on its documentation. This project helped me in getting
the better understanding of Swings and AWT Components of Advanced Java Programming.
After doing this project, I am in position to explain concepts of Advanced Java Programming
and apply them to the modelling of real-world systems by utilizing its offered facilities. I am
now able to handle events of AWT and swing components and also develop programs using
networking concepts.
.