473,511 Members | 16,769 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I hav a problem in my online exam code,pls help me

5 New Member
here is the code for my jsp
Expand|Select|Wrap|Line Numbers
  1. <%@ page import="java.sql.*,java.io.*,java.util.*" %>
  2. <%! 
  3.     Connection con = null;
  4.     PreparedStatement pst = null;
  5.     ResultSet rs=null;
  6.  
  7. %>
  8. <%
  9.    /* String driver = application.getInitParameter("driver");
  10.     String url = application.getInitParameter("url");
  11.     String user = application.getInitParameter("user");
  12.     String pwd = application.getInitParameter("pwd"); */
  13.  
  14.     Class.forName("oracle.jdbc.driver.OracleDriver");
  15.     con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","vak","exam");
  16.     pst=con.prepareStatement("select * from verbal ORDER BY dbms_random.value");
  17.     rs=pst.executeQuery();
  18.     %>
  19.  
  20. <html>
  21. <head>
  22. <title>VERBAL EXAM</title>
  23.  
  24. <style type="text/css">
  25. <!--
  26. .style7 {
  27.     font-size: 24px;
  28.     color: #330099;
  29.     font-weight: bold;
  30. }
  31. .style8 {
  32.     font-size: 18px;
  33.     color: #990000;
  34. }
  35. .style9 {font-size: 16px}
  36. -->
  37. </style>
  38. <script type="text/javascript">
  39. var c=0
  40. var t
  41. function abc()
  42. {
  43.  
  44.  window.location = "http://localhost:8083/onlineexam/numerical.jsp";
  45.  }
  46.  
  47. function timedCount()
  48. {
  49. document.getElementById('txt').value=c;
  50. if(c==10)
  51. abc();
  52. c=c+1;
  53. t=setTimeout("timedCount()",1000);
  54. }
  55. </script>
  56.  
  57. </head>
  58. <body onLoad="timedCount()">
  59. <form id="f1" name="form1" method="post" action="numerical.jsp" >
  60. <table width="975" height="362" border="0">
  61.   <tr>
  62.     <td width="10" height="218"><table width="741" border="0">
  63.       <tr>
  64.         <td width="237" height="212"><img src="images/logo.jpg" width="237" height="210" /></td>
  65.         <td width="231"><img src="images/bannerimg.jpg" width="752" height="210" /></td>
  66.       </tr>
  67.     </table></td>
  68.   </tr>
  69.   <tr bgcolor="#FFFFCA">
  70.     <td height="138"><div align="center" class="style7">
  71.       <p> </p>
  72.       <p>Verbal Ability </p>
  73.       <p align="right"><input type="text" id="txt" style="background-color:#FFFFCA"/></p>
  74.       <p align="left"><span class="style8">Sentence Completion Instructions:</span></p>
  75.       <p align="left"><span class="style8"><span class="style9"> The following sentences are incomplete.Choose the word or phrase that most correctly completes the sentence. </span></span></p>
  76.       <p align="left"> </p>
  77.     </div>
  78.       <table border="0" width="500px" cellspacing="2" cellpadding="4">
  79. <%
  80.  
  81. int i=1;
  82. while(rs.next())
  83. {
  84.  
  85. %>
  86.         <tr>
  87.           <td width="26%"> <strong>Question:<%=i%></strong>.<%=rs.getString(1) %> <input type="text" name="que<%=i%>" style="visibility:hidden" value= "<%= rs.getString(1) %>" /></td>
  88.         <tr>
  89.           <td> <strong>a:</strong>
  90.             <input type="radio" name="q<%=i%>" value= "<%= rs.getString(2)%>"  />
  91.               <%= rs.getString(2) %></td>
  92.         </tr>
  93.         <tr>
  94.           <td> <strong>b:</strong>
  95.             <input type="radio" name="q<%=i%>"  value="<%= rs.getString(3)%>"  />
  96.               <%= rs.getString(3) %></td>
  97.         </tr>
  98.         <tr>
  99.           <td> <strong>c:</strong>
  100.             <input type="radio" name="q<%=i%>" value="<%= rs.getString(4)%>"  />
  101.               <%= rs.getString(4) %></td>
  102.         </tr>
  103.         <tr>
  104.           <td> <strong>d:
  105.             </strong>
  106.             <input type="radio" name="q<%=i%>" value="<%= rs.getString(5)%>"  />
  107.               <%= rs.getString(5) %> </td>
  108.         </tr>
  109.         <tr>
  110.           <td><center>
  111. <%
  112. i++;
  113. }
  114.  
  115. %>
  116.  
  117.               <input type="submit" value="Next" name="submit" />
  118.           </center></td>
  119.         </tr>
  120.       </table>
  121.     <p> </p></td>
  122.   </tr>
  123. </table>
  124.  
  125. </form>
  126. </body>
  127. </html>
  128. <% 
  129.  rs.close();
  130.  pst.close();
  131.  con.close();
  132.  
  133.  
  134. %>
  135.  
  136.  
The problem is wen the function abc is called i,e the timeout happens the radio checked values are not being carried from first jsp to another jsp. so any solution could help me??
Jun 15 '09 #1
3 2368
r035198x
13,262 MVP
Isn't it considered cheating to ask for help during an exam?
Jun 15 '09 #2
honeya51
5 New Member
we r not writing xam,instead v r developing application for it.so its not cheating
Jun 15 '09 #3
r035198x
13,262 MVP
Oh, I get it now.
Well the first thing you must do is not directly related to your current problem.
You need to remove all that Java code from your JSPs. JSPs should not contain any Java code these days.Move all that code to Servlets and utility classes.
Jun 15 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1630
by: RS | last post by:
Hi, I am looking for some open source online test/exam system using ASP.net and SQL server 2000. Does anyone have any suggestion? Thank you! RS
0
1306
by: jack | last post by:
Hi all, Im planning to take dot net certification exam. i want to know whether is there any site which helps you in preparing for exam. like taking line test for 30 mins so that before taking...
2
2063
by: derekbarrett | last post by:
Hi, I found this article in DB2 magazine and learned about the Problem Determination Mastery Exam. I am very interested in taking the exam, however, following the links in the article leads to...
0
1292
by: allonlineexam | last post by:
Dear Friends, I am doing exam for other person. I am doing all online exam. like....... Microsoft MCP,MCAD, MCSE, MCSA, MCDBA, MCDST. Cisco
4
1262
by: compsci | last post by:
While the status is at C or L, I want the user to input the participation and print it to the screen. I can't get my online_adjustParticipation function to run either. Everytime I run it, it loops...
1
1798
by: ahmurad | last post by:
Dear all, I am new group user, computer science graduate; just have joined this established group and thanks to all. I am working in network field but so much interested in web (PHP) field. Recently...
1
1451
by: rehanmomin | last post by:
BACKGROUND I was trying the figure out a query for my sisters optometrist office. I have two tables, one that contains customers demographics and another table that contains patient's examination. ...
6
3470
by: Freshers Jobs | last post by:
Please try to this exam : http://idealbench.com
3
3790
by: Limno | last post by:
Hi, Can anyone suggest me how to do online exam in php, Here my doubt is, i displayed 1st question with 4 options. But if user click next button, i need to display 2nd question, then 3rd.... goes...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7423
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4737
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3213
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1576
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
447
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.