Beruflich Dokumente
Kultur Dokumente
PORTAL
By :
Gurjot Singh
Computer Science & Engineering- 1
00313202712
Submitted to:
Mr. Gaurav Sandhu
Ms. Bhavneet Kaur
GURJOT SINGH(00313202712)
Page 1
ABSTRACT
Online examination is an internet based questionnaire.
The questions can be categorized according to type,
topic etc. The test is compiled with questions from
different libraries. Tests are created on a random basis
per student. Online examination helps students and its
mission is to offer a quick and easy way to appear for
the exam. It also provides the results immediately after
the exam. The user can write the exam only with a
valid user name and password. This examination
consists of multiple choice questions and no. of options
for each question out of which one is correct.
GURJOT SINGH(00313202712)
Page 2
GURJOT SINGH(00313202712)
Page 3
CONTENTS-
1.INTRODUCTION
PG 5
2.SRS
PG7
3. CODE
PG12
4. RESULT
PG75
5.SUMMARY
PG76
6.FUTURE SCOPE
GURJOT SINGH(00313202712)
PG77
Page 4
7. SCREEN SHOTS
PG78
INTRODUCTION
1.
JAVA LANGUAGE
Java is a general-purpose, concurrent, class-based, objectoriented computer programming language that is specifically
designed to have as few implementation dependencies as
possible. It is intended to let application developers "write
once, run anywhere" (WORA), meaning that code that runs on
one platform does not need to be recompiled to run on another.
Java applications are typically compiled to bytecode (class file)
that can run on any Java virtual machine (JVM) regardless
of computer architecture. Java was originally developed
by James Gosling at Sun Microsystems (which has since merged
into Oracle Corporation). The language derives much of
its syntax from C and C++, but it has fewer low-level facilities
than either of them.
James Gosling, Mike Sheridan, and Patrick Naughton initiated
the Java language project in June 1991. The language was
initially called Oak after an oak tree that stood outside Gosling's
office and was later renamed Java, from Java coffee, said to be
consumed
in
large
quantities
by
the
language's
creators. Gosling aimed to implement a virtual machine and a
language that had a familiar C/C++ style of notation.
There were five primary goals in the creation of the Java
language:
1. It should be "simple, object-oriented and familiar"
2. It should be "robust and secure"
3. It should be "architecture-neutral and portable"
4. It should execute with "high performance"
GURJOT SINGH(00313202712)
Page 5
2. ONLINE EXAMINATION
OnlineExams is being launched because a need for a
destination that is beneficial for both institutes and students.
With this site, institutes can register and host online exams.
Students can give exams and view their results. This site is an
attempt to remove the existing flaws in the manual system of
conducting exams.
Online Exams System fulfils the requirements of the
institutes to conduct the exams online. They do not have to go
to any software developer to make a separate site for being
able to conduct exams online. They just have to register on the
site and enter the exam details and the lists of the students
which can appear in the exam.
Students can give exam without the need of going to any
physical destination. They can view the result at the same time.
Thus the purpose of the site is to provide a system that saves
the efforts and time of both the institutes and the students.
GURJOT SINGH(00313202712)
Page 6
SOFTWARE REQUIREMENTS
SPECIFICTIONS(SRS)
1.INTRODUCTION
1.1 PURPOSE
The purpose of site CheckTech is to take test in an efficient
manner and no time wasting for checking the paper.
The main objective of this 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
1.2 SCOPE
Scope of this project is very broad in terms of other
manually
taking
exams
GURJOT SINGH(00313202712)
Page 7
1.3 FEATURES:
Secure
Easy to use
Reliable and accurate
No need of examiner
1.4
OVERVIEW
Login
Test
Result
Adding , Deleting and Modifying of questions (only admin
functionality)
Show previous exams history
GURJOT SINGH(00313202712)
Page 8
2.
TECHNOLOGIES USED
Front end as: JAVA Advanced
Back hand as: Oracle database express edition
Querying language: SQL plus
3. SYSTEM SPECIFICATIONS
3.1 Hardware requirements
In hardware requirement we require all those components
which will provide us the platform for the development of the
project. The minimum hardware required for the development
of this project is as follows
Operating System: Any OS with JRE 1.4 or above
installed.
Processor : Pentium 4, 1 GHz or higher
RAM : 256 MB or higher
Hard Drive: 10 GB or higher.
These all are the minimum hardware requirement required for
our project. We want to make our project to be used in any.
Type of computer therefore we have taken minimum
configuration to a large extent.256 MB ram is used so that we
can execute our project in a least possible RAM.10 GB hard disk
GURJOT SINGH(00313202712)
Page 9
GURJOT SINGH(00313202712)
Page 10
GURJOT SINGH(00313202712)
Page 11
CODE
LOGIN.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Login</title>
<link href="../styles.css" rel="stylesheet" />
</head>
<body>
<%@include file="/header.html"%>
<table width="100%" height="600px">
<tr>
<td valign="top"><b>TechCheck.Com</b> provides online
examination system that enables you to asses your knowledge of Java
Language.
<p /> All the you have to do is register for free and login to take
the exam.
<p /> Each exam contains 5 questions with multiple answers. Choose
the right answer and procede to next questions.
<p /> You also have option to nagivate through questions back and
forth.
<p /> At anytime you can see history of your exams, which provides
GURJOT SINGH(00313202712)
Page 12
<h2>Login</h2>
<form action="login.jsp" method="post">
<table>
<tr>
<td>Username :</td>
<td><input type="text" size="10" name="uname"
value="${param.uname}" width="150px" /></td>
</tr>
<tr>
<td>Password :</td>
<td><input type="password" size="10" name="pwd"
width="150px" /></td>
</tr>
</table>
<p />
<input type="submit" value="Login" />
<p />
<a href="register.jsp">Register As New User</a>
GURJOT SINGH(00313202712)
Page 13
<%
if (user.getUname().length() > 0)
if (!user.login())
out.println("<h4>Username or password is incorrect! Try again.");
else if(user.getUname().equals("admin"))
{ session.setAttribute("uname",user.getUname());
response.sendRedirect("../admin.jsp");
}
else
{
session.setAttribute("uname", user.getUname());
response.sendRedirect("../home.jsp");
}
%>
</form>
</td>
</tr>
</table>
</body>
</html>
GURJOT SINGH(00313202712)
Page 14
REGISTER.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Registeration</title>
<link href="../styles.css" rel="stylesheet"/>
</head>
<body>
<%@include file="../header.html"%>
<h2>Registration</h2>
<form action="registerfinal.jsp" method="post">
<table>
<tr>
<td>Username : </td>
<td><input type="text" size="10" name="uname" width="150px"/> </td>
</tr>
<tr>
<td>Password : </td>
<td><input type="password" size="10" name="pwd" width="150px"/> </td>
</tr>
<tr>
GURJOT SINGH(00313202712)
Page 15
<tr>
</table>
<p/>
<input type="submit" value="Register" />
<input type="reset" value="Clear All"/>
</form>
</body>
</html>
GURJOT SINGH(00313202712)
Page 16
REGISTERFINAL.JSP
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Registeration</title>
<link href="../styles.css" rel="stylesheet"/>
</head>
<body>
<%@include file="../header.html"%>
<h2>Registration</h2>
<jsp:useBean id="user" class="beans.UserBean" scope="session"/>
<jsp:setProperty name="user" property="*" />
<%
boolean done = user.register();
if ( done )
out.println("Registration is successful! <p/>Click <a href='login.jsp'>here</a> to
login.");
else
out.println("Registration is NOT successful! <p/>Please try again!");
%>
</body>
</html>
GURJOT SINGH(00313202712)
Page 17
ADDQUES.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>ADDING A QUESTION</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<%@include file="header.html"%>
<h4>ADD A QUESTION</h4>
<form action="addquesimpl.jsp">
<table border=2>
<tr><td>ENTER QUESTION</td><td>:</td><td><input type=text name=t1></td></tr>
<tr><td>ENTER OPTION1</td><td>:</td><td><input type=text name=t2></td></tr>
<tr><td>ENTER OPTION2</td><td>:</td><td><input type=text name=t3></td></tr>
<tr><td>ENTER OPTION3</td><td>:</td><td><input type=text name=t4></td></tr>
<tr><td>ENTER OPTION4</td><td>:</td><td><input type=text name=t5></td></tr>
<tr><td>ENTER CORRECT OPTION NO.</td><td>:</td><td><input type=text
name=t6></td></tr>
<tr><td><input type="submit" value=submit></td><td><input type="reset"
value=reset></td></tr>
</table>
</form>
GURJOT SINGH(00313202712)
Page 18
</body>
</html>
GURJOT SINGH(00313202712)
Page 19
ADDQUESIMPL.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page import= "java.sql.*"%>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
"http://www.w3.org/TR/html4/loose.dtd">
HTML
4.01
Transitional//EN"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>ADD QUESTION IMPLEMENTATION</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<%@include file="header.html"%>
<%
int maxq=0;
String u1=request.getParameter("t1");
String u2=request.getParameter("t2");
String u3=request.getParameter("t3");
String u4=request.getParameter("t4");
String u5=request.getParameter("t5");
String u6=request.getParameter("t6");
try
{Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","hr","asdf");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select max(qid) from questions");
GURJOT SINGH(00313202712)
Page 20
if(rs.next())
{ maxq = rs.getInt(1);
}
maxq++;
st.executeQuery("insert
into
values('"+maxq+"','"+u1+"','"+u2+"','"+u3+"','"+u4+"','"+u5+"','"+u6+"')");
out.println("value inserted successfully");
con.close();
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
</body>
</html>
GURJOT SINGH(00313202712)
Page 21
questions
ADMIN.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
"http://www.w3.org/TR/html4/loose.dtd">
HTML
4.01
Transitional//EN"
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title> admin login</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<%@include file="../header.html"%>
<h4>Welcome, ${uname}</h4>
<table cellpadding="5pt">
<tr>
<td><center> <a href="addques.jsp" class="myButton">Add
Question</a></center><br><br><br><br><br><br><br><br></td>
</tr>
<tr>
<td><center> <a href="display.jsp" class="myButton">Modify or
Delete a Question</a></center></td>
</tr>
</table>
GURJOT SINGH(00313202712)
Page 22
</body>
</html>
GURJOT SINGH(00313202712)
Page 23
CANCELEXAM.JSP
<%
session.removeAttribute("count");
session.removeAttribute("questions");
session.removeAttribute("qno");
response.sendRedirect("home.jsp");
%>
GURJOT SINGH(00313202712)
Page 24
DELETE.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page 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>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<%@include file="header.html"%>
<%
try
{ String s=request.getParameter("q");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","hr","asdf");
Page 25
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
</body>
</html>
GURJOT SINGH(00313202712)
Page 26
DISPLAY.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page 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>QUESTIONS IN DATABASE</title>
Page 27
"<td>"+rs.getString("ans1")+"</td>"+
"<td>"+rs.getString("ans2")+"</td>"+
"<td>"+rs.getString("ans3")+"</td>"+
"<td>"+rs.getString("ans4")+"</td>"+
"<td>"+rs.getString("cans")+"</td>"+
"<td><a href=edit.jsp?q="+rs.getString("qid")
+"><input type=submit value=modify></a></td>"+
"<td><a href=delete.jsp?q="+rs.getString("qid")
+"><input type=submit value=delete></a></td></tr>");
out.println("</table>");
}
con.close();
}
catch(Exception e)
{
out.println(e.getMessage());
}
%>
</body>
</html>
DISPLAYQUESTION.JSP
GURJOT SINGH(00313202712)
Page 28
<%@page import="beans.Question"%>
<%@page contentType="text/html" pageEncoding="UTF-8"
import="java.util.*"%>
<!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=UTF-8">
<title>Examination</title>
<link href="styles.css" rel="stylesheet" />
<script type="text/javascript" >
var tim;
function f2()
{
if (parseInt(sec) > 0)
{
sec = parseInt(sec) - 1;
if(parseInt(min)==0)
{
document.getElementById("showtime").innerHTML = "Time Left : " + sec+"
Seconds";
}
else
GURJOT SINGH(00313202712)
Page 29
{
document.getElementById("showtime").innerHTML = "Time Left : "+min+"
Minutes, " + sec+" Seconds";
}
tim = setTimeout("f2()", 1000);
}
else
{
if (parseInt(sec) == 0)
{
if (parseInt(min) == 0)
{
location.href = 'examresult.jsp';
}
else
{
min = parseInt(min) - 1;
sec = 59;
if(parseInt(min)==0)
{
document.getElementById("showtime").innerHTML = "Time Left : " +sec+"
Seconds";
}
else
{
GURJOT SINGH(00313202712)
Page 30
}
}</script>
</head>
<body onload="f2()">
<%@include file="header.html"%>
<table>
<tr>
<td>Welcome, ${uname}</td>
<td><div id="showtime" style="font-size: large color:black ; ">time</div></td>
</tr>
</table>
<p />
<% String ans1=null;
String action = request.getParameter("action");
ArrayList<beans.Question> questions = (ArrayList<beans.Question>)
session.getAttribute("questions");
Integer s=(Integer)session.getAttribute("count");
if(s==0)
{ for(Question q:questions)
{
GURJOT SINGH(00313202712)
Page 31
ans1="u";
q.setAnswer(ans1);
}
session.setAttribute("count", 1);
}
int qno = (Integer) session.getAttribute("qno");
if (action != null) {
// process the current result
String ans = request.getParameter("ans");
if ( ans == null )
ans = "u"; // unanswered question
questions.get(qno).setAnswer(ans);
if ( action.equals("Finish"))
{
response.sendRedirect("examresult.jsp");
}
else
if (action.equals("Previous"))
qno --;
}
beans.Question q = questions.get(qno);
GURJOT SINGH(00313202712)
Page 32
session.setAttribute("qno",qno);
%>
<form action="displayquestion.jsp">
<b><font size="3px">Question No : <%= qno + 1 %></font></b>
<pre>
<b><font size="5px"> <%=q.getQuestion()%></font></b>
</pre>
<p />
<input type="radio" name="ans" value="1">
<%= q.getAns1()%>
<p />
<input type="radio" name="ans" value="2">
<%= q.getAns2()%>
<p />
<input type="radio" name="ans" value="3">
<%= q.getAns3()%>
<p />
<input type="radio" name="ans" value="4">
<%= q.getAns4()%>
<p />
<%
if ( qno == beans.ExamBean.NOQ -1 )
out.println("<input type='submit' value='Finish' name='action'/>");
else
out.println("<input type='submit' value='Next' name='action'/>");
GURJOT SINGH(00313202712)
Page 33
if ( qno > 0)
out.println("<input type='submit' value='Previous' name='action'/>");
%>
<p />
<a href="cancelexam.jsp">Cancel Exam And Return To Home Page </a>
</form>
</body>
</html>
GURJOT SINGH(00313202712)
Page 34
EDIT.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page 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>
String s=request.getParameter("q");
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","hr","asdf");
Statement st=con.createStatement();
ResultSet rs=st.executeQuery("select * from questions");
while(rs.next())
{
String h=rs.getString("qid");
session.setAttribute("abc",h);
System.out.println("abc "+session.getAttribute("abc"));
GURJOT SINGH(00313202712)
Page 35
if(s.equals(h))
{System.out.println(""+rs.getString("question"));
out.println("<form action=update.jsp>"+
"<table
border=2>"+"<tr><td>"+"qid:</td><td>"+rs.getString("qid")+"</tr></td>"+
"<tr><td>"+"Question:</td><td>"+"<textarea
name=q1>"+rs.getString("question")+"</textarea></td></tr>"+
"<tr><td>"+"ANS1:</td><td>"+"<textarea
name=q2>"+rs.getString("ans1")+"</textarea></td></tr>"+
"<tr><td>"+"ANS2:</td><td>"+"<textarea
name=q3>"+rs.getString("ans2")+"</textarea></td></tr>"+
"<tr><td>"+"ANS3:</td><td>"+"<textarea
name=q4>"+rs.getString("ans3")+"</textarea></td></tr>"+
"<tr><td>"+"ANS4:</td><td>"+"<textarea
name=q5>"+rs.getString("ans4")+"</textarea></td></tr>"+
"<tr><td>"+"CANS:</td><td>"+"<input type=text
name=q6 value="+rs.getString("cans")+"></td></tr>"+
"<tr><td><input type=submit
value=change></td></tr>");
out.println("</table>");
break;
}
}
con.close();
}
catch(Exception e)
{
out.println(e.getMessage());
}
GURJOT SINGH(00313202712)
Page 36
%>
</body>
</html>
GURJOT SINGH(00313202712)
Page 37
EXAMHISTORY.JSP
<%@page import="beans.Examination"%>
<%@page import="beans.ExamBean"%>
<%@page contentType="text/html" pageEncoding="UTF-8" import="java.util.*,beans.*"%>
<!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=UTF-8">
<title>Exams History</title>
<link href="styles.css" rel="stylesheet"/>
</head>
<body>
<%@include file="header.html"%>
<h4>Welcome, ${uname} </h4>
GURJOT SINGH(00313202712)
Page 38
<%
for(Examination e : exams)
{
out.println("<tr><td>" + e.getDexam() + "</td><td>" + e.getScore() + "</td></tr>");
}
%>
</table>
<p/>
GURJOT SINGH(00313202712)
Page 39
EXAMRESULT.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Exam Result</title>
<link href="styles.css" rel="stylesheet"/>
</head>
<body>
<%@include file="header.html"%>
<h4>Welcome, ${uname} </h4>
<%
int score = beans.ExamBean.processResult( (java.util.ArrayList<beans.Question>)
session.getAttribute("questions"));
// store data in database
beans.ExamBean.storeResult( session.getAttribute("uname").toString(),score);
%>
You have scored <span style="font-size:15pt"> <%=score %> </span> marks in your
exam.
<p/>
GURJOT SINGH(00313202712)
Page 40
<p/>
<a href="home.jsp">Click Here To Proccede </a>
</body>
</html>
GURJOT SINGH(00313202712)
Page 41
HEADER.HTML
<link href="styles.css" rel="stylesheet" />
<h1>TechCheck</h1>
GURJOT SINGH(00313202712)
Page 42
HOME.JSP
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!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=UTF-8">
<title>Login</title>
<link href="/styles.css" rel="stylesheet" />
</head>
<body>
<%@include file="header.html"%>
<h4>Welcome, ${uname}</h4>
<table cellpadding="5pt">
<tr>
<td><center> <a href="takeexam.jsp" class="myButton">take
exam</a>
</center>
<br><br><br><br></td></tr>
<tr>
<td> <center><a href="examhistory.jsp" class="myButton">exam
history</a></center><br><br><br><br></td>
</tr>
<tr>
<td><center> <a href="logout.jsp"
class="myButton">logout</a></center></td>
</tr>
GURJOT SINGH(00313202712)
Page 43
</table>
</body>
</html>
GURJOT SINGH(00313202712)
Page 44
LOGOUT.JSP
<%
session.invalidate();
response.sendRedirect("all/login.jsp");
%>
GURJOT SINGH(00313202712)
Page 45
TAKEEXAM.JSP
<%@page contentType="text/html" pageEncoding="UTF-8" import ="java.util.*"%>
<!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=UTF-8">
<title>Take Exam</title>
<link href="styles.css" rel="stylesheet"/>
</head>
<body>
<%@include file="header.html"%>
<h4>Welcome, ${uname} </h4>
<%
ArrayList<beans.Question> questions = beans.ExamBean.getQuestions();
session.setAttribute("questions", questions);
session.setAttribute("count",0);
session.setAttribute("qno", 0);
session.setAttribute("starttime", new Date());
response.sendRedirect("displayquestion.jsp");
%>
</body>
</html>
GURJOT SINGH(00313202712)
Page 46
UPDATE.JSP
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ page 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>MODIFY A QUESTION</title>
<link href="styles.css" rel="stylesheet" />
</head>
<body>
<%@include file="header.html"%>
<% Connection con=null;
try
{
String s=(String)session.getAttribute("abc");
String s1=request.getParameter("q1");
String s2=request.getParameter("q2");
String s3=request.getParameter("q3");
String s4=request.getParameter("q4");
String s5=request.getParameter("q5");
String s6=request.getParameter("q6");
System.out.println("id "+s);
System.out.println(s1);
System.out.println(s2);
GURJOT SINGH(00313202712)
Page 47
System.out.println(s3);
System.out.println(s4);
System.out.println(s5);
System.out.println(s6);
Class.forName("oracle.jdbc.driver.OracleDriver");
con =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:XE","hr","asdf");
Statement st=con.createStatement();
//ResultSet rs=st.executeQuery("select * from questions");
//while(rs.next())
//{
String h=rs.getString("qid");
//
if(s.equals(h))
//
//
}
catch(Exception e)
{
out.println(e.getMessage());
}
GURJOT SINGH(00313202712)
Page 48
finally
{con.close();
%>
</body>
</html>
GURJOT SINGH(00313202712)
Page 49
STYLESHEET
STYLES.CSS
h1 {
margin:0px;
font-family:arial;
font-size:20pt;
font-weight:700;
color:white;
background-color:#2c272b;
}
body {
margin:0px;
font-family:verdana;
font-size:10pt;
background-image: url("abc.jpg");
}
.triple td
{width:10%;
word-break: break-all;
}
table
{width:100%;
GURJOT SINGH(00313202712)
Page 50
.myButton {
-moz-box-shadow:inset 0px 1px 0px 0px #0a0a0a;
-webkit-box-shadow:inset 0px 1px 0px 0px #0a0a0a;
box-shadow:inset 0px 1px 0px 0px #0a0a0a;
background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #131314),
color-stop(1, #7f838a));
background:-moz-linear-gradient(top, #131314 5%, #7f838a 100%);
background:-webkit-linear-gradient(top, #131314 5%, #7f838a 100%);
background:-o-linear-gradient(top, #131314 5%, #7f838a 100%);
background:-ms-linear-gradient(top, #131314 5%, #7f838a 100%);
background:linear-gradient(to bottom, #131314 5%, #7f838a 100%);
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#131314',
endColorstr='#7f838a',GradientType=0);
background-color:#131314;
-moz-border-radius:9px;
-webkit-border-radius:9px;
border-radius:9px;
border:1px solid #0a0a0a;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:arial;
font-size:13px;
font-weight:bold;
padding:20px 100px;
text-decoration:none;
}
.myButton:hover {
GURJOT SINGH(00313202712)
Page 51
GURJOT SINGH(00313202712)
Page 52
\\\\\\BEANS PACKAGE
USERBEAN.JAVA
package beans;
import dao.ExamDAO;
import java.util.ArrayList;
return ExamDAO.countQues();
GURJOT SINGH(00313202712)
Page 53
GURJOT SINGH(00313202712)
Page 54
EXAMINATION.JAVA
package beans;
GURJOT SINGH(00313202712)
Page 55
GURJOT SINGH(00313202712)
Page 56
QUESTION.JAVA
package beans;
GURJOT SINGH(00313202712)
Page 57
Page 58
this.ans4 = ans4;
}
Page 59
public Question(String qid, String question, String ans1, String ans2, String ans3, String
ans4, String cans)
{
this.qid = qid;
this.question = question;
this.ans1 = ans1;
this.ans2 = ans2;
this.ans3 = ans3;
this.ans4 = ans4;
this.cans = cans;
}
public Question() {
}
GURJOT SINGH(00313202712)
Page 60
USERBEAN.JAVA
package beans;
import dao.UserDAO;
Page 61
{
this.email = email;
}
Page 62
GURJOT SINGH(00313202712)
Page 63
////DAO PACKAGE
DBUTIL.JAVA
package dao;
import java.sql.Connection;
import java.sql.DriverManager;
Page 64
con.close();
}
catch(Exception ex) {
}
}
}
GURJOT SINGH(00313202712)
Page 65
EXAMDAO.JAVA
package dao;
import beans.ExamBean;
import beans.Examination;
import beans.Question;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
}
DBUtil.close(con2);
GURJOT SINGH(00313202712)
Page 66
}
catch (Exception ex)
{
System.out.println(ex.getMessage());
return count;
}
Page 67
else
{return true;
}
}
catch (Exception ex)
{
System.out.println(ex.getMessage());
return false;
finally {
DBUtil.close(con3);
}
}
public static ArrayList<Question> getQuestions()
{
// create an array of random numbers based on the number of question we have in the
database.
int[] qnos = new int[ExamBean.NOQ];
int qno, i = 0;
while (i < 5)
{
qno = (int) Math.round(Math.random() * ExamBean.getTOTAL());
boolean found = false;
GURJOT SINGH(00313202712)
Page 68
Page 69
GURJOT SINGH(00313202712)
Page 70
}
} // end of getQuestions()
Page 71
} // end of getExamsHistory
USERDAO.JAVA
GURJOT SINGH(00313202712)
Page 72
package dao;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
Page 73
}
}
GURJOT SINGH(00313202712)
Page 74
GURJOT SINGH(00313202712)
Page 75
GURJOT SINGH(00313202712)
Page 76
FUTURE SCOPE
There always a room for improvement in any software
package, however good and efficient it may be done.
But the most important thing is that it should be
flexible to accept further modifications. In future this
software may be extended to include features such as:
1. We can study the progress of students in various
sections like aptitude and communication skills and
then suggestions can be generated accordingly
about areas to focus, various strengths and
weaknesses.
2. Apart from textual questions we can add audio
clips and video clippings on which questions are to
be answered
GURJOT SINGH(00313202712)
Page 77
SCREENSHOTS
GURJOT SINGH(00313202712)
Page 78
GURJOT SINGH(00313202712)
Page 79
GURJOT SINGH(00313202712)
Page 80
GURJOT SINGH(00313202712)
Page 81
GURJOT SINGH(00313202712)
Page 82
GURJOT SINGH(00313202712)
Page 83
GURJOT SINGH(00313202712)
Page 84