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

教育系统应用

开发平台:

WORD

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