•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 456,433 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,638 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 5815 | Replies: 4
![]() |
•
•
Join Date: May 2006
Location: ★ ijug.net ★
Posts: 1,012
Reputation:
Rep Power: 6
Solved Threads: 68
check some quiz sites.
★ Homework Help ★ Freelance Programmer ★ Freelance Jobs ★
★ Build A Website ★ Interview Question And Answer ★ Tax Filing ★
★ Build A Website ★ Interview Question And Answer ★ Tax Filing ★
So write some. If you have problems, and a specific question, then come back and we will help, but for God's/Allah's/Buddha's/<insert additional diety names here>'s sake, Do Your Own Homework, or at least make an attempt at it.
Java Programmer and Sun Systems Administrator
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
----------------------------------------------
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
•
•
Join Date: Oct 2007
Posts: 79
Reputation:
Rep Power: 0
Solved Threads: 0
<%@ page contentType="text/html" %>
<%@ page session="true" %>
<%@ page language="java" %>
<%@ page autoFlush="true" import="com.hurix.mhlncms.*, java.util.*"%>
<%@ page import="java.util.*,java.io.*,java.sql.*"%>
<jsp:useBean id="hdbc" class="com.hurix.mhlncms.cmslib.cmsdbconnection.HurixDbconnection" scope="application" />
<jsp:useBean id="mis" class="com.hurix.mhlncms.online" scope="page" />
<HTML><HEAD><TITLE>Management Information System</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css>
BODY
{
MARGIN: 0px
}
</STYLE>
<SCRIPT language=javascript>
var hr = <%=request.getAttribute("HR") %>
var sec = 00;
var min =00;
var count1;
function countDown()
{
sec--;
if (sec == -01)
{
sec = 18;
min = min - 1;
}
else { min = min; }
if (sec<=9)
{ sec = "0" + sec;
}
if(min==-01)
{
min=0;
hr= hr++;
}
time = (hr<=9 ? "0" + hr : hr)+" : " + (min<=9 ? "0" + min : min)+ " : " + sec ;
document.online.timeLeft.value = time;
if (document.getElementById)
{
theTime.innerHTML = time;
}
SD=window.setTimeout("countDown();", 1000);
if (hr=='00' && min == '00' && sec == '00')
{ sec = "00"; window.clearTimeout(SD);
alert("The time is Expiered");
var inputs=0;
var cou=0;
var aa;
var examdate1 = document.online.examdate1.value;
for(var x=0;x<10;x++)
{
var name= new Array(10)
name[0]="TRAP";
name[1]="Dennisriche";
name[2]="ThomasJohn";
name[3]="MarkHoneywell";
name[4]="Active server pages";
name[5]="Shozo Kawasaki";
name[6]="Neither Process Nor Completes Its Work";
name[7]=" Western India Vegetable Products Limited";
name[8]="Java server pages";
name[9]="Object oriented";
//alert("array:"+name[x]);
inputs = document.getElementsByTagName('input')
for(var i=0; i < inputs.length; i++)
{
if(inputs[i].checked==true)
{
aa=inputs[i].value;
//alert("The selected value is"+aa);
if(aa==name[x])
{
cou++;
}
}
}
}
alert("count:"+cou);
document.location.href="techexam.jsp?cou="+cou+"&examdate1="+examdate1+" ";
}
}
window.onload = countDown;
</script>
<script text="javascript">
function getValues()
{
//<%!int j=1;%>
var inputs=0;
var cou=0;
var aa;
var examdate1 = document.online.examdate1.value;
for(var x=0;x<10;x++)
{
var name= new Array(10)
name[0]="TRAP";
name[1]="Dennisriche";
name[2]="ThomasJohn";
name[3]="MarkHoneywell";
name[4]="Active server pages";
name[5]="Shozo Kawasaki";
name[6]="Neither Process Nor Completes Its Work";
name[7]=" Western India Vegetable Products Limited";
name[8]="Java server pages";
name[9]="Object oriented";
//alert("array:"+name[x]);
inputs = document.getElementsByTagName('input')
for(var i=0; i < inputs.length; i++)
{
if(inputs[i].checked==true)
{
aa=inputs[i].value;
if(aa==name[x])
{
cou++;
}
}
}
}
alert("count:"+cou);
document.location.href="techexam.jsp?cou="+cou+"&examdate1="+examdate1+" ";
}
</script>
<script type="text/javascript" src="../JavaScript/datetimepicker.js"></script>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="../css/form.css" rel="stylesheet" type="text/css">
<link href="../css/style.css" rel="stylesheet" type="text/css">
<%
mis.setHurixDbconnection(hdbc);
String examdate1 = request.getParameter("examdate") != null ? request.getParameter("examdate") : null;
String answer = "";
%>
<FORM name="online">
<TABLE cellSpacing=0 cellPadding=0 width=776 border=0>
<input type="hidden" name= "examdate1" value="<%=examdate1%>">
<TBODY>
<TR>
<TD class=Form_Header bgColor=#999999>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=popheader width=25> </TD>
<TD class=popheader align=left width=222>Optitude Test </TD>
<TD align=left width=242 height=25> </TD>
<TD class=toplink vAlign=center align=left width=211>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD align=right width="28%"><LABEL></LABEL></TD>
<TD align=right width="28%"><LABEL></LABEL></TD>
<TD align=right width="25%"><LABEL></LABEL></TD>
<TD align=middle width="29%"><LABEL>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD> </TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
Exam Timing::<SPAN class=timeClass id=theTime></SPAN>
<SPAN class=labels id=theTime><input name="timeLeft" id=theTime size="10"></SPAN>
<TR vAlign=top align=left>
<TD width="10%" height=35> </TD>
<TD class=labels borderColor=#dfeaff height=35>
<SPAN class=red_marker></SPAN></TD>
<TD borderColor=#dfeaff height=35>
<%
Connection con = null;
String strPrjQuery=null;
ResultSet rst=null;
Statement stmt=null;
Collection EItemCheck=new Vector();
int n=0;
int i=0;
String q;
try
{
con=hdbc.getConnectionFromPool();
stmt=con.createStatement();
rst=stmt.executeQuery("select * from PMS_ONLINEWRITTEN ORDER BY dbms_random.value");
while(rst.next())
{
%>
<INPUT maxLength="100" type="text" name="q<%=n%>" class="fetch" size="100" value="<%=++n%>. <%=rst.getString("QUESTION")%>"><br>
<INPUT maxLength="100" type="text" name="ans<%=n%>" class="fetch" size="100" value=" <%=rst.getString("ANSWER")%>"><br>
<INPUT maxLength="30" type="radio" name="ques1 <%=n%>" class="fetch" value="<%=rst.getString("ANSWER1")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER1")%>"><br>
<INPUT maxLength="30" type="radio" name="ques<%=n%>" class="fetch" value="<%=rst.getString("ANSWER2")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER2")%>"><br>
<INPUT maxLength="30" type="radio" name="ques<%=n%>" class="fetch" value="<%=rst.getString("ANSWER3")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER3")%>"><br>
<INPUT maxLength="30" type="radio" name="ques<%=n%>" class="fetch" value="<%=rst.getString("ANSWER4")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER4")%>"><br><br>
<%
}
}
catch(SQLException e)
{
throw new SQLException("Error in Retrieving all the Projects ",null,e.getErrorCode());
}
finally
{
hdbc.putConnectionToPool(con);
}
Collection optians = mis.fetchoptianswer();
int n1=0;
int x;
String answer1="";
if (optians != null)
{
Iterator iter1 = optians.iterator();
Vector vect = new Vector();
while(iter1.hasNext())
{
vect = (Vector)iter1.next();
answer1= vect.elementAt(0).toString();
out.println("answer::"+answer1+"<br>");
}
}
%>
</SPAN></SPAN></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=middle>
<INPUT type=button value=submit onClick="getValues()">
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</FORM>
</BODY>
</HTML>
check this and leave ur feedback...
<%@ page session="true" %>
<%@ page language="java" %>
<%@ page autoFlush="true" import="com.hurix.mhlncms.*, java.util.*"%>
<%@ page import="java.util.*,java.io.*,java.sql.*"%>
<jsp:useBean id="hdbc" class="com.hurix.mhlncms.cmslib.cmsdbconnection.HurixDbconnection" scope="application" />
<jsp:useBean id="mis" class="com.hurix.mhlncms.online" scope="page" />
<HTML><HEAD><TITLE>Management Information System</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<STYLE type=text/css>
BODY
{
MARGIN: 0px
}
</STYLE>
<SCRIPT language=javascript>
var hr = <%=request.getAttribute("HR") %>
var sec = 00;
var min =00;
var count1;
function countDown()
{
sec--;
if (sec == -01)
{
sec = 18;
min = min - 1;
}
else { min = min; }
if (sec<=9)
{ sec = "0" + sec;
}
if(min==-01)
{
min=0;
hr= hr++;
}
time = (hr<=9 ? "0" + hr : hr)+" : " + (min<=9 ? "0" + min : min)+ " : " + sec ;
document.online.timeLeft.value = time;
if (document.getElementById)
{
theTime.innerHTML = time;
}
SD=window.setTimeout("countDown();", 1000);
if (hr=='00' && min == '00' && sec == '00')
{ sec = "00"; window.clearTimeout(SD);
alert("The time is Expiered");
var inputs=0;
var cou=0;
var aa;
var examdate1 = document.online.examdate1.value;
for(var x=0;x<10;x++)
{
var name= new Array(10)
name[0]="TRAP";
name[1]="Dennisriche";
name[2]="ThomasJohn";
name[3]="MarkHoneywell";
name[4]="Active server pages";
name[5]="Shozo Kawasaki";
name[6]="Neither Process Nor Completes Its Work";
name[7]=" Western India Vegetable Products Limited";
name[8]="Java server pages";
name[9]="Object oriented";
//alert("array:"+name[x]);
inputs = document.getElementsByTagName('input')
for(var i=0; i < inputs.length; i++)
{
if(inputs[i].checked==true)
{
aa=inputs[i].value;
//alert("The selected value is"+aa);
if(aa==name[x])
{
cou++;
}
}
}
}
alert("count:"+cou);
document.location.href="techexam.jsp?cou="+cou+"&examdate1="+examdate1+" ";
}
}
window.onload = countDown;
</script>
<script text="javascript">
function getValues()
{
//<%!int j=1;%>
var inputs=0;
var cou=0;
var aa;
var examdate1 = document.online.examdate1.value;
for(var x=0;x<10;x++)
{
var name= new Array(10)
name[0]="TRAP";
name[1]="Dennisriche";
name[2]="ThomasJohn";
name[3]="MarkHoneywell";
name[4]="Active server pages";
name[5]="Shozo Kawasaki";
name[6]="Neither Process Nor Completes Its Work";
name[7]=" Western India Vegetable Products Limited";
name[8]="Java server pages";
name[9]="Object oriented";
//alert("array:"+name[x]);
inputs = document.getElementsByTagName('input')
for(var i=0; i < inputs.length; i++)
{
if(inputs[i].checked==true)
{
aa=inputs[i].value;
if(aa==name[x])
{
cou++;
}
}
}
}
alert("count:"+cou);
document.location.href="techexam.jsp?cou="+cou+"&examdate1="+examdate1+" ";
}
</script>
<script type="text/javascript" src="../JavaScript/datetimepicker.js"></script>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style>
<link href="../css/form.css" rel="stylesheet" type="text/css">
<link href="../css/style.css" rel="stylesheet" type="text/css">
<%
mis.setHurixDbconnection(hdbc);
String examdate1 = request.getParameter("examdate") != null ? request.getParameter("examdate") : null;
String answer = "";
%>
<FORM name="online">
<TABLE cellSpacing=0 cellPadding=0 width=776 border=0>
<input type="hidden" name= "examdate1" value="<%=examdate1%>">
<TBODY>
<TR>
<TD class=Form_Header bgColor=#999999>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD class=popheader width=25> </TD>
<TD class=popheader align=left width=222>Optitude Test </TD>
<TD align=left width=242 height=25> </TD>
<TD class=toplink vAlign=center align=left width=211>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%"
border=0>
<TBODY>
<TR>
<TD align=right width="28%"><LABEL></LABEL></TD>
<TD align=right width="28%"><LABEL></LABEL></TD>
<TD align=right width="25%"><LABEL></LABEL></TD>
<TD align=middle width="29%"><LABEL>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD> </TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
Exam Timing::<SPAN class=timeClass id=theTime></SPAN>
<SPAN class=labels id=theTime><input name="timeLeft" id=theTime size="10"></SPAN>
<TR vAlign=top align=left>
<TD width="10%" height=35> </TD>
<TD class=labels borderColor=#dfeaff height=35>
<SPAN class=red_marker></SPAN></TD>
<TD borderColor=#dfeaff height=35>
<%
Connection con = null;
String strPrjQuery=null;
ResultSet rst=null;
Statement stmt=null;
Collection EItemCheck=new Vector();
int n=0;
int i=0;
String q;
try
{
con=hdbc.getConnectionFromPool();
stmt=con.createStatement();
rst=stmt.executeQuery("select * from PMS_ONLINEWRITTEN ORDER BY dbms_random.value");
while(rst.next())
{
%>
<INPUT maxLength="100" type="text" name="q<%=n%>" class="fetch" size="100" value="<%=++n%>. <%=rst.getString("QUESTION")%>"><br>
<INPUT maxLength="100" type="text" name="ans<%=n%>" class="fetch" size="100" value=" <%=rst.getString("ANSWER")%>"><br>
<INPUT maxLength="30" type="radio" name="ques1 <%=n%>" class="fetch" value="<%=rst.getString("ANSWER1")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER1")%>"><br>
<INPUT maxLength="30" type="radio" name="ques<%=n%>" class="fetch" value="<%=rst.getString("ANSWER2")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER2")%>"><br>
<INPUT maxLength="30" type="radio" name="ques<%=n%>" class="fetch" value="<%=rst.getString("ANSWER3")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER3")%>"><br>
<INPUT maxLength="30" type="radio" name="ques<%=n%>" class="fetch" value="<%=rst.getString("ANSWER4")%>">
<INPUT maxLength="100" type="text" name="ques" class="fetch" size="100" value="<%=rst.getString("ANSWER4")%>"><br><br>
<%
}
}
catch(SQLException e)
{
throw new SQLException("Error in Retrieving all the Projects ",null,e.getErrorCode());
}
finally
{
hdbc.putConnectionToPool(con);
}
Collection optians = mis.fetchoptianswer();
int n1=0;
int x;
String answer1="";
if (optians != null)
{
Iterator iter1 = optians.iterator();
Vector vect = new Vector();
while(iter1.hasNext())
{
vect = (Vector)iter1.next();
answer1= vect.elementAt(0).toString();
out.println("answer::"+answer1+"<br>");
}
}
%>
</SPAN></SPAN></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD align=middle>
<INPUT type=button value=submit onClick="getValues()">
</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</FORM>
</BODY>
</HTML>
check this and leave ur feedback...
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
activation code debugging dell development distance education dreamweaver drivers education firefox funds gpl html india intel internet investments key linux microsoft mozilla news online online education online shopping open open source open-source operating portfolio product programming publishing red hat retail serial software source stocks strayer sun super tips ubuntu vista web windows wysiwyg xp
- online exam application source code (VB.NET)
- i need source code for online examination application in jsp (JSP)
- jsp not running & can't view the jsp source code on tomcat (JSP)
- urgent need for source code of online flight reservation system coded in JSP (JSP)
- hi (JSP)
Other Threads in the JSP Forum
- Previous Thread: <c:if problem.
- Next Thread: Inserting table row values generated dynamically into database using JSP


Linear Mode