Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
full source code online examination system in jsp
#1

full source code online examination system in jsp

index.jsp

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Welcome to Online Examination</title>
</head>
<body bgcolor="cyan">
<form name="index" action="exam.jsp" method="post">
<center><h1><span><font color="red">Welcome to Online Examination</font></span></h1>
<br>
<h2><u><span><font color="blue">Instructions to the Candidates</font></span></u></h2>
<br><h3><ol><li>Fill the correct Registration number.</li>
<br><li>Enter your name.</li>
<br><li>Read the questions carefully.</li>
<br><li>No negative marking.</li></ol></h3>

<br>
<b>Enter your Register number</b>
<input type="text" name="txt_reg">
<b>Enter your Name</b>
<input type="text" name="txt_name"><br><br>
<input name ="submit" value="Submit" type="submit"/>
</center>
</form>
</body>
</html>

exam.jsp

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Examination Panel</title>
</head>
<body bgcolor="cyan">
<%@ page language="java" %>
<%@ page import ="java.sql.*" %>
<%
String reg= request.getParameter("txt_reg");
String name = request.getParameter("txt_name");
out.println("<h2>Welcome" name "..Your Register number is " reg "!!</h2><br><br><br>");
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sTable = "exam";
String sSql = "SELECT * FROM " sTable "";
String sDBQ = "C:/Users/A/Documents/NetBeansProjects/Online Examination/exam.mdb";

String database = "jdbc:odbcBig Grinriver={Microsoft Access Driver (*.mdb)};DBQ=" sDBQ ";DriverID=22;READONLY=true";
Connection cn = null;
Statement st = null;
ResultSet rs = null;
try {
cn = DriverManager.getConnection( database ,"","");
st = cn.createStatement();
rs = st.executeQuery( sSql );
ResultSetMetaData rsmd = rs.getMetaData();
String s1,s2,s3,s4;
int i=1;
while(rs.next())
{

out.println("<form name='exam' action='report.jsp' method='post'><b>" i " . " rs.getString(1) "</b><br><br>");
s1 = rs.getString(2);
s2 = rs.getString(3);
s3 = rs.getString(4);
s4 = rs.getString(5);
out.println("<input type=radio name=opt" i " value=" s1 " CHECKED>" s1 " <br><br>");
out.println("<input type=radio name=opt" i " value=" s2 ">" s2 "<br><br>");
out.println("<input type=radio name=opt" i " value=" s3 ">" s3 "<br><br>");
out.println("<input type=radio name=opt" i " value=" s4 ">" s4 "<br><br>");
i ;
}
out.println("<input name ='submit' value='Submit' type='submit'/>");
/*int n = rsmd.getColumnCount();
out.println( "<table border=1 cellspacing=3><tr>" );
for( int i=1; i<=n; i ) // Achtung: erste Spalte mit 1 statt 0
out.println( "<th>" rsmd.getColumnName( i ) "</th>" );
while( rs.next() )
{
out.println( "</tr><tr>" );
for( int i=1; i<=n; i ) // Achtung: erste Spalte mit 1 statt 0
out.println( "<td nowrap>" rs.getString( i ) "</td>" );
}
out.println( "</tr></table>" );*/
}
finally {
try { if( null != rs ) rs.close(); } catch( Exception ex ) {}
try { if( null != st ) st.close(); } catch( Exception ex ) {}
try { if( null != cn ) cn.close(); } catch( Exception ex ) {}
}

%>

</body>
</html>

report.jsp

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Exam Report</title>
</head>
<body bgcolor="cyan">
<center><h1>Your Report Card</h1></center>
<%@ page language="java" %>
<%@ page import ="java.sql.*" %>
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String sTable = "exam";
String sSql = "SELECT * FROM " sTable "";
String sDBQ = "C:/Users/A/Documents/NetBeansProjects/Online Examination/exam.mdb";

String database = "jdbc:odbcBig Grinriver={Microsoft Access Driver (*.mdb)};DBQ=" sDBQ ";DriverID=22;READONLY=true";
Connection cn = null;
Statement st = null;
ResultSet rs = null;
try {
cn = DriverManager.getConnection( database ,"","");
st = cn.createStatement();
rs = st.executeQuery( sSql );
ResultSetMetaData rsmd = rs.getMetaData();
String s1,s2,s3,s4;
int i=1;
int correct=0,incorrect=0,total=0;
out.println("<h2><br><br><center><table border=1 cellpadding=2 cellspacing=2><tr><th>Question</th><th>Your Answer</th><th>Correct Answer</th><th>Status</th></tr>");
while(rs.next())
{
total ;
s1 = rs.getString(1);
s2 = request.getParameter("opt" i);
s3 = rs.getString(6);
if(s2.equals(s3))
{
s4="Correct";
correct ;
}
else
{
s4="Incorrect";
incorrect ;
}
out.println("<tr><td>" s1 "</td><td>" s2 "</td><td>" s3 "</td><td>" s4 "</td></tr>");
i ;
}
out.println("</table><br><br><table><b><tr><td>Correct Answers</td><td>" correct "</td></tr>");
out.println("<tr><td>Incorrect Answers</td><td>" incorrect "</td></tr>");
out.println("<tr><td>Total Questions</td><td>" total "</td></tr></table></b></center></h2>");

}
finally {
try { if( null != rs ) rs.close(); } catch( Exception ex ) {}
try { if( null != st ) st.close(); } catch( Exception ex ) {}
try { if( null != cn ) cn.close(); } catch( Exception ex ) {}
}

%>

</body>
</html>
Reply

#2
To get full information or details of online examination system please have a look on the pages

http://seminarsprojects.net/Thread-eExam...pid=160460

http://seminarsprojects.net/Thread-eexam...ion-system

http://seminarsprojects.net/Thread-onlin...ion-system

http://seminarsprojects.net/Thread-onlin...tem--32396

http://seminarsprojects.net/Thread-onlin...tem--36315

if you again feel trouble on online examination system please reply in that page and ask specific fields in online examination system
Reply

#3
hey.. i need online examination system source code in jsp with use javascript, css, jquery.so can you plz give me the source code.
Reply

#4

source code in jsp for online examination with countdown timers
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Powered By MyBB, © 2002-2024 iAndrew & Melroy van den Berg.