Jai Bhawani

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 68

Chandigarh Engineering College Jhanjeri

Mohali-140307
Department of Computer Science & Engineering

PROJECT REPORT
ON
ONLINE EXAMINATION SYSTEM

Project-I

Department of Computer Science and Engineering


CHANDIGARH ENGINEERING COLLEGE JHANJERI, MOHALI
In partial fulfillment of the requirements for the award of the Degree of
Bachelor of Technology in Computer Science & Engineering
SUBMITTEDBY: Under the Guidance of
RIKSHIT : 2027221 Amandeep kaur
SAHIL :2027225
MAY,2023

Affiliated to I.K Gujral Punjab Technical University, Jalandhar


(Batch: 2020-2024)
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

DECLARATION

I, sahil hereby declare that the report of the project entitled “online examination
management system” has not presented as a part of any other academic work to get my
degree or certificate except Chandigarh Engineering College Jhanjeri, Mohali,
affiliated to I.K. Gujral Punjab Technical University, Jalandhar, for the fulfillment of
the requirements for the degree of B.Tech in Computer Science & Engineering.

(Student SignaturewithDate) (Mentor Signature withDate)


(RIKSHIT : 2027221 ) AMANDEEP KAUR
(SAHIL: 2027225) TEACHER ASSISTANT
Semester: 6th

Signature of the Head of Department


(With Stamp)
Dr. Sahil Verma
DEAN (CSE,AI&DS and AIML)

I.
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

ACKNOWLEDGEMENT

It gives me great pleasure to deliver this report on the Project-I, I worked on for my B.Tech in
Computer Science & Engineering final year, which was titled “online examination system”. I
am grateful to my university for presenting me with such a wonderful and challenging
opportunity. I also want to convey my sincere gratitude to all coordinators for their unfailing
support and encouragement.
I am extremely thankful to Dr. SahilVerma, Dean of Computer Science & Engineering at
Chandigarh Engineering College Jhanjeri, Mohali (Punjab) for valuable suggestions and
heartiest co-operation.
I am also grateful to the management of the institute, Dr. Vinod Kumar, Director
Engineering, and Dr. AnupamShar, Director Academics, for giving me the chance to acquire
the information. I am also appreciative of all of my faculty members, who have instructed
me throughout mydegree.

(Signature of Student)

RIKSHIT PAUL
SAHIL

II.
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

TABLE OF CONTENTS
PARTICULARS PAGE NO

Title Page

Declaration by the candidate I.

Acknowledgment II.

Table of Contents III.

Abstract IV.

CHAPTER1 INTRODUCTION 1-5

1.1 Background of study. 3


1.2 Problem statement. 4
1.3 Objectives and scope ofstudy. 5
CHAPTER2 LITERATURE REVIEW 6-10

2.1 Introduction to java. 7-8


2.2 Methodology used. 9-10
CHAPTER3 ABOUT DEVELOPED PROJECT 11-20

3.1 System Requirement And Analysis. 12


3.2 System requirement. 13-15
3.3 Online Test System. 16-17
3.4 Feasible Study. 18-20

SCREENSHORTS 21-31

CODE 32-61

CONCLUSION 62

REFERENCES 63

III.
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

ABSTRACT

The aim of the project is to design the “online examination system”.The purpose of online
examination is to provide a good online test and save the time for papers checking. The prime
goal of online examination is to efficiently assess the applicant completely by the help of an
automated system that doesn’t only saves the time but also provide the resultsrapidly.An
online examination system is a web-based platform that allows educational institutions and
organizations to conduct tests and assessments for students and job applicants in a secure and
convenient way. This way help student to submit their paper according to them convenience
and the usability of paper and pen.Online Examination System for introduction to
management is an application that is designed and developed for students and lecturers. The
system helps students to take examination. It helps also lecturers to upload the questions and
answers in the database and they can see the students who fail or pass the exam. The major
objective of this web based online examination system is to competently evaluate the
student/candidate thoroughly through an automated system that not only saves a lot of time
but also gives fast, improved, and accurate results. It allows the students/candidate appearing
for the exam to give the test/papers according to their convenience from any location by
simply using internet and time over the manual/traditional pen and paper format. The online
examination system provides the student/candidate with a quick and easy way to show up for
the test/examination.

. IV.
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

Chapter-1

1 INTRODUCTION

The purpose of developing the "Online Examination System" is to address the issues present in the traditional
method of offline examination system. The purpose of online examination is to provide a good online test
and save the time for papers checking. The prime goal of online examination is to efficiently assess the
applicant completely by the help of an automated system that doesn’t only saves the time but also provide the
resultsrapidly.
An online examination system is a web-based platform that allows educational institutions and organizations
to conduct tests and assessments for students and job applicants in a secure and convenient way. This way
help student to submit their paper according to them convenience and the usability of paper and pen.

The scope of online examination project is so large in terms of else manually taking exams. Some of them
are listed below: It can be used in educational domain as well as within enterprise world. There’s facility to
use it anyplace and any time because it’s a web based application. The location of user doesn’t affect the
application. There’s no restriction that the controller or the examiner has to be present when assess is doing
theexam.

Computerized and online systems have been increasing in every aspect of education. Information
Technology plays a very important role in nowadays education. Computers and internet have made dramatic
changes in the education system. Information technology enables institution of high learning to save time and
money, and allow the delivery of education with easiness, anywhere, and anytime. Paper based books are
replaced by online and off-line applications. With computer software, we can be able to have access to huge
databases of information. This gives fundamental change to the education. Information technology makes the
exchanges of information fast and easily. In the modern era, technological progress has minimized the
information in the world. Advancement of technology has many advantages in education and all business
industries that use it.With the use of the technology advances,the transaction became more rapid,accurate

1
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

and efficient. As time goes by computers have become more useful for every transaction . Online
Examination System for introduction to management is an application that is designed and developed for
students and lecturers. The system helps students to take examination. It helps also lecturers to upload the
questions and answers in the database and they can see the students who fail or pass the exam. The major
objective of this web based online examination system is to competently evaluate the student/candidate
thoroughly through an automated system that not only saves a lot of time but also gives fast, improved, and
accurate results. It allows the students/candidate appearing for the exam to give the test/papers according to
their convenience from any location by simply using internet and time over the manual/traditional pen and
paper format. The online examination system provides the student/candidate with a quick and easy way to
show up for the test/examination.

Online Examination System is an on-line test simulator is to take online examination, test in an efficient
manner and no time wasting for manually checking of the test paper. The main objective of this web based
online examination system is to efficiently evaluate the student thoroughly through a fully automated system
that not only saves lot of time.

Online examination system helps students to offer a quick and easy way to appear for the test. It also
provides the results immediately after the examination with 100% accuracy and security. Student can enter to
perform exam only with their valid username and password. This examination contains multiple choice
questions and appropriate number of options. There are no limitations on number of options and it can be
randomized so same set of question will not appear to all student so it prevent manipulation. More than one
option can be correct but the user can select only one option. This provides time limit. The user can see their
results after completing the exam. This helps the students to write the exam from far distance and which can
provide security and simplicity and other beneficial features to the user. With proper planning and
implementation, an online examination system can be an effective tool for conducting assessments in a
convenient and securemanner.

2
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

1.1 BACKGROUND OF STUDY.

Computerized and online systems have been increasing in every aspect of education. Information
Technology plays a very important role in nowadays education. Computers and internet have made dramatic
changes in the education system. Information technology enables institution of high learning to save time and
money, and allow the delivery of education with easiness, anywhere, and anytime. Paper based books are
replaced by online and off-line applications. With computer software, we can be able to have access to huge
databases of information. This gives fundamental change to the education. Information technology makes
the exchanges of information fast and easily. In the modern era, technological progress has minimized the
information in the world. Advancement of technology has many advantages in education and all business
industries that use it. With the use of the technology advances, the transaction became more rapid, accurate
and efficient. As time goes by computers have become more useful for every transaction. Online
Examination System for introduction to management is an application that is designed and developed for
students and lecturers. The system helps students to take examination. It helps also lecturers to upload the
questions and answers in the database and they can see the students who fail or pass theexam.

3 .
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

1.2 PROBLEMSTATEMENT.

The problem with the current system is that students take their exam manually. This outdated system will take
long time utilization; the manual procedure used for conducting exam is time consuming process. More time
being used for lecturers to bringthe questions papers and answer sheets and also more time is needed for
students in order to write their exam, student are not satisfy with the current system of taking the multiple
choice examination. The no accuracy with current system when student did not use a 2b pencil student are
losing they are mark. Using the manual procedure of conducting examination we not saving the environment
by using more paper, we are in the world where really need to take care of the environment.

4 .
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

1.3 OBJECTIVES AND SCOPE OF STUDY

This project is aimed at developing an online examination system for introduction to management for students
and lecturers. The purpose of the system is to completely automate the old manual procedure of conducting
exam to a computerized System. I willprovide a more efficient examination system.

The system will allow students to register and take the exam. It enables also lecturers to perform many tasks.
The system has several functions. The users will do the registration before using the system. The lecturers
can upload questions and answers; he can view the list of all students who take the exam. He can view the
list of students who have grade A, grade B, grade C, grade D and those who fail the exam. The lecturers can
send emails. Once logging, the students can choose the subject and take the exam. After finishing using the
software the users have a logout function that allows them to signout. This is because the system wants to
ensure no external users can exploit thesystem.

5 .
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

CHAPTER 2

LITERATURE REVIEW

Computerized systems have been increasing in education nowadays. Information Technology plays a very
important role in education. Computers have made dramatic changes in the learning system. Information
technology enables education institutions to save space and time, and allow the delivery of education services
with easiness, anywhere, and anytime. For instance physical libraries are replaced by online libraries available
to anyone; anywhere in the world students can interact with lecturers online whether live or via video. With
computer software, we can be able to have access to huge databases of information. This gives fundamental
change to the education system. Information technology makes the exchanges of information fast and easily.

With the growth of IT a lot of data can be found in online library. We don’t need to have a physical library in
order to read books. Computers are a powerful tool used in all aspects of our studies. We use multimedia
technologies to convey ideas, build projects.

Information technology enables students to do distance learning, method of learning at a distance instead of
learning in a classroom. Communications technologies create possibilities, both individual and institutional,
for an unprecedented expansion of home- based learning, much of it part-time.

Information technology provides systems that allow students to perform many tasks in an automatic way
and not manually. Students can take exam using computerized system; they don’t need paper-based exam.
They save time and money when using computer system in their studies.

6 .
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

2.1 INTRODUCTION TO JAVA

What is Java?
The term Java is actual refers to more than just a particular language like C or Pascal. Java encompasses
several parts, including:

A high level language – The Java language is high level one that at a glance looks very similar to C and C++
but offers many unique features of its own.

Java bytecode – A compiler, such as Sun’s javac, transforms the Java language source code to bytecode that
runs in the JVM.

Java Virtual Machine (JVM) – A program, such as Sun’s java, that runs on a given platform and takes the
bytecode programs as input and interprets them just as if it were a physical processor executing machine code.

Features in Java:
Here we list the basic feature that make Java a powerful and popular programming language.

• Platform Independence

The Write – Once – Run – Anywhere idea has not been achieved by any other language, but it is present in
Java language.

• ObjectOriented

Object oriented throughout – no coding outside of class definitions, including main().

An extensive class library available in the core language packages.

• Compiler/InterpreterCombo

Code is compiled to bytecode that are interpreted by a Java virtual machine (JVM).

This provides portability to any machine for which a virtual machinehas been written.

7
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

The two steps of compilation and interpretation allow for extensive code checking and improved security.

• Robust

Exception handling built – in, strong type checking, local variables must be initialized.

• Several dangerous features of C & C++eliminated:

✓ No memorypointers

✓ Nopreprocessor

• Security

✓ No memorypointers

✓ Programs run inside the virtual machine sandbox

✓ Array index limit checking

✓ Code pathologies reducedby

✓ Bytecode verifier – checks classes afterloading

✓ Class loader – confines objects to unique namespaces. Prevents loading a hacked “-


java.lang.securitymanager”class.

✓ Security manager – determines what resources a class can access such as reading and writing to
the localdisk.

• DynamicBinding

The linking of data and methods to where they are located, is done at run –time.

New classes can be loaded while a program is running. Linking is done on the fly.

Even if libraries are recompiled, there is no need to recompile code that uses classes

those libraries.

8
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

2.2 METHODOLOGY USED

JDBC
JDBC is a Java API for executing SQL statements. It consists of a set of classes and interfaces written in
JAVA programming language. JDBC provides a standard API for tool/database developers and makes it
possible to write database applications using a pure JAVA API. Basic JDBC interaction in its simplest form
can be broken down into few steps:
ESTABLISHING A CONNECTION
The first thing you need to do is establish a connection with the DBMS you want to use. This
involves two steps:
(1) Loading thedriver
(2) Making theconnection.

(1) LoadingDrivers:
Loading the driver or drivers you want to use is very simple and involves just one line of code.

If,

for example, you want to use the JDBC-ODBC Bridge driver, the following code will load it:

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

Your driver documentation will give you the class name to use. For instance, if the class name is
jdbc.DriverXYZ, you would load the driver with the following line of code:

Class.forName("jdbc.DriverXYZ");

You do not need to create an instance of a driver and register it with the DriverManagerbecause
calling Class.forNamewill do that for you automatically. If you were to create your own
instance, you would be creating an unnecessary duplicate, but it would do no harm.

When you have loaded a driver, it is available for making a connection with a DBMS.
9
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

(2) Making theConnection:

The second step in establishing a connection is to have the appropriate driver connect to the DBMS.
The following line of code illustrates the general idea:
Connection con = DriverManager.getConnection(url,"myLogin", "myPassword");

This step is also simple, with the hardest thing being what to supply for url. If you are using the JDBC-
ODBC Bridge driver, the JDBC URL will start with jdbc:odbc: . The rest of the URL is generally your
data source name or database system. So, if you are using ODBC to access an ODBC data source called "
Fred, " for example, your JDBC URL could be jdbc:odbc:Fred. In place of "myLogin" you put the name
you use to log in to the DBMS; in place of "myPassword" you put your password for the DBMS. So if you
log in to your DBMS with a login name of " Fernanda" and a password of " J8, " just these two lines of
code will establish a connection:

String url = "jdbc:odbc:Fred";

Connection con = DriverManager.getConnection(url, "Fernanda", "J8");

10
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

CHAPTER 3

ABOUT DEVELOPED PROJECT


The project developed by me is based on ONLINE TEST.

The various features of this project is described below:-

ONLINE TEST:-

In Online Test user can

• Register andlogin.

• Read testdetails

• Type theanswers

• Seeresult

11
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

3.1 SYSTEM REQUIREMENT AND ANALYSIS

CHOICE OF PLATFORM:-

Java actual refers to more than just a particular language like C and Pascal. Java encompasses several parts
including the Java language is a high language is a high level one that at a glance looks very similar to C and
C++ but offers many unique features of its own. A compiler, such as Sun’s javac, transforms the Java language
source code to bytecode that run in JVM. Platform Independence the write-once-run-anywhere ideal has not
been achieved, but closer than with other languages. Object Oriented throughout – no coding outside of class
definitions, including main(). .An extensive class library available in the core language packages. Compile
/Interpreter Combo Code is compiled to bytecodes that are interpreted by Java virtual machine (JVM). This
provides portability to any machine for which a virtual machine has been written. The two steps of compilation
and interpretation allow for extensive code checking and improved security. A program, such as sun’s java, that
runs on a given platform and takes the bytecode programs as input and interprets them just as if it were a
physical processor executing machine code. Robust exception handling built-in, strong type checking, local
variables must be initialized. Several dangerous features of C and C++ eliminated no memory pointers,
preprocessor, array index limit checking. Automatc memory management handeled by JVM.

12
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

3.2 SYSTEM REQUIREMENTS

HARDWARE REQUIREMENTS:-

➢ Processor : 1.70GHz andAbove

➢ Main Memory : 512MB

➢ Hard Disk : 20GB

➢ Disk Space : 100MB

➢ Floppy Disk Drive : 1.44MB

➢ Keyboard :Any

➢ Mouse :Any

➢ Monitor :Any

➢ CD ROM Drive :Any

13
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

SOFTWARE REQUIREMETS :-

Operating System :
Any Platforms.

Application Software :
Notepad++, Notepad, Netbeans, JDK 1.6 And JDK 1.7.

System Software :
Command Prompt.

14
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

JAVA VIRTUAL MACHINE (JVM) –

A program, such as Sun’s java , that runs on a given platform and takes the bytecode programs as input and
interprets them just as if it were a physical processor executing machine code.

Sun provides a set of programming tools such as javac, java and others in a bundle that it calls a java Software
development Kit for each version of the language an d for different platforms such as Windows, Linux, etc.Also
provides a runtime bundle with just the JVM when the programming tools are not needed. Note that because of
the open nature of java (see below), any or all of these parts can be replaced by non-Sun components.For, just as
many different languages can create machine code for a given processor, compilers of the other languages have
been created that output bytecode to run in JVM. Similarly, many JVMs have been written by groups outside of
Sun .100% speed of C++ programs those packages that come with the JDK for a given version will be referred
as comprising the core language, as distinguished from option or thirdpartypackages.

15
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

3.3 ONLINE TEST SYSTEM


Introduction:

The purpose of online examination is to provide a good online test and save the time for papers checking. The
prime goal of online examination is to efficiently assess the applicant completely by the help of an automated
system that doesn’t only saves the time but also provide the results rapidly. This way help student to submit
their paper according to them convenience and the usability of paper and pen. The scope of online examination
project is so large in terms of else manually taking exams. Some of them are listed below: It can be used in
educational domain as well as within enterprise world. There’s facility to use it anyplace and any time because
it’s a web based application. The location of user doesn’t affect the application. There’s no restriction that the
controller or the examiner has to be present when assess is doing theexam.

FEATURES:
1. Security
2. Easy toutilise
3. No need of controller orexaminer

Purpose:

The purpose of online examination is to provide a good online test and save the time for papers checking. The
prime goal of online examination is to efficiently assess the applicant completely by the help of an automated
system that doesn’t only saves the time but also provide the results rapidly. This way help student to submit
their paper according to them convenience and the usability of paper and pen

Scope:
The scope of online examination project is so large in terms of else manually taking exams. Some of them are
listed below: It can be used in educational domain as well as within enterprise world. There’s facility to use it
anyplace and any time because it’s a web based application. The location of user doesn’t affect the application.
There’s no restriction that the controller or the examiner has to be present when assess is doing theexam

16
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

Online test advantages for both the teachers and the students :
Advantages for the students :

➢ It gives us instant feedback, unlike paper examinations in a traditional classroom learningsession.


➢ It gives us the option of taking practice tests whenever we wantas
➢ Some assessments are Internet-based, and this allows students to take the test at home or anywherewe want
.
➢ There is no cheating.

For the teacher :

➢ Teacher can distribute multiple versions of the exams and assignments without having to manually
monitor which students got which tests.
➢ It allows the teacher to quickly evaluate the performance of the group.
➢ It takes up less time and effort .
➢ All data can be stored on a single server.
➢ Teachers can mix and match the question styles on exams, including graphics and make them more
interactive than paper exams.
➢ Eliminates human error in grading.

Disadvantages for students :

➢ Not all students can use the computer very well.


➢ It doesn’t give teachers the options to see your line of thinking to get to youranswer.

For the teacher :


➢ Technology isn't always reliable. Information can be lost if a system breaksdown.
➢ In some cases, teachers need some technical expertise to createexams.
➢ 4- Testing online is not suitable for essay writing and analysis or cognitive thinkingtesting.
17
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

3.4 FEASIBILITY STUDY

FEASIBILITY ANALYSIS
It is wise to think about the feasibility of any problem we undertake. Feasibility is the study of impact, which
happens in the organization by the development of a system. The impact can be either positive or negative.
When the positive nominate the negatives, then the system is considered feasible. Here the feasibility study can
be performed in three ways.
On the basis of three modules:
➢ EconomicallyFeasibility
➢ TechnicalFeasibility
➢ BehavioralFeasibility
ECONOMIC FEASIBILITY:
Economic analysis is most frequently used for evaluation of the effectiveness of the system. More commonly
known as cost/benefit analysis the procedure is to determine the benefit and saving that are expected from a
system and compare them with costs, decisions is made to design and implement the system. This part of
feasibility study gives the top management the economic justification for the new system. This is an important
input to the management the management, because very often the top management does not like to get
confounded by the various technicalities that bound to be associated with a project of this kind. A simple
economic analysis that gives the actual comparison of costs and benefits is much more meaningful in such
cases. In the system, the organization is most satisfied by economicfeasibility.
Technical feasibility:
We can strongly say that it is technically feasible, since there will not be much difficulty in getting required resources for
the development and maintaining the system as well. All the resources needed for the development of the software as well
as the maintenance of the same is available and we are utilizing the resources which are available already. Technical
feasibility centreson the existing manual system of the test management process and to what extent it can support the
system. According to feasibility analysis procedure the technical feasibility of the system is analysed and the technical
requirements such as software facilities, procedure, inputs are identified. It is also one of the important phases of the
system development activities. The system offers greater levels of user friendliness combined with greater processing.

18
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

Behavioral Feasibility:
People are inherently resistant to change and computer has been known to facilitate changes. An estimate
should be made of how strong the user is likely to move towards the development of computerized system.
These are various levels of users in order to ensure proper authentication and authorization and security of
sensitive data of the organization.

Working of Present System


In the present system all work is done on paper. The whole result is stored in result table and at the end of the
test the reports are generated. We are not interested in generating report in the middle of the test or as per the
requirement because it takes more time in calculation. At the end of test ,a notice is shown to students.

Disadvantages of present working system

• Not UserFriendly:
The existing system is not user friendly because the retrieval of data is very slow and data is not maintained
efficiently.

• Difficulty in resultgenerating:
We require more calculations to generate the result so it is generated at the end of the test. And the student not
gets a single chance to correct their answer after the submission of question by pressing the next button.

• Manual control:
All calculations to generate result is done manually so there is greater chance of errors.

• Lots of paperwork:
Existing system requires lot of paper work. Loss of even a single register/record led to difficult situation
because all the papers are needed to generate the reports.

19
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

• Timeconsuming:
Every work is done manually so we cannot generate report in the middle of the test or as per the requirement
because it is very time consuming.
Key Advantages for Online Exam:
▪ Costeffective:
▪ Substantial cost reduction in the expenses of conducting anexam:
▪ No Printing or Distribution Expenses for questionpapers.
▪ No transport and logistics expenses while conducting exams across several geographically scattered
locations.
User Convenience:
▪ Users can take exams as per their convenience .Exams can be configured for 24X7availability.
▪ Users can view the exam results immediately after theexam.
▪ Option to display the feedback for correctanswers

Go Green:
You will be saving a substantial amount of paper by using online mode of exams. Prevent the use of paper and
save the planet.

20
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

SCREENSHORTS
1. SplashWindow:

This is the first page of the ONLINE TEST which appears for 5 seconds. It is a Splash Window.
21
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

2. SignupForm

This signup form is made for registered the name on table.

22
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

After the submission we get the following screen with a message box i.e. record is inserted
successfully

This record is inserted in table:

23
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

24
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

3. Student loginForm

This login form is made for security purpose. So only authenticated user only access in to the Project.
The person which has –
▪ StudentID
▪ StudentName
▪ Password
▪ Institute Code
can login in the online test.

25
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

These four things are already registered in the data base i.e. shown in this screen.

After the login we get the instructions about the test.

26
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

4. Questiondetails

Student read the test details and after pressing the submit button , student enter in test field.

27
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

5. Questions

After entering the answer press the next button and by pressing the next we get the 2ndquestion. This proccess got
end after the submission of last question.

28
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

6. LastQuestion

After the submission of last question ,we got the result message and on clicking OK button we got the record
frame.

29
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

7. ResultPage

On pressing OK button of message dialog box we get the new login form.

30
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

Result table

31
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

CODE

CODE OF PROJECT :
importjava.sql.*;
importjavax.swing.*;
importjava.awt.Font;
importjava.awt.Color;
importjava.awt.*;
importjava.awt.event.*;
class signup extends JFrame implements ActionListener
{
JLabel ll,la,lb,l,l1,l2,l3,l4,l5;
JTextField t1,t2,t3,p1,p2;
JButton b1;
PreparedStatementpst;
Connection con;
ResultSetrs;
int count;
JPasswordField t4,t5;
signup()
{
ImageIcon imgi1=new ImageIcon("G:\\ups.png");
setLayout(null);
JLabelll=new JLabel(imgi1);
ImageIcon imgi2=new ImageIcon("G:\\untitled.png");
la=new JLabel(imgi2);
lb=new JLabel("Institute SignUp Form");
l=new JLabel("Enter the Institute details:");
l1=new JLabel("Login Name:");
32
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l2=new JLabel("Roll No.:");
l3=new JLabel("Email Address:");
l4=new JLabel("Password:");
l5=new JLabel("Confirm Password:");
ll.setBounds(0,0,1340,150);
la.setBounds(0,100,300,650);
lb.setBounds(600,170,290,40);
l.setBounds(520,210,280,30);
l1.setBounds(420,270,150,30);
l2.setBounds(420,320,150,30);
l3.setBounds(420,370,150,30);
l4.setBounds(420,420,170,30);
l5.setBounds(420,470,170,30);
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
l3.setForeground(Color.RED);

l4.setForeground(Color.RED);
l5.setForeground(Color.RED);
lb.setFont(new Font("BitstreamVeroSans",Font.BOLD,22));
l.setFont(new Font("BitstreamVeroSans",Font.ITALIC,17));
setVisible(true);
setSize(1370,730);
add(ll);
add(la);
add(lb);
add(l);
add(l1);
add(l2);
33
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
add(l3);
add(l4);
add(l5);
b1.addActionListener(this);
}
public void actionPerformed(ActionEventae)
{
if(ae.getSource()==b1)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:hello","root","root");
pst=con.prepareStatement("insert into signup values(?,?,?,?,?)");
pst.setString(1,t1.getText());
pst.setString(2,t2.getText());
pst.setString(3,t3.getText());
pst.setString(4,t4.getText());
pst.setString(5,t5.getText());
int count=pst.executeUpdate();
if(count>0)
{
JOptionPane.showMessageDialog(null,"Record inserted successfully");
setVisible(false);
//sg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
studentlogin s=new studentlogin();
s.setVisible(true);
}
else{
JOptionPane.showMessageDialog(null,"Record not inserted successfully");
34
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
}}

catch(Exception e)
{
System.out.println(e);
}}
}
public static void main(String args[])
{
signupsg=new signup();
sg.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

CODE FOR THE LOGIN FORM

importjavax.swing.*;
importjava.sql.*;
importjava.awt.Font;
importjava.awt.Color;
importjava.awt.*;
importjava.awt.event.*;
classstudentlogin extends JFrame implements ActionListener
{
JLabel ll,la,lb,l,l1,l2,l3,l4;
JTextField t1,t2,t4;
JPasswordField t3;
JButton b1;
ImageIcon imgi1,imgi2;
35
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
Connection con1;
ResultSetrs;
PreparedStatementpst;
String x;
String y;
Container con;
studentlogin()
{
imgi1=new ImageIcon("G:\\ups.png");
setLayout(null);
ll=new JLabel(imgi1);
imgi2=new ImageIcon("G:\\untitled.png");
la=new JLabel(imgi2);
lb=new JLabel("Student Login Form");
l1=new JLabel("Student ID:");
l2=new JLabel("Student Name:");

l3=new JLabel("Password:");
l4=new JLabel("Institute Code:");
t1=new JTextField();
t2=new JTextField();
t3=new JPasswordField();
t4=new JTextField();
b1=new JButton("Submit");
ll.setBounds(0,0,1340,150);
la.setBounds(0,100,300,650);
lb.setBounds(450,170,290,40);
l1.setBounds(380,260,150,30);
l2.setBounds(380,310,150,30);
36
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l3.setBounds(380,360,150,30);
l4.setBounds(380,410,170,30);
t1.setBounds(520,260,170,30);
t2.setBounds(520,310,170,30);
t3.setBounds(520,360,170,30);
t4.setBounds(520,410,170,30);
b1.setBounds(520,500,120,50);
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
lb.setFont(new Font("BitstreamVeroSans",Font.BOLD,24));
setVisible(true);
setSize(1370,730);
add(ll);
add(la);
add(lb);
add(l1);
add(l2);
add(l3);
add(l4);
add(t1);
add(t2);
add(t3);
add(t4);
add(b1);
b1.addActionListener(this);
}
public void actionPerformed(ActionEventae)
{
37
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
if(ae.getSource()==b1)

{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con1=DriverManager.getConnection("jdbc:odbc:hello","root","root");
pst=con1.prepareStatement("select * from studentlogin where StudentID=? and Password=?");
pst.setString(1,t1.getText());
pst.setString(2,t3.getText());
rs=pst.executeQuery();
while(rs.next())
{
x=rs.getString(1);
y=rs.getString(3);
if(t1.getText().equals (x))
{
if(t3.getText().equals(y))
{
//JOptionPane.showMessageDialog(null,"Login successfully");
setVisible(false);
detail d=new detail();
d.setVisible(true);
}
else{
JOptionPane.showMessageDialog(null,"Wrong username or password");
}}}}
catch(Exception e){
System.out.println(e);}}}
38
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
public static void main(String args[])
{
studentlogin s=new studentlogin();
}}

CODE FOR THE TEST DETAILS

importjavax.swing.*;
importjava.awt.Font;
importjava.awt.Color;
importjava.awt.*;
importjava.awt.event.*;
class detail extends JFrame implements ActionListener
{
ImageIcon imgi1,imgi2;
JLabel ll,lb,la,l,l1,l2,l3,l4,l5,l6;

JTextField t1,t2,t3,t4,t5,t6;
JButton b1;
detail()
{
imgi1=new ImageIcon("G://ups.png");
setLayout(null);
ll=new JLabel(imgi1);
imgi2=new ImageIcon("G://untitled.png");
la=new JLabel(imgi2);
lb=new JLabel("Test Details");
l=new JLabel("Test details for user ");
l1=new JLabel("Test Name:");
39
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l2=new JLabel("Time Limit:");
l3=new JLabel("No. of Question:");
l4=new JLabel("Passing Marks:");
l5=new JLabel("Positive Marks:");
l6=new JLabel("Negative Marks:");
t1=new JTextField("Simple Apptitude Type Questions");
t2=new JTextField("1 minute per question");
t3=new JTextField(" 10 ");
t4=new JTextField(" 7");
t5=new JTextField("2 Marks each questions" );
t6=new JTextField(" 2marks");
b1=new JButton("Next");
ll.setBounds(0,0,1340,150);
lb.setBounds(670,160,290,40);
la.setBounds(0,100,300,650);
l.setBounds(640,210,280,30);
l1.setBounds(470,270,150,30);
l2.setBounds(470,320,150,30);
l3.setBounds(470,370,150,30);
l4.setBounds(470,420,150,30);
l5.setBounds(470,470,150,30);
l6.setBounds(470,520,150,30);
t1.setBounds(670,270,200,30);
t2.setBounds(670,320,200,30);
t3.setBounds(670,370,200,30);
t4.setBounds(670,420,200,30);
t5.setBounds(670,470,200,30);
t6.setBounds(670,520,200,30);
b1.setBounds(620,600,120,30);
l1.setForeground(Color.RED);
40
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l2.setForeground(Color.RED);

l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
l5.setForeground(Color.RED);
l6.setForeground(Color.RED);
lb.setFont(new Font("BitstreamVeroSans",Font.BOLD,22));
l.setFont(new Font("BitstreamVeroSans",Font.ITALIC,17));
add(ll);
add(la);
add(lb);
add(l);
add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
setVisible(true);
setSize(1370,730);
b1.addActionListener(this);
}
public void actionPerformed(ActionEventae)
{
if(ae.getSource()==b1)
{
setVisible(false);
question1 q1=new question1();
q1.setVisible(true);
41
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
}
}
public static void main(String args[])
{
detail d=new detail();
}
}

CODE FOR THE FRAME OF FIRST QUESTION

importjavax.swing.*;
importjava.awt.*;
importjava.awt.event.*;
class question1 extends JFrame implements ActionListener
{

JLabel ll,la,lb,l,l1,l2,l3,l4,l5,l6;
JButton b1;
JTextField t1,t2,t3,t4,t5,t6;
ImageIcon imgi1,imgi2;
question1()
{
setLayout(null);
imgi1=new ImageIcon("G:\\ups.png");
ll=new JLabel(imgi1);
imgi2=new ImageIcon("G:\\untitled.png");
la=new JLabel(imgi2);
lb=new JLabel("Question Details");
42
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l=new JLabel("Enter the Right Answer:");
l1=new JLabel("Question:");
l2=new JLabel("Option A:");
l3=new JLabel("Option B:");
l4=new JLabel("Option C:");
l5=new JLabel("Option D:");
l6=new JLabel(" Properties of Fuzzy Set are:");
t1=new JTextField(" Properties of Fuzzy Set are:");
t2=new JTextField(" Commutativity");
t3=new JTextField(" Associativity");
t4=new JTextField(" both");
t5=new JTextField(" None of these");
t6=new JTextField();
b1=new JButton("Next");
ll.setBounds(0,0,1340,150);
lb.setBounds(250,120,290,30);
la.setBounds(0,100,300,650);
l.setBounds(370,170,280,30);
l1.setBounds(470,240,120,30);
l2.setBounds(470,320,150,30);
l3.setBounds(470,370,150,30);
l4.setBounds(470,420,150,30);
l5.setBounds(470,470,150,30);
l6.setBounds(470,520,170,30);
t1.setBounds(670,225,350,50);
t2.setBounds(670,320,170,30);
t3.setBounds(670,370,170,30);
t4.setBounds(670,420,170,30);
t5.setBounds(670,470,170,30);
t6.setBounds(670,520,170,30);
43
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
l5.setForeground(Color.RED);
l6.setForeground(Color.RED);
lb.setFont(new Font("BitstreamVeroSans",Font.BOLD,22));
l.setFont(new Font("BitstreamVeroSans",Font.ITALIC,17));
setVisible(true);
setSize(1370,730);
add(ll);
add(la);
add(lb);
add(l);
add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
b1.addActionListener(this);
}
public void actionPerformed(ActionEventae)
{
if(ae.getSource()==b1)
{
int count=0;
if(t6.getText().equals("C"))
{
count=2;
44
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
}
setVisible(false);
question2 q2=new question2(count);
q2.setVisible(true);}
}
public static void main(String args[])
{
question1 q1=new question1();
}
}

CODE FOR THE FRAME OF SECOND QUESTION

importjavax.swing.*;
importjava.awt.Font;
importjava.awt.Color;
importjava.awt.*;
importjava.awt.event.*;
class question2 extends JFrame implements ActionListener
{
JTextField t1,t2,t3,t4,t5,t6;
JLabel ll,la,lb,l,l1,l2,l3,l4,l5,l6;
ImageIcon imgi1,imgi2;
JButton b1,b2;
int count;
45
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
question2(int c)
{
count=c;
setLayout(null);
imgi1=new ImageIcon("G:\\ups.png");
ll=new JLabel(imgi1);
imgi2=new ImageIcon("G:\\untitled.png");
la=new JLabel(imgi2);
lb=new JLabel(" The Right Answer");
l=new JLabel("Enter the Right Answer:");
l1=new JLabel("Question:");
l2=new JLabel("Option A:");
l3=new JLabel("Option B:");
l4=new JLabel("Option C:");
l5=new JLabel("Option D:");
JLabel l6=new JLabel("Right Answer is:");
t1=new JTextField(" First layer layer of OSI model is:");
t2=new JTextField(" Physical Layer");
t3=new JTextField(" Application Layer" );
t4=new JTextField(" session Layer");
t5=new JTextField(" None of these");
t6=new JTextField();
b1=new JButton("Next");
b2=new JButton("Reset");
ll.setBounds(0,0,1340,150);
lb.setBounds(250,120,290,30);
la.setBounds(0,100,300,650);
l.setBounds(310,170,280,30);

46
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l1.setBounds(470,240,120,30);
l2.setBounds(470,320,150,30);
l3.setBounds(470,370,150,30);
l4.setBounds(470,420,150,30);
l5.setBounds(470,470,150,30);
l6.setBounds(470,520,150,30);
t1.setBounds(670,225,350,65);
t2.setBounds(670,320,170,30);
t3.setBounds(670,370,170,30);
t4.setBounds(670,420,170,30);
t5.setBounds(670,470,170,30);
t6.setBounds(670,520,170,30);
b1.setBounds(570,590,120,30);
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
l5.setForeground(Color.RED);
l6.setForeground(Color.RED);
lb.setFont(new Font("BitstreamVeroSans",Font.BOLD,22));
l.setFont(new Font("BitstreamVeroSans",Font.ITALIC,17));
setVisible(true);
setSize(1370,730);
add(ll);
add(la);
add(lb);
add(l);
add(l1);
add(l2);
add(l3);
47
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
add(l4);
add(l5);
add(l6);
add(t1);
add(t2);
add(t3);
add(t4);
add(t5);
add(t6);
add(b1);
add(b2);
b1.addActionListener(this);
}

public void actionPerformed(ActionEventae)


{
if(ae.getSource()==b1)
{
if(t6.getText().equals("A"))
{
count+=2;
}
setVisible(false);
question3 q3=new question3(0);
q3.setVisible(true);}
}
public static void main(String args[])
{
question2 q2=new question2(0);
48
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
}
}

CODE FOR THE FRAME OF SECOND LAST QUESTION

importjavax.swing.*;
importjava.awt.Font;
importjava.awt.*;
importjava.awt.event.*;
class question9 extends JFrame implements ActionListener
{
ImageIcon imgi1,imgi2;
JLabel ll,la,l,l1,l2,l3,l4,l5,l6;
JTextField t1,t2,t3,t4,t5,t6;
JButton b1;
int count;
question9(int c)
{
count=c;
setLayout(null);
imgi1=new ImageIcon("G:\\ups.png");
ll=new JLabel(imgi1);
imgi2=new ImageIcon("G:\\untitled.png");
la=new JLabel(imgi2);
l=new JLabel("Enter the Right Answer:");
l1=new JLabel("Question:");
l2=new JLabel("Option A:");
l3=new JLabel("Option B:");

49
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l4=new JLabel("Option C:");
l5=new JLabel("Option D:");
l6=new JLabel("Answer:");
t1=new JTextField(" Objects are represented by ");
t2=new JTextField(" rows");
t3=new JTextField(" columns");
t4=new JTextField(" tables");
t5=new JTextField(" none of these");
t6=new JTextField();
b1=new JButton("Next");
ll.setBounds(0,0,1340,150);
la.setBounds(0,100,300,650);
l.setBounds(370,170,280,30);
l1.setBounds(470,240,120,30);
l2.setBounds(470,320,150,30);
l3.setBounds(470,370,150,30);
l4.setBounds(470,420,150,30);
l5.setBounds(470,470,150,30);
l6.setBounds(470,520,150,30);
t1.setBounds(670,225,350,65);
t2.setBounds(670,320,170,30);
t3.setBounds(670,370,170,30);
t4.setBounds(670,420,170,30);
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
l5.setForeground(Color.RED);
l6.setForeground(Color.RED);
l.setFont(new Font("BitstreamVeroSans",Font.ITALIC,17));
50
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
add(ll);
add(la);
add(l);
add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
setVisible(true);
setSize(1370,730);
b1.addActionListener(this);
}
public void actionPerformed(ActionEventae)
{
if(ae.getSource()==b1)
{
if(t6.getText().equals("B"))
{
count+=2;
}
setVisible(false);
question10 q10=new question10(count);
//q10.setVisible(true);
}
}
public static void main(String args[])
{
question9 q9=new question9(0);
}
51
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
}

Code for the Last Question

importjavax.swing.*;
importjava.awt.Font;
importjava.awt.Color;
importjava.awt.*;
importjava.awt.event.*;
class question10 extends JFrame implements ActionListener
{
ImageIcon imgi1,imgi2;
JLabel ll,la,l,l1,l2,l3,l4,l5,l6;
JTextField t1,t2,t3,t4,t5,t6;
JButton b1;
int count;
question10(int c)
{
count=c;
setLayout(null);
imgi1=new ImageIcon("G:\\ups.png");
ll=new JLabel(imgi1);

imgi2=new ImageIcon("G:\\untitled.png");
la=new JLabel(imgi2);
l=new JLabel("Enter the Right Answer:");
l1=new JLabel("Question:");
l2=new JLabel("Option A:");
52
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l3=new JLabel("Option B:");
l4=new JLabel("Option C:");
l5=new JLabel("Option D:");
l6=new JLabel("Answer:");
t1=new JTextField("Speedup Performance Laws");
t2=new JTextField("Amdahl's Law");
t3=new JTextField("Gustafson's Law");
t4=new JTextField("Both of them");
t5=new JTextField("None of above");
t6=new JTextField();
b1=new JButton("Submit");
ll.setBounds(0,0,1340,150);
la.setBounds(0,100,300,650);
l.setBounds(370,170,280,30);
l1.setBounds(470,240,120,30);
l2.setBounds(470,320,150,30);
l3.setBounds(470,370,150,30);
l4.setBounds(470,420,150,30);
l5.setBounds(470,470,150,30);
l6.setBounds(470,520,150,30);
t1.setBounds(670,225,350,65);
t2.setBounds(670,320,170,30);
t3.setBounds(670,370,170,30);
t4.setBounds(670,420,170,30);
t5.setBounds(670,470,170,30);
t6.setBounds(670,520,170,30);
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
53
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l5.setForeground(Color.RED);
l6.setForeground(Color.RED);
l.setFont(new Font("BitstreamVeroSans",Font.ITALIC,17));
add(ll);
add(la);
add(l);
add(l1);
add(l2);

add(l3);
add(l4);
add(l5);
add(l6);
setVisible(true);
setSize(1370,730);
b1.addActionListener(this);
}
public void actionPerformed(ActionEventae)
{
if(ae.getSource()==b1)
{
if(t6.getText().equals("B"))
{
count+=2;
}
JOptionPane.showMessageDialog(null,"result is:"+count);
setVisible(false);
resultrr=new result(count);
rr.setVisible(true);
54
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
}
}
public static void main(String args[])
{
question10 q10=new question10(0);
}
}
importjavax.swing.*;
importjava.awt.Font;
importjava.awt.Color;
importjava.awt.*;
importjava.awt.event.*;
class question10 extends JFrame implements ActionListener
{
ImageIcon imgi1,imgi2;
JLabel ll,la,l,l1,l2,l3,l4,l5,l6;
JTextField t1,t2,t3,t4,t5,t6;
JButton b1;
int count;
question10(int c)
{
count=c;
setLayout(null);

imgi1=new ImageIcon("G:\\ups.png");
ll=new JLabel(imgi1);
imgi2=new ImageIcon("G:\\untitled.png");
la=new JLabel(imgi2);
l=new JLabel("Enter the Right Answer:");
55
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l1=new JLabel("Question:");
l2=new JLabel("Option A:");
l3=new JLabel("Option B:");
l4=new JLabel("Option C:");
l5=new JLabel("Option D:");
l6=new JLabel("Answer:");
t1=new JTextField("Speedup Performance Laws");
t2=new JTextField("Amdahl's Law");
t3=new JTextField("Gustafson's Law");
t4=new JTextField("Both of them");
t5=new JTextField("None of above");
t6=new JTextField();
b1=new JButton("Submit");
ll.setBounds(0,0,1340,150);
la.setBounds(0,100,300,650);
l.setBounds(370,170,280,30);
l1.setBounds(470,240,120,30);
l2.setBounds(470,320,150,30);
l3.setBounds(470,370,150,30);
l4.setBounds(470,420,150,30)
l5.setBounds(470,470,150,30);
l6.setBounds(470,520,150,30);
t1.setBounds(670,225,350,65);
t2.setBounds(670,320,170,30);
t3.setBounds(670,370,170,30);
t4.setBounds(670,420,170,30);
t5.setBounds(670,470,170,30);
t6.setBounds(670,520,170,30);
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
56
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
l5.setForeground(Color.RED);
l6.setForeground(Color.RED);
l.setFont(new Font("BitstreamVeroSans",Font.ITALIC,17));
add(ll);
add(la);
add(l);

add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
setVisible(true);
setSize(1370,730);
b1.addActionListener(this);
}
public void actionPerformed(ActionEventae)
{
if(ae.getSource()==b1)
{
if(t6.getText().equals("B"))
{
count+=2;
}
JOptionPane.showMessageDialog(null,"result is:"+count);
setVisible(false);
57
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
resultrr=new result(count);
rr.setVisible(true);
}
}
public static void main(String args[])
{
question10 q10=new question10(0);
}
}

CODE FOR THE RESULT FRAME

importjava.sql.*;
importjavax.swing.*;
importjava.awt.Font;
importjava.awt.Color;
importjava.awt.*;
importjava.awt.event.*;
class result extends JFrame implements ActionListener
{
PreparedStatementpst;
Connection con;
ResultSetrs;

JLabel l0,ll,lb,l1,l2,l3,l4,l5;
JTextField t1,t2,t3,t4,t5;
JButton b1;
int count;
result(int c)
58
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
{
count=c;
ImageIcon imgi1=new ImageIcon("G:\\ups.png");
ImageIcon imgi2=new ImageIcon("G:\\untitled.png");
setLayout(null);
ll=new JLabel(imgi1);
l0=new JLabel(imgi2);
lb=new JLabel(" Result Displaying Page");
l1=new JLabel("Roll No.:");
l2=new JLabel("correct Questions:");
l3=new JLabel("Incorrect Questions:");
l4=new JLabel("Total Marks:");
l5=new JLabel("RESULT:");
t1=new JTextField();
int in=(20-c)/2;
t2=new JTextField(String.valueOf(cor));
t3=new JTextField(String.valueOf(in));
t4=new JTextField("20");
t5=new JTextField(String.valueOf(c));
b1=new JButton("Close");
ll.setBounds(0,0,1340,150);
l0.setBounds(0,100,300,650);
lb.setBounds(370,140,290,40);
l1.setBounds(470,270,150,30);
l2.setBounds(470,320,150,30);
l3.setBounds(470,370,150,30);
l4.setBounds(470,420,170,30);
l5.setBounds(470,470,170,30);
l1.setForeground(Color.RED);
l2.setForeground(Color.RED);
59
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
l3.setForeground(Color.RED);
l4.setForeground(Color.RED);
l5.setForeground(Color.RED);
lb.setFont(new Font("BitstreamVeroSans",Font.BOLD,22));
setVisible(true);
setSize(1370,730);
add(ll);
add(l0);
add(lb);

add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
}
public void actionPerformed(ActionEventae)
{
if(ae.getSource()==b1)
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con=DriverManager.getConnection("jdbc:odbc:hello","root","root");
pst=con.prepareStatement("insert into result values(?,?,?,?,?)");
pst.setString(1,t1.getText());
pst.setString(2,t2.getText());
pst.setString(3,t3.getText());
pst.setString(4,t4.getText());
pst.setString(5,t5.getText());
60
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering
int count=pst.executeUpdate();
if(count>0)
{
JOptionPane.showMessageDialog(null,"Record inserted successfully");
setVisible(false);
studentlogin r=new studentlogin();
r.setVisible(true);
}

else{
JOptionPane.showMessageDialog(null,"Record not inserted successfully");
}}
catch(Exception e)
{
System.out.println(e);
}}
}
public static void main(String args[])
{
resultrr=new result(0);
rr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}

61
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

Conclusion

This Web Application provides facility to conduct online examination world wide. It saves time as
it allows number of students to give the exam at a time and displays the results as the test gets over, so no
need to wait for the result.It is automatically generated by the server. Administrator has a privilege to
create, modify and delete the test papers and its particular questions. User can register, login and give
the test with his specific id, and can see the results aswell.

Online Examination System for introduction to management is an application that is designed and developed
for students and lecturers. The system helps students to take examination. It helps also lecturers to upload the
questions and answers in the database and they can see the students who fail or pass the exam. The major
objective of this web based online examination system is to competently evaluate the student/candidate
thoroughly through an automated system that not only saves a lot of time but also gives fast, improved, and
accurate results. It allows the students/candidate appearing for the exam to give the test/papers according to
their convenience from any location by simply using internet and time over the manual/traditional pen and
paper format. The online examination system provides the student/candidate with a quick and easy way to
show up for the test/examination.

62
Chandigarh Engineering College Jhanjeri
Mohali-140307
Department of Computer Science & Engineering

REFERENCES

[1] Biedny, David, and Monroy, Bert, "Adobe Photoshop Handbook", 2.5 Edition,1993

[2] Alba,J.W.andBartonWeitz,J.L.(1997), “Interactivehomeshopping:consumer,


retailer, andmanufacturer incentives to participate in electronicmarketplaces”,Journalof
Marketing, Vol.61,July,pp.38-53.

[3] Eighmey,J.,“ProfilinguserresponsestocommercialWebsites”,JournalofAdvertisingResearc
h, Vol.37, No. 3:59-66, 1997
[4] Gina,C.O. andBobO, ViewingtheWEBasamarketplace:thecase ofsmallcompanies,Decision
Support Systems, Vol. 21, No.3, 1997, pp. 171-183.

[5] Mund, Andre, Rotsawatsuk, Prawit, and Sawhney, Anil, "EnhancingConstruction


Engineering Education Using Internet based Tools", American Societyfor Engineering Education
(ASEE) Annual Conference Proceedings, North Carolina,1999.

63

You might also like