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

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java"%>
  2. <%@ page import="java.sql.*" %>
  3. <%@ page import="jinghua.*"%>
  4. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  5. </jsp:useBean>
  6. <%!Connection con;
  7. boolean debug=false;
  8. String studentID="";
  9. String gradenote="";
  10. Statement stmt=null;
  11. ResultSet rs=null;
  12. String sql="";
  13. %>
  14. <%
  15. try{
  16.     studentID=(String)session.getAttribute("studentID");
  17.     if(studentID==null){
  18.         throw new Exception();
  19.     }
  20. }catch(Exception e){
  21.     Tools.showalert("您还没有登录,或连接超时,请重新登录!",out);
  22.    Tools.showJS("window.open('../login.jsp','_self')",out);
  23. }
  24. try{
  25.     con=DBCon.getConnection();
  26.     //获取学生的年级信息
  27.     //sql="select id,gradenote,grade.Name as gn "+
  28.     //"from student  INNER JOIN grade ON (student.gradenote = grade.note) "+
  29.     //" where stuid='"+studentID+"'";
  30.     sql="select id,gradenote from UserInfo where vcUserNo='"+studentID+"'";
  31.     try{
  32.         stmt=con.createStatement();
  33.         rs=stmt.executeQuery(sql);
  34.         if(rs.next()){
  35.             gradenote=rs.getString("gradenote");
  36.             rs.close();
  37.             stmt.close();
  38.         }
  39.         if(debug){
  40.             out.print("<br>stuID="+studentID+"<br>gradenote="+gradenote);
  41.         }
  42.     }
  43.     catch(SQLException se){
  44.         out.print("<br> query student error sql="+sql);
  45.         out.print("<br>"+se.toString());
  46.     }
  47.     catch(Exception e){
  48.         out.print("<br> query student error sql="+sql);
  49.         out.print("<br>"+e.toString());
  50.     }
  51.     //--年级,科目,知识点三个下拉列表框联动-->
  52.     out.print(Tools.sub_know(con));
  53.     out.print(Tools.grade_sub(con));
  54. }
  55. catch(Exception e){
  56.     System.out.print(e.toString());
  57. }
  58. finally{
  59.     DBCon.dropConnection();
  60. }
  61. %>
  62. <!--年级,科目,知识点三个下拉列表框联动-->
  63. <script language="JavaScript">
  64. function changegs(locationid){
  65. document.myform.Subject.length =1;
  66.         document.myform.KnowPoint.length =1;
  67.         var locationid=locationid;
  68.         var i;
  69.         for (i=0;i < gscount; i++){
  70.             if (grade_sub[i][0] == locationid) {
  71.             document.myform.Subject.options[document.myform.Subject.length] = new Option(grade_sub[i][2], grade_sub[i][1]);
  72.             }
  73. }
  74. }
  75. function changesk(locationid){
  76. document.myform.KnowPoint.length =1;
  77. var locationid=locationid;
  78. var i;
  79. for (i=0;i < gskcount; i++){
  80. if (grade_sub_know[i][1] == locationid){
  81. document.myform.KnowPoint.options[document.myform.KnowPoint.length] = new Option(grade_sub_know[i][3], grade_sub_know[i][2]);
  82. }
  83. }
  84. }
  85. function InitForm(){
  86.     changegs('<%=gradenote%>')
  87. }
  88. </script>
  89. <script language="javascript">
  90. function CheckForm(f)
  91. {
  92. if( f.testnumber.value.length<1)
  93. {
  94.     alert("您还有输入测验的试题数!");
  95. return false;
  96. }
  97. if(!isNumberString(f.testnumber.value,"1234567890."))
  98. {
  99.     alert("嘿!您在试题数里填了东西,但怎么不是数字呢?n");
  100.     return false;
  101. }else if(f.testnumber.value<10){
  102.             alert("每次测验至少要有10道试题!!");
  103.             return false;
  104. }else if(f.testnumber.value>100){
  105.             alert("学堂提供最多100道试题的测验!!");
  106.             return false;
  107. }
  108. if( !(f.testorder[0].checked || f.testorder[1].checked||f.testorder[2].checked) ) {
  109. alert("您还没有选择测试顺序!")
  110. return false;
  111. }
  112. return ture;
  113. }
  114. function isNumberString (InString,RefString)
  115. {
  116. if(InString.length==0) return (false);
  117. for (Count=0; Count < InString.length; Count++)  {
  118. TempChar= InString.substring (Count, Count+1);
  119. if (RefString.indexOf (TempChar, 0)==-1)
  120. return (false);
  121. }
  122. return (true);
  123. }
  124. </script>
  125. <HTML><HEAD><TITLE>共创学堂</TITLE>
  126. <META http-equiv=Content-Type content="text/html; charset=gb2312">
  127. <LINK
  128. href="style/style.css" type=text/css rel=stylesheet>
  129. <SCRIPT src="js/html.js"></SCRIPT>
  130. <SCRIPT src="js/gnb_menus_layer.js"></SCRIPT>
  131. <SCRIPT src="js/menu.js"></SCRIPT>
  132. <SCRIPT src="js/jumpmenu.js"></SCRIPT>
  133. <SCRIPT src="js/Valid.js"></SCRIPT>
  134. <META content="MSHTML 6.00.2722.900" name=GENERATOR></HEAD>
  135. <BODY bgColor=#ffffff text=#000000 vlink="#0000FF"  onLoad="InitForm()">
  136. <CENTER>
  137. <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  138.   <TBODY>
  139.   <TR>
  140.       <TD vAlign=bottom align=right width=160><A
  141.       href="http://jsptestonline.cosoft.org.cn/"><IMG height=45 src="images/logo.gif"
  142.       width=160></A></TD>
  143.     <TD align=right>
  144.       <TABLE cellSpacing=0 cellPadding=0 width=260 border=0>
  145.         <TBODY>
  146.         <TR>
  147.             <TD vAlign=bottom width=7 bgColor=#b2aeb8><IMG height=18
  148.             src="images/pic_top_y.gif" width=7></TD>
  149.           <TD align=right bgColor=#b2aeb8>
  150.             <TABLE height=18 cellSpacing=0 cellPadding=0 width=240 border=0>
  151.               <TBODY>
  152.               <TR>
  153.                   <TD><IMG height=11 src="images/ico_t_mail.gif"
  154.                 width=13></TD>
  155.                 <TD><A class=black
  156.                   href="http://jsptestonline.cosoft.org.cn/help/use/use_004.jsp">在线咨询</A></TD>
  157.                   <TD><IMG height=15 src="images/ico_t_help.gif"
  158.                 width=13></TD>
  159.                 <TD><A class=black
  160.                   href="http://jsptestonline.cosoft.org.cn/help/buy/buy_001.jsp">申请服务</A></TD>
  161.                   <TD><IMG height=13 src="images/ico_t_lc.gif"
  162.                 width=14></TD>
  163.                 <TD><A class=black
  164.                   href="http://jsptestonline.cosoft.org.cn/help/product/pro_001.jsp">产品介绍</A></TD>
  165.                   <TD width=10><IMG height=10 src="images/blank.gif"
  166.                   width=10></TD>
  167.                 </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
  168.       <TABLE height=12 cellSpacing=0 cellPadding=0 width=100 border=0>
  169.         <TBODY>
  170.         <TR>
  171.             <TD><IMG height=1 src="images/blank.gif"
  172.         width=618></TD>
  173.           </TR></TBODY></TABLE>
  174.       <TABLE cellSpacing=0 cellPadding=0>
  175.         <TBODY>
  176.         <TR>
  177.           <TD>
  178.             <TABLE style="PADDING-BOTTOM: 1px" cellSpacing=0 cellPadding=0
  179.             border=0>
  180.               <TBODY>
  181.               <TR>
  182.                         <TD id=gnb_link_www
  183.                 onmouseover="javascript:showSubMenuLayer('www')"
  184.                 style="POSITION: relative"
  185.                 onmouseout="javascript:hideSubMenuLayer('www')" align=middle
  186.                 width=40><SPAN class=gnbMenu><A id=gnb_link_text_www
  187.                   style="POSITION: relative"
  188.                   href="http://jsptestonline.cosoft.org.cn/index.jsp">首页</A></SPAN></TD>
  189.                   <TD><IMG height=7 src="images/pic_top_line.gif"
  190.                 width=1></TD>
  191.                         <TD id=gnb_link_senior
  192.                 onmouseover="javascript:showSubMenuLayer('senior')"
  193.                 style="POSITION: relative"
  194.                 onmouseout="javascript:hideSubMenuLayer('senior')" align=middle
  195.                 width=70><SPAN class=gnbMenu><A id=gnb_link_text_senior
  196.                   style="FONT-WEIGHT: bold; COLOR: #b77bb4; POSITION: relative"
  197.                   href="http://jsptestonline.cosoft.org.cn/senior/index.jsp">高考通</A></SPAN></TD>
  198.                   <TD><IMG height=7 src="images/pic_top_line.gif"
  199.                 width=1></TD>
  200.                         <TD id=gnb_link_junior
  201.                 onmouseover="javascript:showSubMenuLayer('junior')"
  202.                 style="POSITION: relative"
  203.                 onmouseout="javascript:hideSubMenuLayer('junior')" align=middle
  204.                 width=70><SPAN class=gnbMenu><A id=gnb_link_text_junior
  205.                   style="POSITION: relative"
  206.                   href="http://jsptestonline.cosoft.org.cn/junior/index.jsp">中考通</A></SPAN></TD>
  207.                   <TD><IMG height=7 src="images/pic_top_line.gif"
  208.                 width=1></TD>
  209.                         <TD id=gnb_link_exercises
  210.                 onmouseover="javascript:showSubMenuLayer('exercises')"
  211.                 style="POSITION: relative"
  212.                 onmouseout="javascript:hideSubMenuLayer('exercises')"
  213.                 align=middle width=70><SPAN class=gnbMenu><A
  214.                   id=gnb_link_text_exercises style="POSITION: relative"
  215.                   href="http://jsptestonline.cosoft.org.cn/exercises/index.jsp">共创题库</A></SPAN></TD>
  216.                   <TD><IMG height=7 src="images/pic_top_line.gif"
  217.                 width=1></TD>
  218.                         <TD id=gnb_link_community
  219.                 onmouseover="javascript:showSubMenuLayer('community')"
  220.                 style="POSITION: relative"
  221.                 onmouseout="javascript:hideSubMenuLayer('community')"
  222.                 align=middle width=70><SPAN class=gnbMenu><A
  223.                   id=gnb_link_text_community style="POSITION: relative"
  224.                   href="http://jsptestonline.cosoft.org.cn/community/index.jsp">学员社区</A></SPAN></TD>
  225.                   <TD><IMG height=7 src="images/pic_top_line.gif"
  226.                 width=1></TD>
  227.                         <TD id=gnb_link_myjh
  228.                 onmouseover="javascript:showSubMenuLayer('myjh')"
  229.                 style="POSITION: relative"
  230.                 onmouseout="javascript:hideSubMenuLayer('myjh')" align=middle
  231.                 width=70><SPAN class=gnbMenu><A id=gnb_link_text_myjh
  232.                   style="POSITION: relative"
  233.                   href="http://jsptestonline.cosoft.org.cn/myjh/index.jsp">我的共创</A></SPAN></TD>
  234.                   <TD><IMG height=7 src="images/pic_top_line.gif"
  235.                 width=1></TD>
  236.                         <TD id=gnb_link_help
  237.                 onmouseover="javascript:showSubMenuLayer('help')"
  238.                 style="POSITION: relative"
  239.                 onmouseout="javascript:hideSubMenuLayer('help')" align=middle
  240.                 width=70><SPAN class=gnbMenu><A id=gnb_link_text_help
  241.                   style="POSITION: relative"
  242.                   href="http://jsptestonline.cosoft.org.cn/help/index.jsp">服务中心</A></SPAN></TD>
  243.                       </TR></TBODY></TABLE></TD>
  244.             <TD><IMG height=10 src="images/blank.gif"
  245.         width=10></TD>
  246.           </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
  247.   <TABLE cellSpacing=0 cellPadding=0 width="100%"
  248. background=images/bg_top_senior.gif border=0>
  249.     <TBODY>
  250.     <TR>
  251.     <TD align=right height=6>
  252.       <TABLE cellSpacing=0 cellPadding=0 width=778 border=0>
  253.         <TBODY>
  254.         <TR>
  255.             <TD><IMG style="MARGIN-LEFT: 345px" height=6
  256.             src="images/menu_other.gif"
  257.   width=66></TD>
  258.           </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
  259. <TABLE cellSpacing=0 cellPadding=0 width="100%" bgColor=#d3add1 border=0>
  260.   <TBODY>
  261.   <TR>
  262.       <TD align=middle><IMG height=1 src="images/blank.gif"
  263.   width=778></TD>
  264.     </TR>
  265.   <TR>
  266.     <TD align=right height=26>
  267.       <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
  268.         <TBODY>
  269.         <TR>
  270.             <TD style="COLOR: #ffffff" noWrap><IMG height=10
  271.             src="images/blank.gif" width=20><SPAN
  272.             style="FONT-WEIGHT: bold; COLOR: #ffffff">高考通</SPAN></TD>
  273.             <TD style="COLOR: #ffffff" noWrap width=466><IMG height=11
  274.             src="images/ico_bit.gif" width=9><A class=white
  275.             href="http://jsptestonline.cosoft.org.cn/senior/index.jsp">高考通</A>  <IMG
  276.             height=11 src="images/ico_bit.gif" width=9><A class=white
  277.             href="http://jsptestonline.cosoft.org.cn/senior/none_g3.jsp">高考通高三</A>  <IMG
  278.             height=11 src="images/ico_bit.gif" width=9><A class=white
  279.             href="http://jsptestonline.cosoft.org.cn/senior/none_g2.jsp">高考通高二</A>  <IMG
  280.             height=11 src="images/ico_bit.gif" width=9><A class=white
  281.             href="http://jsptestonline.cosoft.org.cn/senior/none_g1.jsp">高考通高一</A>  </TD>
  282.           </TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
  283. <TABLE cellSpacing=0 cellPadding=0 width=770 border=0>
  284.   <TBODY>
  285.   <TR>
  286.     <TD width=620>依靠共创,学习倍感轻松</TD>
  287.     <TD align=right width=150></TD></TR></TBODY></TABLE>
  288.   <table width="770" border="0" cellspacing="0" cellpadding="0">
  289.     <tr>
  290.       <td><img src="images/temp.gif" width="770" height="144"></td>
  291.     </tr>
  292.   </table>
  293.   <!--begin 内容区 -->
  294.   <table width="770" border="0" cellspacing="0" cellpadding="0">
  295.     <tr valign="top" align="center">
  296.       <td width="178" class=bd_menul> <br>
  297.         <table border="0" cellspacing="0" cellpadding="0">
  298.           <tr>
  299.             <td>
  300. <a href="stu_test_free.jsp">
  301.               <img src="images/bt_test_free.gif" width="97" height="43" border="0" onClick="Open_free_test()"></a></td>
  302.           </tr>
  303.   <tr>
  304.             <td>&nbsp;</td>
  305.           </tr>
  306.   <tr>
  307.             <td><a href="stuUnit.jsp"><img src="images/bt_test_01.gif" width="97" height="43" border="0"></a></td>
  308.           </tr>
  309.           <tr>
  310.             <td>&nbsp;</td>
  311.           </tr>
  312.           <tr>
  313.             <td><a href="stu_test_mn.jsp"><img src="images/bt_test_05.gif" width="105" height="46" border="0"></a></td>
  314.           </tr>
  315.           <tr>
  316.             <td>&nbsp;</td>
  317.           </tr>
  318.           <tr>
  319.             <td><a href="QueryMark_Type.jsp"><img src="images/bt_test_03.gif" width="97" height="43" border="0"></a></td>
  320.           </tr>
  321.           <tr>
  322.             <td>&nbsp;</td>
  323.           </tr>
  324.           <tr>
  325.             <td><a href="stu_04.html"><img src="images/bt_test_04.gif" width="97" height="43" border="0"></a></td>
  326.           </tr>
  327.   <tr>
  328.             <td>&nbsp;</td>
  329.           </tr>
  330.           <tr>
  331.             <td><a href="../errorpad/errorpad.jsp" target="_self"><img src="images/bt_test_errorpad.gif" width="97" height="43" border="0"></a></td>
  332.           </tr>
  333.         </table>
  334.       <p>&nbsp;</p></td>
  335.       <td> <p><br>
  336.           <br>
  337.         </p>
  338.         <FORM action="free_test_paper.jsp" method="post" name="myform" target="_blank" id="myform" onSubmit="return CheckForm(this)">
  339.           <table width="422" border="0" cellspacing="0" cellpadding="0" style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: #cccccc 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #f3f3f3">
  340.             <tr>
  341.               <td height="35" colspan="5" align="center" valign="baseline" nowrap><font size="+1"><strong>请选择测验内容&nbsp; 
  342.                 </strong></font></td>
  343.     </tr>
  344.     <tr>
  345.               <td width="115" height="43" align="center" valign="baseline" nowrap>
  346.                 <table width="100%" border="0" cellspacing="0" cellpadding="0">
  347.                   <tr> 
  348.                     <td width="30%" nowrap><div align="center"><strong>&nbsp;</strong></div></td>
  349.                     <td width="70%" nowrap><div align="left"><font size="+1"><strong>科&nbsp;目:</strong></font></div></td>
  350.                   </tr>
  351.                   <tr> 
  352.                     <td> <div align="center"> </div></td>
  353.                     <td><div align="left"><font size="+1"><strong> 
  354.                         <select name=Subject
  355. size="1" id=select8 onclick="changesk(document.myform.Subject.options[document.myform.Subject.selectedIndex].value)">
  356.                           <option value="-1" selected>全 部</option>
  357.                         </select>
  358.                         </strong></font></div></td>
  359.                   </tr>
  360.                 </table></td>
  361.       <td width="200" align="center" valign="baseline" nowrap >
  362.   <table width="94%" border="0" cellspacing="0" cellpadding="0">
  363.           <tr>
  364.             <td nowrap><strong>知识点:</strong></td>
  365.           </tr>
  366.           <tr>
  367.             <td> <select name=KnowPoint id="select9">
  368.                         <option value="-1" selected>----全 部----</option>
  369.                       </select> </td>
  370.           </tr>
  371.         </table></td>
  372.               <td width="105" colspan="2" align="center" valign="baseline" nowrap>
  373. <table width="92%" border="0" cellspacing="0" cellpadding="0">
  374.           <tr>
  375.             <td nowrap><strong>难易度:</strong></td>
  376.           </tr>
  377.           <tr>
  378.             <td> <select name=hard id="select10">
  379.                 <option value="1" selected>任意</option>
  380.                 <option value="2">容易</option>
  381.                 <option value="3">中等</option>
  382.                 <option value="4">较难</option>
  383.               </select> </td>
  384.           </tr>
  385.         </table></td>
  386.     </tr>
  387.     <tr valign="middle">
  388.               <td height="29" colspan="5" align="center" nowrap> <strong>测试顺序:</strong>
  389.                 <input type="radio" name="testorder" value="1">
  390.         随机顺序
  391.         <input type="radio" name="testorder" value="2">
  392.         从难到易
  393.         <input type="radio" name="testorder" value="3">
  394.         从易到难</td>
  395.     </tr>
  396.     <tr valign="middle">
  397.               <td height="14" colspan="5" align="center" nowrap><font color="#000000"><strong>试题数</strong></font><strong>:</strong>
  398.                 <input name="testnumber" type="text" id="testnumber2" value="10" size="10">
  399.               </td>
  400.     </tr>
  401.     <tr>
  402.               <td height="15" colspan="5" align="center" valign="baseline" nowrap>
  403.                 <input name="testbegin" type="submit" class="s02" id="testbegin2"  value="开 始">
  404.               </td>
  405.     </tr>
  406.   </table>
  407. </FORM></td>
  408.     </tr>
  409.   </table>
  410.   <!--end 内容区 -->
  411.   <!--begin bottom -->
  412.   <TABLE
  413. style="BORDER-TOP: #dbdbdb 1px solid; MARGIN-TOP: 10px; MARGIN-BOTTOM: 10px; BACKGROUND-COLOR: #f6f6f6"
  414. cellSpacing=0 cellPadding=0 width="100%" border=0>
  415.   <TBODY>
  416.   <TR>
  417.     <TD align=middle colSpan=2 height=30>
  418.       <TABLE cellSpacing=0 cellPadding=0 width=750 border=0>
  419.         <TBODY>
  420.         <TR>
  421.           <TD><A href="http://jsptestonline.cosoft.org.cn/index.html"
  422.             target=_blank>关于我们</A> | <A
  423.             href="http://jsptestonline.cosoft.org.cn/contact/3_ywhz.html"
  424.             target=_blank>联系方式</A> | 网站地图 | <A
  425.             href="http://jsptestonline.cosoft.org.cn/about/service.html"
  426.             target=_blank>服务条款</A> | <A
  427.             href="http://jsptestonline.cosoft.org.cn/about/privacy.html"
  428.             target=_blank>隐私权保护</A> | <A
  429.             href="http://jsptestonline.cosoft.org.cn/about/copyright.html"
  430.             target=_blank>版权声明</A></TD>
  431.           <TD align=middle width=220>版权所有:<A href="http://jsptestonline.cosoft.org.cn/"
  432.             target=_blank>共创教育机构</A></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><!--end bottom --></CENTER></BODY></HTML>