SlideShare a Scribd company logo
1 of 45
ONLINE EXAMINATION SYSTEM
Page 1
A Mini Project Report
on
“Online Examination System Using JSP Servlet, JSTL and CSS ”
by
Shristi Sharma- B218050
Tanisha Patil- B218069
Of
BTech
Academic Year: 2021-2022
School of Computer Engineering & Technology
ONLINE EXAMINATION SYSTEM
Page 2
CONTENTS
 Introduction
 Overview
 Introduction to JAVA
 ER Diagram
 Converting ER Diagram into Tables
 Table Structures
 Code
 Snapshots
 Conclusion
 Scope of Enhancement
ONLINE EXAMINATION SYSTEM
Page 3
ACKNOWLEDGEMENT
Before getting into the thick of the things, we would like to express our deep
gratitude to the people who helped us during the course of this project. We are grateful to
our project guide Mr. Rahul Desai for her guidance throughout this project research and
work
We also wish to thank all the faculty members of Information Technology and our
respectable Head of Department Prof. D G Auradkar for their constant help and efficient
teaching procedures,
Names of students:
Anil yadav(4307)
N Karthik(4331)
Pradeep Deshwal(4337)
ONLINE EXAMINATION SYSTEM
Page 4
1. ABSTRACT
Exam Software is a Test Management Software, which offers a complete solution for Computer Based
Test (CBT) .They are used to set up multiple choice tests for set time periods that when submitted are
automatically corrected and the results logged beside the student's reference number.
FEATURES
 Administrator login.
 Student registration.
 Management and update of student information ,instructions and questions.
 scope for fixing negative marks and maximum marks to each question.
 Display of result in the form of total score ,correct responses attempted and non attempted
questions.
WHAT IMPACT DOES IT HAVE
 Physical presence at a given location is absolutely not necessary.
 No time is spent on evaluation.
 Results are available instantly.
 The time of starting and completion of examination can be recorded at the server and the student
cannot manipulate the same.
 Even for subjects that the actual examination that will not be conducted online students can be
given extensive practice and training by holding online Mock Tests.
 Almost all competitive exams are multiple choice types and these can be easily conducted
online, for example GCET - Goa Common Entrance Test held to shortlist candidates for medical
and engineering courses.
 Trends of the examination including topic wise trends of each subject can be easily obtained if
required.
ONLINE EXAMINATION SYSTEM
Page 5
2. INTRODUCTION
PURPOSE
 The purpose of on-line test simulator is to take online test in an efficient manner and no time wasting for
checking the paper.
 The main objective of on-line test is to efficiently evaluate the candidate thoroughly through a fully
automated system that not only saves lot of time but also gives fast results.
 For students they give papers according to their convenience and time and there is no need of using extra
thing like paper, pen etc.
SCOPE
Scope of this project is very broad in terms of other manually taking exams.
Few of them are:-
 This can be used in educational institutions as well as in corporate world.
 No restriction that examiner has to be present when the candidate takes the test.
FEATURES:
 Secure
 Easy to use
 Reliable and accurate
 No need of examiner
OVEVIEW
The online test created for taking online test has following stages
 Login
 Test
ONLINE EXAMINATION SYSTEM
Page 6
 Result
LOGIN:-
 There is a quality login window because this is more secure than other login forms as in a normal
login window there are multiple logins available so that more than one person can access to test with
their individual login.
 It include two login windows one for administrator and another one for student.
TEST:
 Test page is the most creative and important page in this project. It
 consists of 2 modules namely:
 Subject selection
 Utilities
 Utilities:-
It includes:-
 Skip and come back to the question afterwards ifneeded.
 Gives the list of attempted and unattempted questions and can go to any question directly and
can either attempt or change the answer of the already attempted question.
ONLINE EXAMINATION SYSTEM
Page 7
TECHNOLOGIES USED
 Front end as:
Eclipse Platform
 Back end as:
Oracle
 Database:
Oracle
 Querying language:
SQL
ONLINE EXAMINATION SYSTEM
Page 8
3. SPECIFIC REQUIREMENTS:
External interface utilised:
HARDWARE
1.) Minimum 5 GB space in HDD
2.) IBN Net vista Pentium 4 1.7 GHz
3.) 256 MB DDR SDRAM
4.) GB ULTRA HDD 7200 RPM
5.) 48 x CD ROM
6.) 15 `` color monitor
SOFTWARE
1. Eclipse Platform
2. Windows 7 (Ultimate)
3. ODBC Driver
4. Oracle DBMS with SQL 8.0 Plus
ONLINE EXAMINATION SYSTEM
Page 9
Introduction to Java
 Java is Object oriented, Multi-threading language developed by Sun Microsystems in 1991.
 It is designed to be small, simple and portable across different platforms as well as OS.
Features of Java :
Syntax based on C++
 Object-oriented
 Support for Internet applications
 Extensive library of prewritten classes
 Portability among platforms
 Built-in networking security as JRE is inaccessible to other parts of computer
Java Programs:
 Applets:
 Small programs designed to add interactivity to Web sites
 Downloaded with the Web page and launched by the Internet browser
 Servlets :
 Run by Web server on the server
 Typically generate Web content
 Applications:
 Programs that run standalone on a client
ONLINE EXAMINATION SYSTEM
Page 10
Java Servlets:
 Servlets are server side applets that are loaded and executed by a web server in the same manner that
applets are loaded and executed by a web browser.
 Java Servlets are useful to create Dynamic pages. Depending upon my input server will give an output
Features of Servlets:
 Database Connectivity
o Insert/Update/delete/drop
o Select
 Servlets Chaining
 Server Side Includes
 Applet Servlet Communication
 Interservlet Communication
 Page Compilation
 Session Tracking
JSP:
Introduction:
 As a Java-based technology, it enjoys all of the advantages that the java language provides with respect
to development and deployment.
 JSP runs on major web platforms.
 Client (web browser) makes a request via an HTTP.
 The web server receives the request and sends it to the Servlets/JSP engine. If the Servlets/JSP is not
loaded, the web server will load it into the JVM and execute it.
 Web server returns response to the Client.
JSP Directives: They generate side effects that are change the way the JSP container processes the
page.
Implicit Objects:
ONLINE EXAMINATION SYSTEM
Page 11
 Request
 Response
 Out
 Session
 Application
 Page Context
 Exception
JSP Actions: The JSP actions allow the transfer of control between pages.
 Forward
 Include
 Plug-in
JavaScript:
A scripting language is a lightweight programming language which is basically responsible for
 Creating Dynamic Pages.
 Respond to the events.
 Read and Write HTML Elements.
 Validate Data.
Functions:
 Functions are useful to a programmer when certain tasks are to be repeated during the course of the
program. They are defined by name and invoked with the same. The functions can take parameters and
return result using return statement.
 Recursive Functions are functions that call themselves.
Events:
 Events are signals generated when specific event occurs. Event handlers are scripts written by the
programmer to take advantages of events in JavaScript. Eg:
blur : Occurs when user clicks outside a field.
click: Occurs when user clicks inside a field.
change: Occurs when user changes a field.
focus : Occurs when user focuses over a field
ONLINE EXAMINATION SYSTEM
Page 12
E-R diagram
Administrator
updates updates updates
student
Question
questionQues
tion
attempts
s
pwd
id
stud₋name
m
id
gets
Result
Question
Rules
Question
$stud-id
phone
id
$stud-id
ansgiven
id
$q-id
q-id ques
id
ans
id
author
id
op2
id
op3
id
op1
id
op4
id
marks
updates
sett
Question
setno
nmarks
nnkfjn
mnmar
ks
id
time
id
pmarks
nnkfjn
mnmar
ks
id
$stud-id
q₋correct
q₋attempted
d
id
t₋marks
nnkfjn
mnmar
ks
id
ONLINE EXAMINATION SYSTEM
Page 13
CONVERTING E-R INTO TABLES
STUDENT- TABLE
S.No. Field name Data Type Description
1. STUD_ID(pk) NUMBER(8) Student identification number
2 Q_ID(pk) NUMBER(2) Question id
3 ANSGIVEN NUMBER(1) Response
4 MARKS NUMBER(1) Marks of each question
ATTEMPT- TABLE
S.No. Field name Data Type Description
1. STUD_ID(pk) NUMBER(4) Student identification number
2 Q_ATTEMPTED NUMBER(2) Questions attempted
3 Q_CORRECT NUMBER(3) Correct responses
4 T_MARKS NUMBER(3) Total marks
RESULT- TABLE
S.No. Field name Data Type Description
1. STUD_ID(pk) NUMBER(8) Student identification number
2 STUD_NAME VARCHAR2(10) Name of student
3 PHONE NUMBER(10) Student’s contact number
4 PWD VARCHAR2(8) Password
ONLINE EXAMINATION SYSTEM
Page 14
SETT-TABLE
S.No. Field name Data Type Description
1. TIME NUMBER(2) Time duration
2 NMARKS NUMBER(2) Negative Marks
3 PMARKS NUMBER(2) Positive Marks
QUESTION- TABLE
S.No. Field name Data Type Description
1 Q_ID NUMBER(2) Question id
2 QUES VARCHAR2(100) Question
3 ANS NUMBER(1) Correct answer of question
4 AUTHOR VARCHAR2(20) Author
5 OP1 VARCHAR2(40) Option 1
6 OP2 VARCHAR2(40) Option2
7 OP3 VARCHAR2(40) Option3
8 OP4 VARCHAR2(40) Option4
ONLINE EXAMINATION SYSTEM
Page 15
RELATIONAL DATABASE DESIGN
The database consists of following tables:
 Student table
 Attempt table
 result table
 question table
 setting table
 rules
 Administrator updates student table where primary key is stud_id its other
attributes like password , name, phone are dependent on it. ‘Attempt‘ is a
many to one relationship between entities student and question .
 ‘Attempt’ contains compositeprimary keys (stud_id,q_id).its attributes are
dependent on this composite primary key,stud_id,q_id act as foreign key for
both student table and question table.
 Question table contains q_id as its primary key which uniquely defines the
entire question table.
 ‘Gets’ relationship connects student and result entities where primary key is
stud_id.
 Administrator updates setting table which contains positive marks, negative
marks, time limit, total marks.
 Administrator also updates rules or instructions.
ONLINE EXAMINATION SYSTEM
Page 16
SOURCE CODE
PAGE:page1.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>AIT EXAM</title>
</head>
<body background="img36.jpg">
<center>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<th bgcolor="transparent" colspan=2>
<IMG style="WIDTH: 120px; HEIGHT: 90px" height=90 src="aitlogo2.gif" width=115 > <BR>
<font face="Times New Roman" color=white size=15 >ARMY INSTITUTE OF
TECHNOLOGY</FONT><BR></th>
<tr bgcolor="transparent">
<td valign=top>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
DEPARTMENT OF INFORMATION TECHNOLOGY<BR><BR></font>
<font face="Times New Roman" color=LIGHTYELLOW size=5>
<MARQUEE direction=left WIDTH=100% BEHAVIOR=SCROLL BGColor=TRANSPARENT >ONLINE
EXAMINATION</MARQUEE><BR><BR>
<input type="button" value=" STUDENT LOGIN "
onclick="location.href='studlog.jsp'" ><br><BR>
<input type="button" value="ADMINISTRATOR LOGIN"
onclick="location.href='adminlogin.jsp'"><br><BR>
<input type="button" value=" CLOSE "
onclick="window.close()"><br><BR>
</font>
</tr>
</body>
</html>
PAGE:adminlogin.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<SCRIPT type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
</SCRIPT>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
ONLINE EXAMINATION SYSTEM
Page 17
<body background="img36.jpg" onLoad=document.f1.t1.focus()>
<form name="f1" method="post" action="adminlogin.jsp">
<CENTER>
<BR><BR><BR><BR><BR>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<th bgcolor="transparent" colspan=2>
<font face="Times New Roman" color=LIGHTgrey size=5 >ADMINISTRATOR
LOGIN</FONT><BR></th>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b> USER_ID </b>
</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" size=20
maxlength=20></td>
</tr>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>PASSWORD</b>
</font>
<input type="password" name="t2" size=20 maxlength=20></td>
</tr>
<tr bgcolor="transparent">
<td valign=top >
<input type="submit" name="b1" value=" LOGIN ">
<input type="button" value=" EXIT " onclick="location.href='page1.jsp'">
</tr>
</TABLE>
</CENTER>
</form>
<%
int flag=0;
String user=request.getParameter("t1");
String pass=request.getParameter("t2");
if(user!=" " && pass!=" ")
{
try{
if((user.equals("user")) && (pass.equals("pass")))
response.sendRedirect("adminupdate.jsp");
else
{ %>
<script language="javascript">
alert ("Invalid ID/Password");
</script>
<%
}}catch(Exception e){}
}
%>
</body>
ONLINE EXAMINATION SYSTEM
Page 18
</html>
PAGE:studentregistration.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<body background="img36.jpg">
<%!public int flag=0;%>
<form action="studentregistration.jsp" name="f1" method=post>
<center>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<BR><BR><BR><BR>
<th bgcolor="transparent" colspan=2>
<font size=10 face="Times New Roman" color=LIGHTgrey>STUDENT REGISTRATION </font>
<br>
</th>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>STUDENT_ID</b>
</font>
&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t2" value="" size=20
maxlength=20></td>
<td valign=top align=left> <font size=5 face="Times New Roman"
color=LIGHTYELLOW><b>NAME</b>
</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb
sp;<input type="text" name="t1" value="" id="txt1" size=20 maxlength=20></td>
</tr>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>CONTACT NO.</b>
</font>
<input type="text" name="t3" value="" size=20 maxlength=10></td>
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>PASSWORD</b>
</font>
<input type="text" name="t4" value="" size=20 maxlength=20></td>
<tr bgcolor="transparent">
<td align=center colspan=2>
<input type="SUBMIT" value="SUBMIT" name="submit" >
<input type="submit" value="SEARCH" name="submit">
<input type="SUBMIT" value="DELETE"name="submit" >
<input type="SUBMIT" value="UPDATE"name="submit">
<%
String s=request.getParameter("submit");
String name=request.getParameter("t1");
String id=request.getParameter("t2");
String phone=request.getParameter("t3");
String pwd=request.getParameter("t4");
ONLINE EXAMINATION SYSTEM
Page 19
try{
if(s.equals("SUBMIT"))
{
if(id!="" && name!="" && phone!="" && pwd!= "")
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc",
"scott", "anil");
Statement st=con.createStatement();
String sql="insert into student
values("+id+",'"+name+"',"+phone+",'"+pwd+"')";
st.execute(sql);
%>
<script language=javascript>
alert("Inserted Sucessfully");
</script>
<%
}
else
{
%>
<script language=javascript>
alert("Enter All Entries");
</script>
<%
}
}
}
catch(Exception e1)
{
}
if(!(id==" "))
{
try{
if(s.equals("DELETE"))
{%>
<script language="javascript">
var b=confirm ("Do You Confirm ");
if(b==1)
{
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott",
"anil");
Statement st=con.createStatement();
String query="delete from student where stud_id="+id;
st.executeUpdate(query);
ONLINE EXAMINATION SYSTEM
Page 20
%>
alert("Deleted");
}
</script>
<%
}
}
catch(Exception e1)
{
}
}
if(!(id==" "))
{
try{
if(s.equals("SEARCH"))
{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from student where stud_id="+id);
if(rs.next())
{
%>
<script language="javascript">
alert("search found");
document.f1.t2.value="<%=rs.getString(1)%>";
document.f1.t1.value="<%=rs.getString(2)%>";
document.f1.t3.value="<%=rs.getString(3)%>";
document.f1.t4.value="<%=rs.getString(4)%>";
</script>
<%
}
else
{
%>
<script language="javascript">
alert("Record not found");
</script>
<%
}
}
}
catch(Exception e1)
{
}
}
if(!(name==" " && id==" " && phone==" " && pwd== " "))
{
try{
if(s.equals("UPDATE"))
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
ONLINE EXAMINATION SYSTEM
Page 21
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
String query="update student set
stud_id="+id+",stud_name='"+name+"',phone="+phone+",pwd='"+pwd+"'where stud_id="+id;
st.executeUpdate(query);
%>
<script language=javascript>
alert("Updated Sucessfully");
</script>
<%
}
}catch(Exception e1)
{
}
}
%>
<input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'">
</tr>
</table>
</center>
</form>
</body>
</html>
PAGE:question.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%!public int i=1;%>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body background="img36.jpg">
<form action="question.jsp" name="f1" method=post>
<center>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<BR><BR><BR><BR>
<th bgcolor="transparent" colspan=2>
<font size=10 face="Times New Roman" color=LIGHTgrey>QUESTION BANK</font>
<br>
</th>
<tr bgcolor="transparent">
<td valign=top>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>Q.NO.</b>
</font>
<input type="text" name="t1" value="" id="txt1" size=3 maxlength=3></td>
<td valign=top>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>AUTHOR</b>
</font>
ONLINE EXAMINATION SYSTEM
Page 22
<input type="text" name="t2" value="" size=30 maxlength=30></td>
</tr>
<tr bgcolor="transparent">
<td align=center colspan=2>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>QUESTION</b>
</font>
<br><TEXTAREA name="t3" rows=5 cols=100 Wrap=true> </TEXTAREA></td>
</tr>
<tr bgcolor="transparent">
<td align=center colspan=2>
<input type='radio' name='o1' value=1>1
<input type="text" name="t4" value="" size=40 maxlength=40><br>
<input type='radio' name='o1'value=2>2
<input type="text" name="t5" value="" size=40 maxlength=40><br>
<input type='radio' name='o1'value=3>3
<input type="text" name="t6" value="" size=40 maxlength=40><br>
<input type='radio' name='o1'value=4>4
<input type="text" name="t7" value="" size=40 maxlength=40>
</td>
</tr>
<tr bgcolor="transparent">
<td align=center colspan=2>
<input type="SUBMIT" value="SUBMIT" name="submit" >
<input type="submit" value="SEARCH" name="submit">
<input type="SUBMIT" value="DELETE"name="submit" >
<input type="SUBMIT" value="UPDATE"name="submit">
<%
String s=request.getParameter("submit");
String qid=request.getParameter("t1");
String author=request.getParameter("t2");
String quest=request.getParameter("t3");
String op1=request.getParameter("t4");
String op2=request.getParameter("t5");
String op3=request.getParameter("t6");
String op4=request.getParameter("t7");
String ans=request.getParameter("o1");
//int ans2=Integer.parseInt(ans);
try{
if(s.equals("SUBMIT"))
{
if(qid!=null && author!=null && quest!=null && op1!=null && op2!=null &&
op3!=null && op4!=null && ans!=null)
{
//int qid2=Integer.parseInt(qid);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc",
"scott", "anil");
Statement
st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
String query1="insert into question
values("+qid+",'"+quest+"',"+ans+",'"+author+"','"+op1+"','"+op2+"','"+op3+"','"+op4+"'
)";
st.executeUpdate(query1);
%>
<script language=javascript>
alert("Inserted Sucessfully");
ONLINE EXAMINATION SYSTEM
Page 23
</script>
<%
}
else
{
%>
<script language=javascript>
alert("Enter all entries");
</script>
<%
}
}
}catch(Exception e1)
{out.println(e1);}
if(!( qid==" " ))
{
try{
if(s.equals("SEARCH"))
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from question where q_id="+qid);
if(rs.next())
{
%>
<script language="javascript">
alert("search found");
document.f1.t1.value="<%=rs.getString(1)%>";
document.f1.t3.value="<%=rs.getString(2)%>";
document.f1.t2.value="<%=rs.getString(4)%>";
document.f1.t4.value="<%=rs.getString(5)%>";
document.f1.t5.value="<%=rs.getString(6)%>";
document.f1.t6.value="<%=rs.getString(7)%>";
document.f1.t7.value="<%=rs.getString(8)%>";
</script>
<%
}
else
{
%>
<script language="javascript">
alert("Record not found");
</script>
<%
}
}
}catch(Exception e1)
{
}
}
ONLINE EXAMINATION SYSTEM
Page 24
if(!(qid==" " && author==" " && quest==" " && op1== " "&& op2== " "&& op3== " "&&
op4== " "&& ans== " "))
{
try{
if(s.equals("UPDATE"))
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
String query="update question set
q_id="+qid+",ques='"+quest+"',ans="+ans+",author='"+author+"',op1='"+op1+"',op2='"+op2+
"',op3='"+op3+"',op4='"+op4+"'where q_id="+qid;
st.executeUpdate(query);
%>
<script language=javascript>
alert("Updated Sucessfully");
</script>
<%
}
}catch(Exception e1)
{
}
}
if(!(qid==" "))
{
try{
if(s.equals("DELETE"))
{
%>
<script language="javascript">
var b=confirm ("Do You Confirm ");
if(b==1)
{
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
String query="delete from question where
q_id="+qid;
st.executeUpdate(query);
%>
alert("Deleted");
}
</script>
<%
}
}catch(Exception e1)
{
}
}
ONLINE EXAMINATION SYSTEM
Page 25
%>
<input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'">
</td>
</tr>
</table>
</center>
</form>
</body>
</html>
PAGE:adminupdate.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<SCRIPT type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
</SCRIPT>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body background="img36.jpg">
<form action="adminupdate.jsp" name="f1" method=post>
<br><br><br><br>
<center>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<th bgcolor="transparent" colspan=2>
<font face="Times New Roman" color=LIGHTGREY size=5>ADMINISTRATOR</FONT><BR></th>
<tr bgcolor="transparent">
<td valign=top >
<input type="button" value="STUDENT INFO"
onclick="location.href='studentregistration.jsp'" ><br><BR>
<input type="button" value=" QUESTIONS "
onclick="location.href='question.jsp'"><br><BR>
<input type="button" value="INSTRUCTIONS" onclick="location.href='.jsp'" ><br><BR>
<input type="button" value=" SETTINGS " onclick="location.href='settings.jsp'"
><br><BR>
<input type="SUBMIT" value="RESET RECORD" name="submit" ><br><BR>
<input type="button" value=" LOGOUT " onclick="location.href='page1.jsp' "
>
<%
String s=request.getParameter("submit");
try{
if(s.equals("RESET RECORD"))
{%>
<script language="javascript">
var b=confirm ("Do You Confirm ");
if(b==1)
{
<%
ONLINE EXAMINATION SYSTEM
Page 26
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott",
"anil");
Statement st=con.createStatement();
String query="delete from result ";
st.executeUpdate(query);
%>
alert("Deleted");
}
</script>
<%
}
}
catch(Exception e1)
{
}
%>
</td>
</tr>
</table>
</center>
</form>
</body>
</html>
PAGE:ins_update.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body background="img36.jpg">
<form action="ins_update.jsp" name="f1" method=post>
<center>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"
style="position:absolute;left:30px;top:25px" width=500 height=400>
<th bgcolor="transparent" colspan=2>
<font size=10 face="Times New Roman" color=LIGHTgrey>INSTRUCTIONS</font>
<br>
</th>
<tr bgcolor="transparent">
<td valign=top ALIGN="LEFT">
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>SR. NO.</b>
</font>
<input type="text" name="t1" value="" id="txt1" size=3 maxlength=3><BR><BR><BR>.
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>INSTRUCTION</b>
</font>
ONLINE EXAMINATION SYSTEM
Page 27
<br><TEXTAREA name="t2" rows=5 cols=60 Wrap=true> </TEXTAREA></td>
</tr>
<tr bgcolor="transparent">
<td align=center colspan=2>
<input type="SUBMIT" value="SUBMIT" name="submit" >
<input type="SUBMIT" value="DELETE"name="submit" >
<input type="SUBMIT" value="UPDATE"name="submit">
<%
String s=request.getParameter("submit");
String id=request.getParameter("t1");
String inst=request.getParameter("t2");
//int ans2=Integer.parseInt(ans);
try{
if(s.equals("SUBMIT"))
{
if(id!=null && inst!=null )
{
//int qid2=Integer.parseInt(qid);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc",
"scott", "anil");
Statement
st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
String query1="insert into rule values('"+inst+"',"+id+")";
st.executeUpdate(query1);
%>
<script language=javascript>
alert("Inserted Sucessfully");
</script>
<%
}
else
{
%>
<script language=javascript>
alert("Enter All Enteries");
</script>
<%
}
}
}catch(Exception e1)
{}
if(!( id==" " ))
{
try{
if(s.equals("SEARCH"))
ONLINE EXAMINATION SYSTEM
Page 28
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from rule where ins_id="+id);
if(rs.next())
{
%>
<script language="javascript">
alert("search found");
document.f1.t1.value=<%=rs.getString(2)%>;
document.f1.t2.value=<%=rs.getString(1)%>;
</script>
<%
}
else
{
%>
<script language="javascript">
alert("Record not found");
</script>
<%
}
}
}catch(Exception e1)
{
}
}
if(!(id==" " && inst== " "))
{
try{
if(s.equals("UPDATE"))
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
String query="update rule set ins_id="+id+",inst='"+inst+"'where ins_id="+id;
st.executeUpdate(query);
%>
<script language=javascript>
alert("Updated Sucessfully");
</script>
<%
}
}catch(Exception e1)
{
}
}
if(!(id==" "))
{
ONLINE EXAMINATION SYSTEM
Page 29
try{
if(s.equals("DELETE"))
{
%>
<script language="javascript">
var b=confirm ("Do You Confirm ");
if(b==1)
{
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection
con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
String query="delete from rule where ins_id="+id;
st.executeUpdate(query);
%>
alert("Deleted");
}
</script>
<%
}
}catch(Exception e1)
{
}
}
%>
<input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'">
</td>
</tr>
</table>
</center>
<font face="Times New Roman" color=LIGHTYELLOW size=5 >
<TABLE border=10 style="position:absolute;left:660px;top:25px " width=600>
<%Object s3=session.getAttribute("name"); %>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from rule order by ins_id");
while(rs.next())
{
%>
<tr>
<%
out.println("<td>"+rs.getString(2));
out.println( "<td>"+rs.getString (1));
%>
</tr>
<%
ONLINE EXAMINATION SYSTEM
Page 30
}
}catch(Exception e1)
{}
%>
</TABLE>
</font>
</form>
</body>
</html>
PAGE:ins_update.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body background="img36.jpg">
<form action="settings.jsp" method=post>
<center>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<BR><BR><BR><BR>
<th bgcolor="transparent" colspan=2>
<font size=10 face="Times New Roman" color=LIGHTgrey>SETTINGS </font>
<br>
</th>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>TIME DURATION</b>
</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" value="" id="txt1"
size=20 maxlength=20></td></tr>
<TR><td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>POSITIVE MARKS</b>
</font>
&nbsp;&nbsp;&nbsp;<input type="text" name="t2" value="" size=20 maxlength=20></td>
</tr>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>NEGATIVE MARKS</b>
</font>
<input type="text" name="t3" value="" size=20 maxlength=10></td>
<tr bgcolor="transparent">
<td align=center colspan=2>
<input type="SUBMIT" value="SUBMIT">
ONLINE EXAMINATION SYSTEM
Page 31
<%
String td=request.getParameter("t1");
String pm=request.getParameter("t2");
String nm=request.getParameter("t3");
if(!(td==" " && pm==" " && nm==" "))
{
try{
int x1=Integer.parseInt(td);
int x2=Integer.parseInt(pm);
int x3=Integer.parseInt(nm);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
st.executeQuery("update sett set time="+x1+",pmarks="+x2+",nmarks="+x3+"where setno
= 1");
%>
<script language=javascript>
alert("Updated successfully!!");
</script>
<%
}catch(Exception e1)
{
}
}
%>
<input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'">
</tr>
</table>
</center>
</form>
</body>
</html>
PAGE:settings.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
ONLINE EXAMINATION SYSTEM
Page 32
</head>
<body background="img36.jpg">
<form action="settings.jsp" method=post>
<center>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<BR><BR><BR><BR>
<th bgcolor="transparent" colspan=2>
<font size=10 face="Times New Roman" color=LIGHTgrey>SETTINGS </font>
<br>
</th>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>TIME DURATION</b>
</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" value="" id="txt1"
size=20 maxlength=20></td></tr>
<TR><td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>POSITIVE MARKS</b>
</font>
&nbsp;&nbsp;&nbsp;<input type="text" name="t2" value="" size=20 maxlength=20></td>
</tr>
<tr bgcolor="transparent">
<td valign=top align=left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
<b>NEGATIVE MARKS</b>
</font>
<input type="text" name="t3" value="" size=20 maxlength=10></td>
<tr bgcolor="transparent">
<td align=center colspan=2>
<input type="SUBMIT" value="SUBMIT">
<%
String td=request.getParameter("t1");
String pm=request.getParameter("t2");
String nm=request.getParameter("t3");
if(!(td==" " && pm==" " && nm==" "))
{
try{
int x1=Integer.parseInt(td);
int x2=Integer.parseInt(pm);
int x3=Integer.parseInt(nm);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
st.executeQuery("update sett set time="+x1+",pmarks="+x2+",nmarks="+x3+"where setno
= 1");
%>
<script language=javascript>
alert("Updated successfully!!");
ONLINE EXAMINATION SYSTEM
Page 33
</script>
<%
}catch(Exception e1)
{
}
}
%>
<input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'">
</tr>
</table>
</center>
</form>
</body>
</html>
PAGE:studlog.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page language ="java" import="java.sql.*" %>
<html>
<SCRIPT type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
</SCRIPT>
<body background="img36.jpg" onLoad=document.f1.t1.focus()>
<form name="f1" method="post">
<CENTER>
<BR><BR><BR><BR><BR>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<th bgcolor="transparent" colspan=2>
<font face="Times New Roman" color=LIGHTgrey size=5 ><B>STUDENT
LOGIN</B></FONT><BR></th>
<tr bgcolor="transparent">
<td valign=top align =left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
USER_ID
</font>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" value=""
size=20 maxlength=20></td>
</tr>
<tr bgcolor="transparent">
<td valign=top align =left>
<font size=5 face="Times New Roman" color=LIGHTYELLOW>
PASSWORD
</font>
<input type="password" name="t2" value="" size=20 maxlength=20></td>
ONLINE EXAMINATION SYSTEM
Page 34
</tr>
<tr bgcolor="transparent">
<td valign=top>
<input type="submit" name="b1" value="LOGIN">
<input type="button" value="EXIT" onclick="location.href='page1.jsp'">
</tr>
</TABLE>
</CENTER>
<%
String user=request.getParameter("t1");
String pass=request.getParameter("t2");
if(user!=" " && pass!=" ")
{
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from student");
while(rs.next())
{
String username=rs.getString(1);
int stud_id=Integer.parseInt(username);
String password=rs.getString(4);
String name=rs.getString(2);
if(user.equals(username) && pass.equals(password))
{
ResultSet rs1=st.executeQuery("select * from result where
stud_id="+stud_id);
if(!rs1.next())
{
session.setAttribute("user",user);
session.setAttribute("name",name);
%>
<jsp:forward page="instructions.jsp" />
<input type=hidden name=user value=<%= username %>>
<% }
else
{
%>
<script language="javascript">
alert ("ID ALREADY ENTERED");
</script>
<%
}
}
}
%>
<script language="javascript">
alert ("Invalid ID/Password");
</script>
ONLINE EXAMINATION SYSTEM
Page 35
<%
}catch(Exception e1)
{
}
}
%>
</body>
</html>
PAGE:exam1.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1" import="java.sql.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<%String t=request.getParameter("t");int t1=Integer.parseInt(t);%>
<script language="JavaScript">
var flag;
var secs;
function cd() {
mins = min; // change minutes here
secs = 0 + s(":01"); // change seconds here (always add an additional second to
your total)
redo();
}
function m(obj) {
for(var i = 0; i < obj.length; i++) {
if(obj.substring(i, i + 1) == ":")
break;
}
return(obj.substring(0, i));
}
function s(obj) {
for(var i = 0; i < obj.length; i++) {
if(obj.substring(i, i + 1) == ":")
break;
}
return(obj.substring(i + 1, obj.length));
}
function dis(mins,secs) {
var disp;
if(mins <= 9) {
disp = " 0";
} else {
disp = " ";
}
disp += mins + ":";
ONLINE EXAMINATION SYSTEM
Page 36
if(secs <= 9) {
disp += "0" + secs;
} else {
disp += secs;
}
return(disp);
}
function redo() {
secs--;
if(secs == -1) {
secs = 59;
mins--;
}
document.cd.disp.value = dis(mins,secs); // setup additional displays here.
if((mins == 0) && (secs == 0)) {
window.alert("Time is up. Press OK to continue."); // change timeout
message as required
window.location = "exam2.java"
} else {
cd = setTimeout("redo()",1000);
}
}
function init() {
cd();
}
document.onload = init;
</script>
<SCRIPT type="text/javascript">
window.history.forward();
function noBack() { window.history.forward(); }
function fun1()
{
//alert("previous");
document.exam1.action="exam2?t=<%= t1%>&x=2";
exam1.submit();
}
function fun2()
{
//alert("submit");
exam1.submit();
}
function fun3()
{
// alert("next");
document.exam1.action="exam2?t=<%= t1%>&x=3";
exam1.submit();
}
</SCRIPT>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<%!public int i=1,qid=0,mark=0,x1=0,x2=0,min1=40;String s2=null;boolean flag=false;%>
ONLINE EXAMINATION SYSTEM
Page 37
</head>
<body background="img36.jpg">
<script language="JavaScript">
var min=19;
</script>
<form name="cd">
<input id="txt" bgcolor="transparent" readonly="true" type="text" value="10:00"
border="0" name="disp">
</form>
<form name="exam1" action="exam2?t=<%= t1 %>&x=1" method=post>
<center>
<font face="Times New Roman" color=LIGHTgrey size=5 >
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<BR><BR>
<%
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs=st.executeQuery("select * from question where q_id="+t1);
rs.next();
s2=rs.getString(3);
qid=Integer.parseInt(rs.getString(1));
Object s3= session.getAttribute("user");
out.println( "<tr> <td align=center > <b> AUTHOR</b> :-"
+ rs.getString(4) +"<td><B>TIME LEFT </B>:-<input id='txt' bgcolor=transparent
readonly=true type=text value=10:00 border=0 name=disp></TR>");
out.println( "<tr><td align=left colspan=2>"+rs.getString(1)
+"&nbsp;&nbsp;&nbsp;" + rs.getString(2)+"</tr>");
out.println("<tr><td align=left colspan=2> <input type='radio' name='o1' value=1>
1." + rs.getString(5)+"<br><input type='radio' name='o1' value=2> 2." +
rs.getString(6)+"<br><input type='radio' name='o1' value=3> 3." +
rs.getString(7)+"<br><input type='radio' name='o1' value=4> 4." +
rs.getString(8)+"</tr>" );
%>
<input type=hidden name=q_id value=<%= qid %>>
<input type=hidden name=ans value=<%= s2 %>>
<input type=hidden name=user value=<%= s3 %>>
<%
}catch(Exception e){}
%>
<tr bgcolor="transparent">
<td align=center colspan=2><input type=button value=" PREVIOUS " onclick=fun1()>
<input type=button value=" SUBMIT " onclick=fun2()>
<input type=button value=" NEXT " onclick=fun3()>
ONLINE EXAMINATION SYSTEM
Page 38
<input type=button value=" EXIT "
onclick="location.href='result.jsp'">
</table>
</font>
</center>
</form>
</body>
</html>
PAGE:exam2.java
import java.io.IOException;
import javax.servlet.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import javax.servlet.http.HttpSession;
import javax.servlet.http.*;
import java.io.*;
/**
* Servlet implementation class for Servlet: exam2
*
*/
public class exam2 extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
static final long serialVersionUID = 1L;
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public exam2() {
super();
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request,
HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO Auto-generated method stub
doPost(request,response);
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request,
HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// TODO Auto-generated method stub
String x=request.getParameter("x");
String t=request.getParameter("t");
int t1=Integer.parseInt(t);
if(x.equals("2"))
{
t1--;
ONLINE EXAMINATION SYSTEM
Page 39
RequestDispatcher view =
request.getRequestDispatcher("exam1.jsp?t="+t1);
view.forward(request, response);
}
else if(x.equals("3"))
{
t1++;
RequestDispatcher view =
request.getRequestDispatcher("exam1.jsp?t="+t1);
view.forward(request, response);
}
else
{
try
{
String s2=request.getParameter("ans");
String s1=request.getParameter("o1");
String qid=request.getParameter("q_id");
String s3=request.getParameter("user");
response.getWriter().print(s3);
int q_id=Integer.parseInt(qid);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott",
"anil");
Statement st=con.createStatement();
ResultSet rs2=st.executeQuery("select stud_id from attempt where
q_id="+q_id);
if(!rs2.next())
{
ResultSet rs1=st.executeQuery("select * from sett");
rs1.next();
int x1=Integer.parseInt(rs1.getString(4));
int x2=Integer.parseInt(rs1.getString(3));
if(s1!=null)
{
int ans1 = Integer.parseInt(s1);
if(s2.equals(s1))
{
st.execute("insert into attempt
values("+s3+","+q_id+","+ans1+","+x1+")");
}
else
{
st.execute("insert into attempt
values("+s3+","+q_id+","+ans1+","+-x2+")");
}
}
t1++;
RequestDispatcher view =
request.getRequestDispatcher("exam1.jsp?t="+t1);
view.forward(request, response);
}
else
{
/* PrintWriter pw = response.getWriter();
response.setContentType("text/html");
ONLINE EXAMINATION SYSTEM
Page 40
pw.println("<html><head>"+
"<script language="text/javascript">"+
"alert (" already submitted")"+
"</script></head></html>"); */
RequestDispatcher view =
request.getRequestDispatcher("exam1.jsp?t="+t1);
view.forward(request, response);
}
}
catch(Exception e)
{
response.getWriter().print(e);
}
}
}
}
PAGE:result.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<body background="img36.jpg">
<font face="Times New Roman" color=LIGHTYELLOW size=5 >
<CENTER>
<table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent">
<BR><BR><BR><BR>
<th bgcolor="transparent" colspan=2>
<font face="Times New Roman" color=LIGHTGREY size=7>
RESULT<BR></font></th>
<%
try{
int i=0,marks=0,ta=0,flag=0;
Object s3=session.getAttribute("user");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil");
Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
ResultSet rs1=st.executeQuery("select * from sett");
rs1.next();
String x=rs1.getString(4);
ResultSet rs=st.executeQuery("select * from attempt");
while(rs.next())
{
ta=ta+1;
if(x.equals(rs.getString(4)))
{
i=i+1;
}
marks=marks+Integer.parseInt(rs.getString(4));
ONLINE EXAMINATION SYSTEM
Page 41
}
st.execute("insert into result values("+s3+","+ta+","+i+","+marks+")");
out.println("<tr><td>NUMBER OF QUESTIONS ATTEMPTED:<td><B>"+ta+"</B></tr>");
out.println("<tr><td>NUMBER OF CORRECT ANSWERS :<td><B>"+i+"</B></tr>");
out.println("<tr><td>TOTAL MARKS OBTAINED :<td><B>"+marks+"</B></tr>");
st.execute("delete from attempt");
}catch(Exception e1)
{}%>
<tr bgcolor="transparent">
<td align=center colspan=2><input type="button" value=" CLOSE "
onclick="window.close()"></tr>
</table>
</CENTER>
</font>
</body>
</html>
ONLINE EXAMINATION SYSTEM
Page 42
SNAPSHOTS:
ONLINE EXAMINATION SYSTEM
Page 43
ONLINE EXAMINATION SYSTEM
Page 44
ONLINE EXAMINATION SYSTEM
Page 45
Future scope
There have been numerous cases of computer glitches, errors in content, and security lapses reported in
online examination .So in the near future the so –called software could be made more secure and
reliable.While electronic glitches are rare, they have been known to occur, for instance when computer
crashes voided the efforts of thousands of student. There are also cases in which the correction software has
corrupted scores. so the software can be programmed well so as to avoid corrupted scores.
CONCLUSION
The On line test System is developed using visual basic and sql fully meets the objectives of the system for
which it has been developed. The system is operated at a high level of efficiency and all the teachers and
user associated with the system understands its advantage. The system solves the problem. It was intended
to solve as requirement specification.

More Related Content

What's hot

Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation OmarUsman6
 
Software Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software TestingSoftware Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software TestingKostCare
 
Introduction to jmeter
Introduction to jmeterIntroduction to jmeter
Introduction to jmetertest test
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman
 
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...Simplilearn
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.pptAna Sarbescu
 
14.project online eamination system
14.project online eamination system14.project online eamination system
14.project online eamination systemjbpatel7290
 
Quiz managment system
Quiz managment systemQuiz managment system
Quiz managment systemtamourk2
 
ONLINE EXAMINATION SYSTEM
ONLINE EXAMINATION SYSTEM ONLINE EXAMINATION SYSTEM
ONLINE EXAMINATION SYSTEM Aakanksha .
 
Postman: An Introduction for Testers
Postman: An Introduction for TestersPostman: An Introduction for Testers
Postman: An Introduction for TestersPostman
 
Quizine: An online Test
Quizine: An online TestQuizine: An online Test
Quizine: An online TestRandhir Gupta
 
Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationJay Jha
 

What's hot (20)

Appium Presentation
Appium Presentation Appium Presentation
Appium Presentation
 
Software Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software TestingSoftware Testing Fundamentals | Basics Of Software Testing
Software Testing Fundamentals | Basics Of Software Testing
 
Online examination system
Online examination systemOnline examination system
Online examination system
 
Postman
PostmanPostman
Postman
 
Introduction to jmeter
Introduction to jmeterIntroduction to jmeter
Introduction to jmeter
 
Online Exam System
Online Exam SystemOnline Exam System
Online Exam System
 
Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)Postman Collection Format v2.0 (pre-draft)
Postman Collection Format v2.0 (pre-draft)
 
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
Selenium WebDriver Tutorial | Selenium WebDriver Tutorial For Beginner | Sele...
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Online Quiz System
Online Quiz SystemOnline Quiz System
Online Quiz System
 
Online quiz
Online quizOnline quiz
Online quiz
 
14.project online eamination system
14.project online eamination system14.project online eamination system
14.project online eamination system
 
Quiz managment system
Quiz managment systemQuiz managment system
Quiz managment system
 
ONLINE EXAMINATION SYSTEM
ONLINE EXAMINATION SYSTEM ONLINE EXAMINATION SYSTEM
ONLINE EXAMINATION SYSTEM
 
Postman: An Introduction for Testers
Postman: An Introduction for TestersPostman: An Introduction for Testers
Postman: An Introduction for Testers
 
Quizine: An online Test
Quizine: An online TestQuizine: An online Test
Quizine: An online Test
 
Performance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authenticationPerformance testing using Jmeter for apps which needs authentication
Performance testing using Jmeter for apps which needs authentication
 
Mcq peresentation
Mcq  peresentationMcq  peresentation
Mcq peresentation
 
What is the psychology of testing
What is the psychology of testingWhat is the psychology of testing
What is the psychology of testing
 
Appium
AppiumAppium
Appium
 

Similar to Online Examination Java Projectreport.docx

10.project online exam system
10.project  online exam system10.project  online exam system
10.project online exam systemIram hasan
 
Project Report Online Test
Project Report Online TestProject Report Online Test
Project Report Online TestAbhishek Kumar
 
Assesmment System - project report
Assesmment System - project reportAssesmment System - project report
Assesmment System - project reportArpit Pandya
 
Synopsis on Online examination system using php
Synopsis on Online examination system using phpSynopsis on Online examination system using php
Synopsis on Online examination system using phpArchana Jha
 
A_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdf
A_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdfA_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdf
A_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdfAmishGupta15
 
A Project Report ON ONLINE EXAMS SYSTEM
A Project Report ON ONLINE EXAMS SYSTEMA Project Report ON ONLINE EXAMS SYSTEM
A Project Report ON ONLINE EXAMS SYSTEMDawn Cook
 
A Survey on Design of Online Judge System
A Survey on Design of Online Judge SystemA Survey on Design of Online Judge System
A Survey on Design of Online Judge SystemIRJET Journal
 
quiz game project report.pdf
quiz game project report.pdfquiz game project report.pdf
quiz game project report.pdfzccindia
 
Online Quiz System Project Report
Online Quiz System Project Report Online Quiz System Project Report
Online Quiz System Project Report Kishan Maurya
 
online learning and examination website
online learning and examination websiteonline learning and examination website
online learning and examination websiteAnuj Kumar
 
Online Exam System_Industrial Report
Online Exam System_Industrial ReportOnline Exam System_Industrial Report
Online Exam System_Industrial ReportManmeet Sinha
 
ONLINE EXAMINATION on ASP.NET
ONLINE EXAMINATION on ASP.NETONLINE EXAMINATION on ASP.NET
ONLINE EXAMINATION on ASP.NETRupam Dey
 
Online examination system
Online examination system Online examination system
Online examination system IRJET Journal
 
Software requirement specification
Software requirement specificationSoftware requirement specification
Software requirement specificationAmit Gandhi
 

Similar to Online Examination Java Projectreport.docx (20)

10.project online exam system
10.project  online exam system10.project  online exam system
10.project online exam system
 
Project Report Online Test
Project Report Online TestProject Report Online Test
Project Report Online Test
 
Assesmment System - project report
Assesmment System - project reportAssesmment System - project report
Assesmment System - project report
 
Synopsis on Online examination system using php
Synopsis on Online examination system using phpSynopsis on Online examination system using php
Synopsis on Online examination system using php
 
4176.pdf
4176.pdf4176.pdf
4176.pdf
 
A_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdf
A_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdfA_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdf
A_Project_Report_ON_ONLINE_EXAMS_SYSTEM.pdf
 
A Project Report ON ONLINE EXAMS SYSTEM
A Project Report ON ONLINE EXAMS SYSTEMA Project Report ON ONLINE EXAMS SYSTEM
A Project Report ON ONLINE EXAMS SYSTEM
 
Online Exam
Online ExamOnline Exam
Online Exam
 
A Survey on Design of Online Judge System
A Survey on Design of Online Judge SystemA Survey on Design of Online Judge System
A Survey on Design of Online Judge System
 
Final report
Final reportFinal report
Final report
 
quiz game project report.pdf
quiz game project report.pdfquiz game project report.pdf
quiz game project report.pdf
 
Online Quiz System Project Report
Online Quiz System Project Report Online Quiz System Project Report
Online Quiz System Project Report
 
Student Work Flow System
Student Work Flow SystemStudent Work Flow System
Student Work Flow System
 
online learning and examination website
online learning and examination websiteonline learning and examination website
online learning and examination website
 
Online Exam System_Industrial Report
Online Exam System_Industrial ReportOnline Exam System_Industrial Report
Online Exam System_Industrial Report
 
ONLINE EXAMINATION on ASP.NET
ONLINE EXAMINATION on ASP.NETONLINE EXAMINATION on ASP.NET
ONLINE EXAMINATION on ASP.NET
 
Online examination system
Online examination system Online examination system
Online examination system
 
Software requirement specification
Software requirement specificationSoftware requirement specification
Software requirement specification
 
kats.ppt
kats.pptkats.ppt
kats.ppt
 
E-Examination
E-ExaminationE-Examination
E-Examination
 

Recently uploaded

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...ranjana rawat
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 

Recently uploaded (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
(TARA) Talegaon Dabhade Call Girls Just Call 7001035870 [ Cash on Delivery ] ...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 

Online Examination Java Projectreport.docx

  • 1. ONLINE EXAMINATION SYSTEM Page 1 A Mini Project Report on “Online Examination System Using JSP Servlet, JSTL and CSS ” by Shristi Sharma- B218050 Tanisha Patil- B218069 Of BTech Academic Year: 2021-2022 School of Computer Engineering & Technology
  • 2. ONLINE EXAMINATION SYSTEM Page 2 CONTENTS  Introduction  Overview  Introduction to JAVA  ER Diagram  Converting ER Diagram into Tables  Table Structures  Code  Snapshots  Conclusion  Scope of Enhancement
  • 3. ONLINE EXAMINATION SYSTEM Page 3 ACKNOWLEDGEMENT Before getting into the thick of the things, we would like to express our deep gratitude to the people who helped us during the course of this project. We are grateful to our project guide Mr. Rahul Desai for her guidance throughout this project research and work We also wish to thank all the faculty members of Information Technology and our respectable Head of Department Prof. D G Auradkar for their constant help and efficient teaching procedures, Names of students: Anil yadav(4307) N Karthik(4331) Pradeep Deshwal(4337)
  • 4. ONLINE EXAMINATION SYSTEM Page 4 1. ABSTRACT Exam Software is a Test Management Software, which offers a complete solution for Computer Based Test (CBT) .They are used to set up multiple choice tests for set time periods that when submitted are automatically corrected and the results logged beside the student's reference number. FEATURES  Administrator login.  Student registration.  Management and update of student information ,instructions and questions.  scope for fixing negative marks and maximum marks to each question.  Display of result in the form of total score ,correct responses attempted and non attempted questions. WHAT IMPACT DOES IT HAVE  Physical presence at a given location is absolutely not necessary.  No time is spent on evaluation.  Results are available instantly.  The time of starting and completion of examination can be recorded at the server and the student cannot manipulate the same.  Even for subjects that the actual examination that will not be conducted online students can be given extensive practice and training by holding online Mock Tests.  Almost all competitive exams are multiple choice types and these can be easily conducted online, for example GCET - Goa Common Entrance Test held to shortlist candidates for medical and engineering courses.  Trends of the examination including topic wise trends of each subject can be easily obtained if required.
  • 5. ONLINE EXAMINATION SYSTEM Page 5 2. INTRODUCTION PURPOSE  The purpose of on-line test simulator is to take online test in an efficient manner and no time wasting for checking the paper.  The main objective of on-line test is to efficiently evaluate the candidate thoroughly through a fully automated system that not only saves lot of time but also gives fast results.  For students they give papers according to their convenience and time and there is no need of using extra thing like paper, pen etc. SCOPE Scope of this project is very broad in terms of other manually taking exams. Few of them are:-  This can be used in educational institutions as well as in corporate world.  No restriction that examiner has to be present when the candidate takes the test. FEATURES:  Secure  Easy to use  Reliable and accurate  No need of examiner OVEVIEW The online test created for taking online test has following stages  Login  Test
  • 6. ONLINE EXAMINATION SYSTEM Page 6  Result LOGIN:-  There is a quality login window because this is more secure than other login forms as in a normal login window there are multiple logins available so that more than one person can access to test with their individual login.  It include two login windows one for administrator and another one for student. TEST:  Test page is the most creative and important page in this project. It  consists of 2 modules namely:  Subject selection  Utilities  Utilities:- It includes:-  Skip and come back to the question afterwards ifneeded.  Gives the list of attempted and unattempted questions and can go to any question directly and can either attempt or change the answer of the already attempted question.
  • 7. ONLINE EXAMINATION SYSTEM Page 7 TECHNOLOGIES USED  Front end as: Eclipse Platform  Back end as: Oracle  Database: Oracle  Querying language: SQL
  • 8. ONLINE EXAMINATION SYSTEM Page 8 3. SPECIFIC REQUIREMENTS: External interface utilised: HARDWARE 1.) Minimum 5 GB space in HDD 2.) IBN Net vista Pentium 4 1.7 GHz 3.) 256 MB DDR SDRAM 4.) GB ULTRA HDD 7200 RPM 5.) 48 x CD ROM 6.) 15 `` color monitor SOFTWARE 1. Eclipse Platform 2. Windows 7 (Ultimate) 3. ODBC Driver 4. Oracle DBMS with SQL 8.0 Plus
  • 9. ONLINE EXAMINATION SYSTEM Page 9 Introduction to Java  Java is Object oriented, Multi-threading language developed by Sun Microsystems in 1991.  It is designed to be small, simple and portable across different platforms as well as OS. Features of Java : Syntax based on C++  Object-oriented  Support for Internet applications  Extensive library of prewritten classes  Portability among platforms  Built-in networking security as JRE is inaccessible to other parts of computer Java Programs:  Applets:  Small programs designed to add interactivity to Web sites  Downloaded with the Web page and launched by the Internet browser  Servlets :  Run by Web server on the server  Typically generate Web content  Applications:  Programs that run standalone on a client
  • 10. ONLINE EXAMINATION SYSTEM Page 10 Java Servlets:  Servlets are server side applets that are loaded and executed by a web server in the same manner that applets are loaded and executed by a web browser.  Java Servlets are useful to create Dynamic pages. Depending upon my input server will give an output Features of Servlets:  Database Connectivity o Insert/Update/delete/drop o Select  Servlets Chaining  Server Side Includes  Applet Servlet Communication  Interservlet Communication  Page Compilation  Session Tracking JSP: Introduction:  As a Java-based technology, it enjoys all of the advantages that the java language provides with respect to development and deployment.  JSP runs on major web platforms.  Client (web browser) makes a request via an HTTP.  The web server receives the request and sends it to the Servlets/JSP engine. If the Servlets/JSP is not loaded, the web server will load it into the JVM and execute it.  Web server returns response to the Client. JSP Directives: They generate side effects that are change the way the JSP container processes the page. Implicit Objects:
  • 11. ONLINE EXAMINATION SYSTEM Page 11  Request  Response  Out  Session  Application  Page Context  Exception JSP Actions: The JSP actions allow the transfer of control between pages.  Forward  Include  Plug-in JavaScript: A scripting language is a lightweight programming language which is basically responsible for  Creating Dynamic Pages.  Respond to the events.  Read and Write HTML Elements.  Validate Data. Functions:  Functions are useful to a programmer when certain tasks are to be repeated during the course of the program. They are defined by name and invoked with the same. The functions can take parameters and return result using return statement.  Recursive Functions are functions that call themselves. Events:  Events are signals generated when specific event occurs. Event handlers are scripts written by the programmer to take advantages of events in JavaScript. Eg: blur : Occurs when user clicks outside a field. click: Occurs when user clicks inside a field. change: Occurs when user changes a field. focus : Occurs when user focuses over a field
  • 12. ONLINE EXAMINATION SYSTEM Page 12 E-R diagram Administrator updates updates updates student Question questionQues tion attempts s pwd id stud₋name m id gets Result Question Rules Question $stud-id phone id $stud-id ansgiven id $q-id q-id ques id ans id author id op2 id op3 id op1 id op4 id marks updates sett Question setno nmarks nnkfjn mnmar ks id time id pmarks nnkfjn mnmar ks id $stud-id q₋correct q₋attempted d id t₋marks nnkfjn mnmar ks id
  • 13. ONLINE EXAMINATION SYSTEM Page 13 CONVERTING E-R INTO TABLES STUDENT- TABLE S.No. Field name Data Type Description 1. STUD_ID(pk) NUMBER(8) Student identification number 2 Q_ID(pk) NUMBER(2) Question id 3 ANSGIVEN NUMBER(1) Response 4 MARKS NUMBER(1) Marks of each question ATTEMPT- TABLE S.No. Field name Data Type Description 1. STUD_ID(pk) NUMBER(4) Student identification number 2 Q_ATTEMPTED NUMBER(2) Questions attempted 3 Q_CORRECT NUMBER(3) Correct responses 4 T_MARKS NUMBER(3) Total marks RESULT- TABLE S.No. Field name Data Type Description 1. STUD_ID(pk) NUMBER(8) Student identification number 2 STUD_NAME VARCHAR2(10) Name of student 3 PHONE NUMBER(10) Student’s contact number 4 PWD VARCHAR2(8) Password
  • 14. ONLINE EXAMINATION SYSTEM Page 14 SETT-TABLE S.No. Field name Data Type Description 1. TIME NUMBER(2) Time duration 2 NMARKS NUMBER(2) Negative Marks 3 PMARKS NUMBER(2) Positive Marks QUESTION- TABLE S.No. Field name Data Type Description 1 Q_ID NUMBER(2) Question id 2 QUES VARCHAR2(100) Question 3 ANS NUMBER(1) Correct answer of question 4 AUTHOR VARCHAR2(20) Author 5 OP1 VARCHAR2(40) Option 1 6 OP2 VARCHAR2(40) Option2 7 OP3 VARCHAR2(40) Option3 8 OP4 VARCHAR2(40) Option4
  • 15. ONLINE EXAMINATION SYSTEM Page 15 RELATIONAL DATABASE DESIGN The database consists of following tables:  Student table  Attempt table  result table  question table  setting table  rules  Administrator updates student table where primary key is stud_id its other attributes like password , name, phone are dependent on it. ‘Attempt‘ is a many to one relationship between entities student and question .  ‘Attempt’ contains compositeprimary keys (stud_id,q_id).its attributes are dependent on this composite primary key,stud_id,q_id act as foreign key for both student table and question table.  Question table contains q_id as its primary key which uniquely defines the entire question table.  ‘Gets’ relationship connects student and result entities where primary key is stud_id.  Administrator updates setting table which contains positive marks, negative marks, time limit, total marks.  Administrator also updates rules or instructions.
  • 16. ONLINE EXAMINATION SYSTEM Page 16 SOURCE CODE PAGE:page1.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>AIT EXAM</title> </head> <body background="img36.jpg"> <center> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <th bgcolor="transparent" colspan=2> <IMG style="WIDTH: 120px; HEIGHT: 90px" height=90 src="aitlogo2.gif" width=115 > <BR> <font face="Times New Roman" color=white size=15 >ARMY INSTITUTE OF TECHNOLOGY</FONT><BR></th> <tr bgcolor="transparent"> <td valign=top> <font size=5 face="Times New Roman" color=LIGHTYELLOW> DEPARTMENT OF INFORMATION TECHNOLOGY<BR><BR></font> <font face="Times New Roman" color=LIGHTYELLOW size=5> <MARQUEE direction=left WIDTH=100% BEHAVIOR=SCROLL BGColor=TRANSPARENT >ONLINE EXAMINATION</MARQUEE><BR><BR> <input type="button" value=" STUDENT LOGIN " onclick="location.href='studlog.jsp'" ><br><BR> <input type="button" value="ADMINISTRATOR LOGIN" onclick="location.href='adminlogin.jsp'"><br><BR> <input type="button" value=" CLOSE " onclick="window.close()"><br><BR> </font> </tr> </body> </html> PAGE:adminlogin.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <SCRIPT type="text/javascript"> window.history.forward(); function noBack() { window.history.forward(); } </SCRIPT> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head>
  • 17. ONLINE EXAMINATION SYSTEM Page 17 <body background="img36.jpg" onLoad=document.f1.t1.focus()> <form name="f1" method="post" action="adminlogin.jsp"> <CENTER> <BR><BR><BR><BR><BR> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <th bgcolor="transparent" colspan=2> <font face="Times New Roman" color=LIGHTgrey size=5 >ADMINISTRATOR LOGIN</FONT><BR></th> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b> USER_ID </b> </font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" size=20 maxlength=20></td> </tr> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>PASSWORD</b> </font> <input type="password" name="t2" size=20 maxlength=20></td> </tr> <tr bgcolor="transparent"> <td valign=top > <input type="submit" name="b1" value=" LOGIN "> <input type="button" value=" EXIT " onclick="location.href='page1.jsp'"> </tr> </TABLE> </CENTER> </form> <% int flag=0; String user=request.getParameter("t1"); String pass=request.getParameter("t2"); if(user!=" " && pass!=" ") { try{ if((user.equals("user")) && (pass.equals("pass"))) response.sendRedirect("adminupdate.jsp"); else { %> <script language="javascript"> alert ("Invalid ID/Password"); </script> <% }}catch(Exception e){} } %> </body>
  • 18. ONLINE EXAMINATION SYSTEM Page 18 </html> PAGE:studentregistration.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <body background="img36.jpg"> <%!public int flag=0;%> <form action="studentregistration.jsp" name="f1" method=post> <center> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <BR><BR><BR><BR> <th bgcolor="transparent" colspan=2> <font size=10 face="Times New Roman" color=LIGHTgrey>STUDENT REGISTRATION </font> <br> </th> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>STUDENT_ID</b> </font> &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t2" value="" size=20 maxlength=20></td> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW><b>NAME</b> </font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;<input type="text" name="t1" value="" id="txt1" size=20 maxlength=20></td> </tr> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>CONTACT NO.</b> </font> <input type="text" name="t3" value="" size=20 maxlength=10></td> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>PASSWORD</b> </font> <input type="text" name="t4" value="" size=20 maxlength=20></td> <tr bgcolor="transparent"> <td align=center colspan=2> <input type="SUBMIT" value="SUBMIT" name="submit" > <input type="submit" value="SEARCH" name="submit"> <input type="SUBMIT" value="DELETE"name="submit" > <input type="SUBMIT" value="UPDATE"name="submit"> <% String s=request.getParameter("submit"); String name=request.getParameter("t1"); String id=request.getParameter("t2"); String phone=request.getParameter("t3"); String pwd=request.getParameter("t4");
  • 19. ONLINE EXAMINATION SYSTEM Page 19 try{ if(s.equals("SUBMIT")) { if(id!="" && name!="" && phone!="" && pwd!= "") { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String sql="insert into student values("+id+",'"+name+"',"+phone+",'"+pwd+"')"; st.execute(sql); %> <script language=javascript> alert("Inserted Sucessfully"); </script> <% } else { %> <script language=javascript> alert("Enter All Entries"); </script> <% } } } catch(Exception e1) { } if(!(id==" ")) { try{ if(s.equals("DELETE")) {%> <script language="javascript"> var b=confirm ("Do You Confirm "); if(b==1) { <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String query="delete from student where stud_id="+id; st.executeUpdate(query);
  • 20. ONLINE EXAMINATION SYSTEM Page 20 %> alert("Deleted"); } </script> <% } } catch(Exception e1) { } } if(!(id==" ")) { try{ if(s.equals("SEARCH")) {Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from student where stud_id="+id); if(rs.next()) { %> <script language="javascript"> alert("search found"); document.f1.t2.value="<%=rs.getString(1)%>"; document.f1.t1.value="<%=rs.getString(2)%>"; document.f1.t3.value="<%=rs.getString(3)%>"; document.f1.t4.value="<%=rs.getString(4)%>"; </script> <% } else { %> <script language="javascript"> alert("Record not found"); </script> <% } } } catch(Exception e1) { } } if(!(name==" " && id==" " && phone==" " && pwd== " ")) { try{ if(s.equals("UPDATE")) { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  • 21. ONLINE EXAMINATION SYSTEM Page 21 Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String query="update student set stud_id="+id+",stud_name='"+name+"',phone="+phone+",pwd='"+pwd+"'where stud_id="+id; st.executeUpdate(query); %> <script language=javascript> alert("Updated Sucessfully"); </script> <% } }catch(Exception e1) { } } %> <input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'"> </tr> </table> </center> </form> </body> </html> PAGE:question.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"import="java.sql.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <%!public int i=1;%> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body background="img36.jpg"> <form action="question.jsp" name="f1" method=post> <center> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <BR><BR><BR><BR> <th bgcolor="transparent" colspan=2> <font size=10 face="Times New Roman" color=LIGHTgrey>QUESTION BANK</font> <br> </th> <tr bgcolor="transparent"> <td valign=top> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>Q.NO.</b> </font> <input type="text" name="t1" value="" id="txt1" size=3 maxlength=3></td> <td valign=top> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>AUTHOR</b> </font>
  • 22. ONLINE EXAMINATION SYSTEM Page 22 <input type="text" name="t2" value="" size=30 maxlength=30></td> </tr> <tr bgcolor="transparent"> <td align=center colspan=2> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>QUESTION</b> </font> <br><TEXTAREA name="t3" rows=5 cols=100 Wrap=true> </TEXTAREA></td> </tr> <tr bgcolor="transparent"> <td align=center colspan=2> <input type='radio' name='o1' value=1>1 <input type="text" name="t4" value="" size=40 maxlength=40><br> <input type='radio' name='o1'value=2>2 <input type="text" name="t5" value="" size=40 maxlength=40><br> <input type='radio' name='o1'value=3>3 <input type="text" name="t6" value="" size=40 maxlength=40><br> <input type='radio' name='o1'value=4>4 <input type="text" name="t7" value="" size=40 maxlength=40> </td> </tr> <tr bgcolor="transparent"> <td align=center colspan=2> <input type="SUBMIT" value="SUBMIT" name="submit" > <input type="submit" value="SEARCH" name="submit"> <input type="SUBMIT" value="DELETE"name="submit" > <input type="SUBMIT" value="UPDATE"name="submit"> <% String s=request.getParameter("submit"); String qid=request.getParameter("t1"); String author=request.getParameter("t2"); String quest=request.getParameter("t3"); String op1=request.getParameter("t4"); String op2=request.getParameter("t5"); String op3=request.getParameter("t6"); String op4=request.getParameter("t7"); String ans=request.getParameter("o1"); //int ans2=Integer.parseInt(ans); try{ if(s.equals("SUBMIT")) { if(qid!=null && author!=null && quest!=null && op1!=null && op2!=null && op3!=null && op4!=null && ans!=null) { //int qid2=Integer.parseInt(qid); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); String query1="insert into question values("+qid+",'"+quest+"',"+ans+",'"+author+"','"+op1+"','"+op2+"','"+op3+"','"+op4+"' )"; st.executeUpdate(query1); %> <script language=javascript> alert("Inserted Sucessfully");
  • 23. ONLINE EXAMINATION SYSTEM Page 23 </script> <% } else { %> <script language=javascript> alert("Enter all entries"); </script> <% } } }catch(Exception e1) {out.println(e1);} if(!( qid==" " )) { try{ if(s.equals("SEARCH")) { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from question where q_id="+qid); if(rs.next()) { %> <script language="javascript"> alert("search found"); document.f1.t1.value="<%=rs.getString(1)%>"; document.f1.t3.value="<%=rs.getString(2)%>"; document.f1.t2.value="<%=rs.getString(4)%>"; document.f1.t4.value="<%=rs.getString(5)%>"; document.f1.t5.value="<%=rs.getString(6)%>"; document.f1.t6.value="<%=rs.getString(7)%>"; document.f1.t7.value="<%=rs.getString(8)%>"; </script> <% } else { %> <script language="javascript"> alert("Record not found"); </script> <% } } }catch(Exception e1) { } }
  • 24. ONLINE EXAMINATION SYSTEM Page 24 if(!(qid==" " && author==" " && quest==" " && op1== " "&& op2== " "&& op3== " "&& op4== " "&& ans== " ")) { try{ if(s.equals("UPDATE")) { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String query="update question set q_id="+qid+",ques='"+quest+"',ans="+ans+",author='"+author+"',op1='"+op1+"',op2='"+op2+ "',op3='"+op3+"',op4='"+op4+"'where q_id="+qid; st.executeUpdate(query); %> <script language=javascript> alert("Updated Sucessfully"); </script> <% } }catch(Exception e1) { } } if(!(qid==" ")) { try{ if(s.equals("DELETE")) { %> <script language="javascript"> var b=confirm ("Do You Confirm "); if(b==1) { <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String query="delete from question where q_id="+qid; st.executeUpdate(query); %> alert("Deleted"); } </script> <% } }catch(Exception e1) { } }
  • 25. ONLINE EXAMINATION SYSTEM Page 25 %> <input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'"> </td> </tr> </table> </center> </form> </body> </html> PAGE:adminupdate.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <SCRIPT type="text/javascript"> window.history.forward(); function noBack() { window.history.forward(); } </SCRIPT> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body background="img36.jpg"> <form action="adminupdate.jsp" name="f1" method=post> <br><br><br><br> <center> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <th bgcolor="transparent" colspan=2> <font face="Times New Roman" color=LIGHTGREY size=5>ADMINISTRATOR</FONT><BR></th> <tr bgcolor="transparent"> <td valign=top > <input type="button" value="STUDENT INFO" onclick="location.href='studentregistration.jsp'" ><br><BR> <input type="button" value=" QUESTIONS " onclick="location.href='question.jsp'"><br><BR> <input type="button" value="INSTRUCTIONS" onclick="location.href='.jsp'" ><br><BR> <input type="button" value=" SETTINGS " onclick="location.href='settings.jsp'" ><br><BR> <input type="SUBMIT" value="RESET RECORD" name="submit" ><br><BR> <input type="button" value=" LOGOUT " onclick="location.href='page1.jsp' " > <% String s=request.getParameter("submit"); try{ if(s.equals("RESET RECORD")) {%> <script language="javascript"> var b=confirm ("Do You Confirm "); if(b==1) { <%
  • 26. ONLINE EXAMINATION SYSTEM Page 26 Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String query="delete from result "; st.executeUpdate(query); %> alert("Deleted"); } </script> <% } } catch(Exception e1) { } %> </td> </tr> </table> </center> </form> </body> </html> PAGE:ins_update.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body background="img36.jpg"> <form action="ins_update.jsp" name="f1" method=post> <center> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent" style="position:absolute;left:30px;top:25px" width=500 height=400> <th bgcolor="transparent" colspan=2> <font size=10 face="Times New Roman" color=LIGHTgrey>INSTRUCTIONS</font> <br> </th> <tr bgcolor="transparent"> <td valign=top ALIGN="LEFT"> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>SR. NO.</b> </font> <input type="text" name="t1" value="" id="txt1" size=3 maxlength=3><BR><BR><BR>. <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>INSTRUCTION</b> </font>
  • 27. ONLINE EXAMINATION SYSTEM Page 27 <br><TEXTAREA name="t2" rows=5 cols=60 Wrap=true> </TEXTAREA></td> </tr> <tr bgcolor="transparent"> <td align=center colspan=2> <input type="SUBMIT" value="SUBMIT" name="submit" > <input type="SUBMIT" value="DELETE"name="submit" > <input type="SUBMIT" value="UPDATE"name="submit"> <% String s=request.getParameter("submit"); String id=request.getParameter("t1"); String inst=request.getParameter("t2"); //int ans2=Integer.parseInt(ans); try{ if(s.equals("SUBMIT")) { if(id!=null && inst!=null ) { //int qid2=Integer.parseInt(qid); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); String query1="insert into rule values('"+inst+"',"+id+")"; st.executeUpdate(query1); %> <script language=javascript> alert("Inserted Sucessfully"); </script> <% } else { %> <script language=javascript> alert("Enter All Enteries"); </script> <% } } }catch(Exception e1) {} if(!( id==" " )) { try{ if(s.equals("SEARCH"))
  • 28. ONLINE EXAMINATION SYSTEM Page 28 { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from rule where ins_id="+id); if(rs.next()) { %> <script language="javascript"> alert("search found"); document.f1.t1.value=<%=rs.getString(2)%>; document.f1.t2.value=<%=rs.getString(1)%>; </script> <% } else { %> <script language="javascript"> alert("Record not found"); </script> <% } } }catch(Exception e1) { } } if(!(id==" " && inst== " ")) { try{ if(s.equals("UPDATE")) { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String query="update rule set ins_id="+id+",inst='"+inst+"'where ins_id="+id; st.executeUpdate(query); %> <script language=javascript> alert("Updated Sucessfully"); </script> <% } }catch(Exception e1) { } } if(!(id==" ")) {
  • 29. ONLINE EXAMINATION SYSTEM Page 29 try{ if(s.equals("DELETE")) { %> <script language="javascript"> var b=confirm ("Do You Confirm "); if(b==1) { <% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); String query="delete from rule where ins_id="+id; st.executeUpdate(query); %> alert("Deleted"); } </script> <% } }catch(Exception e1) { } } %> <input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'"> </td> </tr> </table> </center> <font face="Times New Roman" color=LIGHTYELLOW size=5 > <TABLE border=10 style="position:absolute;left:660px;top:25px " width=600> <%Object s3=session.getAttribute("name"); %> <% try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from rule order by ins_id"); while(rs.next()) { %> <tr> <% out.println("<td>"+rs.getString(2)); out.println( "<td>"+rs.getString (1)); %> </tr> <%
  • 30. ONLINE EXAMINATION SYSTEM Page 30 } }catch(Exception e1) {} %> </TABLE> </font> </form> </body> </html> PAGE:ins_update.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body background="img36.jpg"> <form action="settings.jsp" method=post> <center> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <BR><BR><BR><BR> <th bgcolor="transparent" colspan=2> <font size=10 face="Times New Roman" color=LIGHTgrey>SETTINGS </font> <br> </th> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>TIME DURATION</b> </font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" value="" id="txt1" size=20 maxlength=20></td></tr> <TR><td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>POSITIVE MARKS</b> </font> &nbsp;&nbsp;&nbsp;<input type="text" name="t2" value="" size=20 maxlength=20></td> </tr> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>NEGATIVE MARKS</b> </font> <input type="text" name="t3" value="" size=20 maxlength=10></td> <tr bgcolor="transparent"> <td align=center colspan=2> <input type="SUBMIT" value="SUBMIT">
  • 31. ONLINE EXAMINATION SYSTEM Page 31 <% String td=request.getParameter("t1"); String pm=request.getParameter("t2"); String nm=request.getParameter("t3"); if(!(td==" " && pm==" " && nm==" ")) { try{ int x1=Integer.parseInt(td); int x2=Integer.parseInt(pm); int x3=Integer.parseInt(nm); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); st.executeQuery("update sett set time="+x1+",pmarks="+x2+",nmarks="+x3+"where setno = 1"); %> <script language=javascript> alert("Updated successfully!!"); </script> <% }catch(Exception e1) { } } %> <input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'"> </tr> </table> </center> </form> </body> </html> PAGE:settings.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title>
  • 32. ONLINE EXAMINATION SYSTEM Page 32 </head> <body background="img36.jpg"> <form action="settings.jsp" method=post> <center> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <BR><BR><BR><BR> <th bgcolor="transparent" colspan=2> <font size=10 face="Times New Roman" color=LIGHTgrey>SETTINGS </font> <br> </th> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>TIME DURATION</b> </font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" value="" id="txt1" size=20 maxlength=20></td></tr> <TR><td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>POSITIVE MARKS</b> </font> &nbsp;&nbsp;&nbsp;<input type="text" name="t2" value="" size=20 maxlength=20></td> </tr> <tr bgcolor="transparent"> <td valign=top align=left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> <b>NEGATIVE MARKS</b> </font> <input type="text" name="t3" value="" size=20 maxlength=10></td> <tr bgcolor="transparent"> <td align=center colspan=2> <input type="SUBMIT" value="SUBMIT"> <% String td=request.getParameter("t1"); String pm=request.getParameter("t2"); String nm=request.getParameter("t3"); if(!(td==" " && pm==" " && nm==" ")) { try{ int x1=Integer.parseInt(td); int x2=Integer.parseInt(pm); int x3=Integer.parseInt(nm); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); st.executeQuery("update sett set time="+x1+",pmarks="+x2+",nmarks="+x3+"where setno = 1"); %> <script language=javascript> alert("Updated successfully!!");
  • 33. ONLINE EXAMINATION SYSTEM Page 33 </script> <% }catch(Exception e1) { } } %> <input type="button" value=" EXIT " onclick="location.href='adminupdate.jsp'"> </tr> </table> </center> </form> </body> </html> PAGE:studlog.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <%@ page language ="java" import="java.sql.*" %> <html> <SCRIPT type="text/javascript"> window.history.forward(); function noBack() { window.history.forward(); } </SCRIPT> <body background="img36.jpg" onLoad=document.f1.t1.focus()> <form name="f1" method="post"> <CENTER> <BR><BR><BR><BR><BR> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <th bgcolor="transparent" colspan=2> <font face="Times New Roman" color=LIGHTgrey size=5 ><B>STUDENT LOGIN</B></FONT><BR></th> <tr bgcolor="transparent"> <td valign=top align =left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> USER_ID </font> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="t1" value="" size=20 maxlength=20></td> </tr> <tr bgcolor="transparent"> <td valign=top align =left> <font size=5 face="Times New Roman" color=LIGHTYELLOW> PASSWORD </font> <input type="password" name="t2" value="" size=20 maxlength=20></td>
  • 34. ONLINE EXAMINATION SYSTEM Page 34 </tr> <tr bgcolor="transparent"> <td valign=top> <input type="submit" name="b1" value="LOGIN"> <input type="button" value="EXIT" onclick="location.href='page1.jsp'"> </tr> </TABLE> </CENTER> <% String user=request.getParameter("t1"); String pass=request.getParameter("t2"); if(user!=" " && pass!=" ") { try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); ResultSet rs=st.executeQuery("select * from student"); while(rs.next()) { String username=rs.getString(1); int stud_id=Integer.parseInt(username); String password=rs.getString(4); String name=rs.getString(2); if(user.equals(username) && pass.equals(password)) { ResultSet rs1=st.executeQuery("select * from result where stud_id="+stud_id); if(!rs1.next()) { session.setAttribute("user",user); session.setAttribute("name",name); %> <jsp:forward page="instructions.jsp" /> <input type=hidden name=user value=<%= username %>> <% } else { %> <script language="javascript"> alert ("ID ALREADY ENTERED"); </script> <% } } } %> <script language="javascript"> alert ("Invalid ID/Password"); </script>
  • 35. ONLINE EXAMINATION SYSTEM Page 35 <% }catch(Exception e1) { } } %> </body> </html> PAGE:exam1.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" import="java.sql.*" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <%String t=request.getParameter("t");int t1=Integer.parseInt(t);%> <script language="JavaScript"> var flag; var secs; function cd() { mins = min; // change minutes here secs = 0 + s(":01"); // change seconds here (always add an additional second to your total) redo(); } function m(obj) { for(var i = 0; i < obj.length; i++) { if(obj.substring(i, i + 1) == ":") break; } return(obj.substring(0, i)); } function s(obj) { for(var i = 0; i < obj.length; i++) { if(obj.substring(i, i + 1) == ":") break; } return(obj.substring(i + 1, obj.length)); } function dis(mins,secs) { var disp; if(mins <= 9) { disp = " 0"; } else { disp = " "; } disp += mins + ":";
  • 36. ONLINE EXAMINATION SYSTEM Page 36 if(secs <= 9) { disp += "0" + secs; } else { disp += secs; } return(disp); } function redo() { secs--; if(secs == -1) { secs = 59; mins--; } document.cd.disp.value = dis(mins,secs); // setup additional displays here. if((mins == 0) && (secs == 0)) { window.alert("Time is up. Press OK to continue."); // change timeout message as required window.location = "exam2.java" } else { cd = setTimeout("redo()",1000); } } function init() { cd(); } document.onload = init; </script> <SCRIPT type="text/javascript"> window.history.forward(); function noBack() { window.history.forward(); } function fun1() { //alert("previous"); document.exam1.action="exam2?t=<%= t1%>&x=2"; exam1.submit(); } function fun2() { //alert("submit"); exam1.submit(); } function fun3() { // alert("next"); document.exam1.action="exam2?t=<%= t1%>&x=3"; exam1.submit(); } </SCRIPT> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <%!public int i=1,qid=0,mark=0,x1=0,x2=0,min1=40;String s2=null;boolean flag=false;%>
  • 37. ONLINE EXAMINATION SYSTEM Page 37 </head> <body background="img36.jpg"> <script language="JavaScript"> var min=19; </script> <form name="cd"> <input id="txt" bgcolor="transparent" readonly="true" type="text" value="10:00" border="0" name="disp"> </form> <form name="exam1" action="exam2?t=<%= t1 %>&x=1" method=post> <center> <font face="Times New Roman" color=LIGHTgrey size=5 > <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <BR><BR> <% try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs=st.executeQuery("select * from question where q_id="+t1); rs.next(); s2=rs.getString(3); qid=Integer.parseInt(rs.getString(1)); Object s3= session.getAttribute("user"); out.println( "<tr> <td align=center > <b> AUTHOR</b> :-" + rs.getString(4) +"<td><B>TIME LEFT </B>:-<input id='txt' bgcolor=transparent readonly=true type=text value=10:00 border=0 name=disp></TR>"); out.println( "<tr><td align=left colspan=2>"+rs.getString(1) +"&nbsp;&nbsp;&nbsp;" + rs.getString(2)+"</tr>"); out.println("<tr><td align=left colspan=2> <input type='radio' name='o1' value=1> 1." + rs.getString(5)+"<br><input type='radio' name='o1' value=2> 2." + rs.getString(6)+"<br><input type='radio' name='o1' value=3> 3." + rs.getString(7)+"<br><input type='radio' name='o1' value=4> 4." + rs.getString(8)+"</tr>" ); %> <input type=hidden name=q_id value=<%= qid %>> <input type=hidden name=ans value=<%= s2 %>> <input type=hidden name=user value=<%= s3 %>> <% }catch(Exception e){} %> <tr bgcolor="transparent"> <td align=center colspan=2><input type=button value=" PREVIOUS " onclick=fun1()> <input type=button value=" SUBMIT " onclick=fun2()> <input type=button value=" NEXT " onclick=fun3()>
  • 38. ONLINE EXAMINATION SYSTEM Page 38 <input type=button value=" EXIT " onclick="location.href='result.jsp'"> </table> </font> </center> </form> </body> </html> PAGE:exam2.java import java.io.IOException; import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.sql.*; import javax.servlet.http.HttpSession; import javax.servlet.http.*; import java.io.*; /** * Servlet implementation class for Servlet: exam2 * */ public class exam2 extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet { static final long serialVersionUID = 1L; /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#HttpServlet() */ public exam2() { super(); } /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doPost(request,response); } /* (non-Java-doc) * @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub String x=request.getParameter("x"); String t=request.getParameter("t"); int t1=Integer.parseInt(t); if(x.equals("2")) { t1--;
  • 39. ONLINE EXAMINATION SYSTEM Page 39 RequestDispatcher view = request.getRequestDispatcher("exam1.jsp?t="+t1); view.forward(request, response); } else if(x.equals("3")) { t1++; RequestDispatcher view = request.getRequestDispatcher("exam1.jsp?t="+t1); view.forward(request, response); } else { try { String s2=request.getParameter("ans"); String s1=request.getParameter("o1"); String qid=request.getParameter("q_id"); String s3=request.getParameter("user"); response.getWriter().print(s3); int q_id=Integer.parseInt(qid); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(); ResultSet rs2=st.executeQuery("select stud_id from attempt where q_id="+q_id); if(!rs2.next()) { ResultSet rs1=st.executeQuery("select * from sett"); rs1.next(); int x1=Integer.parseInt(rs1.getString(4)); int x2=Integer.parseInt(rs1.getString(3)); if(s1!=null) { int ans1 = Integer.parseInt(s1); if(s2.equals(s1)) { st.execute("insert into attempt values("+s3+","+q_id+","+ans1+","+x1+")"); } else { st.execute("insert into attempt values("+s3+","+q_id+","+ans1+","+-x2+")"); } } t1++; RequestDispatcher view = request.getRequestDispatcher("exam1.jsp?t="+t1); view.forward(request, response); } else { /* PrintWriter pw = response.getWriter(); response.setContentType("text/html");
  • 40. ONLINE EXAMINATION SYSTEM Page 40 pw.println("<html><head>"+ "<script language="text/javascript">"+ "alert (" already submitted")"+ "</script></head></html>"); */ RequestDispatcher view = request.getRequestDispatcher("exam1.jsp?t="+t1); view.forward(request, response); } } catch(Exception e) { response.getWriter().print(e); } } } } PAGE:result.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"import="java.sql.*"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <body background="img36.jpg"> <font face="Times New Roman" color=LIGHTYELLOW size=5 > <CENTER> <table cellpadding=8 cellspacing=8 border="10" bgcolor="transparent"> <BR><BR><BR><BR> <th bgcolor="transparent" colspan=2> <font face="Times New Roman" color=LIGHTGREY size=7> RESULT<BR></font></th> <% try{ int i=0,marks=0,ta=0,flag=0; Object s3=session.getAttribute("user"); Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); Connection con=DriverManager.getConnection("jdbc:odbc:abc", "scott", "anil"); Statement st=con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs1=st.executeQuery("select * from sett"); rs1.next(); String x=rs1.getString(4); ResultSet rs=st.executeQuery("select * from attempt"); while(rs.next()) { ta=ta+1; if(x.equals(rs.getString(4))) { i=i+1; } marks=marks+Integer.parseInt(rs.getString(4));
  • 41. ONLINE EXAMINATION SYSTEM Page 41 } st.execute("insert into result values("+s3+","+ta+","+i+","+marks+")"); out.println("<tr><td>NUMBER OF QUESTIONS ATTEMPTED:<td><B>"+ta+"</B></tr>"); out.println("<tr><td>NUMBER OF CORRECT ANSWERS :<td><B>"+i+"</B></tr>"); out.println("<tr><td>TOTAL MARKS OBTAINED :<td><B>"+marks+"</B></tr>"); st.execute("delete from attempt"); }catch(Exception e1) {}%> <tr bgcolor="transparent"> <td align=center colspan=2><input type="button" value=" CLOSE " onclick="window.close()"></tr> </table> </CENTER> </font> </body> </html>
  • 45. ONLINE EXAMINATION SYSTEM Page 45 Future scope There have been numerous cases of computer glitches, errors in content, and security lapses reported in online examination .So in the near future the so –called software could be made more secure and reliable.While electronic glitches are rare, they have been known to occur, for instance when computer crashes voided the efforts of thousands of student. There are also cases in which the correction software has corrupted scores. so the software can be programmed well so as to avoid corrupted scores. CONCLUSION The On line test System is developed using visual basic and sql fully meets the objectives of the system for which it has been developed. The system is operated at a high level of efficiency and all the teachers and user associated with the system understands its advantage. The system solves the problem. It was intended to solve as requirement specification.