stuUnit.jsp
上传用户:nbluoke
上传日期:2013-08-09
资源大小:4851k
文件大小:6k
源码类别:

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %>
  2. <%@ page import="java.io.*"%>
  3. <%@ page import="jinghua.*"%>
  4. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  5. </jsp:useBean>
  6. <jsp:useBean id="Tools" class="jinghua.Tools" scope="session">
  7. </jsp:useBean>
  8. <%!Connection con;
  9. String studentID="";
  10. boolean debug=true;
  11. %>
  12. <%
  13. try{
  14.     studentID=(String)session.getAttribute("studentID");
  15.     //Tools.showalert(studentID,out);
  16.     if(studentID==null){
  17.         throw new Exception();
  18.     }
  19. }catch(Exception e){
  20.     Tools.showalert("您还没有登录,或连接超时,请重新登录!",out);
  21.     Tools.showJS("window.open('../login.jsp','_self')",out);
  22. }
  23. try{
  24.     con=DBCon.getConnection();
  25. %>
  26. <%
  27. if(debug) out.print("<br>stuID="+studentID);
  28. String temp=Tools.sub_know(con);
  29. out.print(temp);
  30. temp=Tools.grade_sub(con);
  31. out.print(temp);
  32. %>
  33. <script language="javascript">
  34. function CheckForm(myform)
  35. {
  36.  if( myform.Grade.selectedIndex == 0) {
  37.         alert("请选择年级信息!")
  38.         return false;
  39.     }
  40.     if(myform.Subject.selectedIndex==0){
  41.         alert("请选择科目信息!")
  42.         return false;
  43.     }
  44.     if(myform.KnowPoint.selectedIndex==0){
  45.         alert("请选知识点信息!")
  46.         return false;
  47.     }
  48. }
  49. function isNumberString (InString,RefString)
  50. {
  51. if(InString.length==0) return (false);
  52. for (Count=0; Count < InString.length; Count++)  {
  53. TempChar= InString.substring (Count, Count+1);
  54. if (RefString.indexOf (TempChar, 0)==-1)
  55. return (false);
  56. }
  57. return (true);
  58. }
  59. function msg(str)
  60. {
  61.    alert(str);
  62. }
  63. </script>
  64. <!--年级,科目,知识点三个下拉列表框联动-->
  65. <script language="JavaScript">
  66. function changegs(locationid){
  67. document.myform.Subject.length =1;
  68.         document.myform.KnowPoint.length =1;
  69.         var locationid=locationid;
  70.         var i;
  71.         for (i=0;i < gscount; i++){
  72.             if (grade_sub[i][0] == locationid) {
  73.             document.myform.Subject.options[document.myform.Subject.length] = new Option(grade_sub[i][2], grade_sub[i][1]);
  74.             }
  75. }
  76. }
  77. </script>
  78. <script language="JavaScript">
  79. function changesk(locationid){
  80. document.myform.KnowPoint.length =1;
  81. var locationid=locationid;
  82. var i;
  83. for (i=0;i < gskcount; i++){
  84. if (grade_sub_know[i][1] == locationid){
  85. document.myform.KnowPoint.options[document.myform.KnowPoint.length] = new Option(grade_sub_know[i][3], grade_sub_know[i][2]);
  86. }
  87. }
  88. }
  89. </script>
  90. <HTML><HEAD><TITLE>在线测试</TITLE>
  91. <META http-equiv=Content-Type content="text/html; charset=gb2312">
  92. <META content="MSHTML 6.00.2462.0" name=GENERATOR></HEAD>
  93. <BODY>
  94. <FORM action="UnitTestShow.jsp" method="post" name="myform" target="_self" id="form1" onSubmit="return CheckForm(this)">
  95.    <A
  96. href="http://jsptestonline.cosoft.org.cn/">首页</A>--共创题库--在线考试
  97.   <P align="center"> 选择单元测试类型</P>
  98.   <div align="center">
  99.     <table bordercolor=#d3add1 height=243 width="52%" border=1>
  100.       <tbody>
  101.         <tr>
  102.           <td
  103.     height=41 align="center" valign=middle background=images/lvbgcolor.gif><br>
  104.             <div align="left">
  105.               <table width="100%" border="0">
  106.                 <tr>
  107.                   <td width="29%" align="right"> <p align="right">年 &nbsp;级:</p></td>
  108.                   <td width="46%" align="left">
  109. <select id=select6 name=Grade onClick="changegs(document.myform.Grade.options[document.myform.Grade.selectedIndex].value)" size="1">
  110.                     <option value="temp">--未选择--</option>
  111.                       <%Tools.showGradeOption(con,out);%>
  112.                     </select></td>
  113.                   <td width="25%">&nbsp; </td>
  114.                 </tr>
  115.               </table>
  116.               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></td>
  117.         </tr>
  118.         <tr>
  119.           <td
  120.     height=63 align="center" valign=middle background=images/lvbgcolor.gif> <div align="left">
  121.               <br>
  122.               <table width="100%" border="0">
  123.                 <tr>
  124.                   <td width="29%" align="right" valign="middle"><p align="right">科
  125.                       &nbsp;目:</p></td>
  126.                   <td width="54%" align="left" valign="middle">
  127. <select id=select4 name=Subject onClick="changesk(document.myform.Subject.options[document.myform.Subject.selectedIndex].value)"
  128. size="1">
  129.                     <option value="temp">--未选择--</option>
  130.                       <%--Tools.showOption("select * from subject order by id",con,out);--%>
  131.                     </select> </td>
  132.                   <td width="17%" valign="middle">&nbsp; </td>
  133.                 </tr>
  134.               </table>
  135.               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  136.               &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  137.             </div></td>
  138.         </tr>
  139.         <tr>
  140.           <td
  141.     height=74 align="center" valign=middle background=images/lvbgcolor.gif>
  142. <table width="100%" border="0">
  143.               <tr>
  144.                 <td width="29%" height="27" align="right">知识点: </td>
  145.                 <td width="46%" align="left">
  146. <select name=KnowPoint id="select11">
  147.                   <option value="temp">----未选择----</option>
  148.                     <%-- Tools.showOption("select * from knowpoint order by id",con,out);--%>
  149.                   </select></td>
  150.                 <td width="25%">&nbsp; </td>
  151.               </tr>
  152.             </table>
  153.           </td>
  154.         </tr>
  155.         <tr>
  156.           <td
  157.     height=31 align="center" valign=middle background=images/lvbgcolor.gif><table width="100%" border="0">
  158.               <tr>
  159.                 <td width="35%" align="right">
  160.                   <input type="submit" name="Submit" value="确定">
  161.                 </td>
  162.                 <td width="24%" align="right">&nbsp;</td>
  163.                 <td width="41%" align="left">
  164. <input name="Reset_Quest" type="reset" id="Reset_Quest4" value="重置">
  165.                 </td>
  166.               </tr>
  167.             </table></td>
  168.         </tr>
  169.       </tbody>
  170.     </table>
  171.   </div>
  172.   <P> </P>
  173. <P>&nbsp;</P>
  174. <P>&nbsp;</P></FORM>
  175. </BODY></HTML>
  176. <%}
  177. catch(Exception e){
  178.     System.out.print(e.toString());
  179. }
  180. finally{
  181. System.out.println("#############stuunit.jsp end");
  182.     DBCon.dropConnection();
  183. }
  184. %>