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

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %>
  2. <%@ page import="java.sql.*"%>
  3. <%@ page import="jinghua.*"%>
  4. <%@ page import="java.util.*"%>
  5. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  6. </jsp:useBean>
  7. <%!boolean debug=false;
  8. Connection con;
  9. class Test{
  10.     String id;
  11.     String name;
  12.     String grade;
  13.     String time;
  14.     String totalMark;
  15.     String testclass;
  16.     String status;
  17.     public String toString(){
  18.         String temp="";
  19.         temp="<br> id="+id+"<br> name="+name;
  20.         return temp;
  21.    }
  22. };
  23. Statement stmt=null;
  24. ResultSet rs=null;
  25. String sql="";
  26. String sqlCon=null;
  27. int testNumber=0;
  28. int EveryPage=5;//每页显示的记录数;
  29. int OnPage=1; //当前显示的页数;
  30. int Total=0;//记录的总数;
  31. int TotalPage=0;//记录的总页数;
  32. %>
  33. <%
  34. ArrayList testSet=new ArrayList();
  35. try{
  36.     con=DBCon.getConnection();
  37. %>
  38. <%
  39. //构造查询条件
  40. //String query_grade=(String)session.getAttribute("query_grade");
  41. //String query_sub=(String)session.getAttribute("query_sub");
  42. //String query_knowpoint=(String)session.getAttribute("query_knowpoint");
  43. //String query_testtype=(String)session.getAttribute("query_testtype");
  44. //String errorpad_errorcount=(String)session.getAttribute("errorpad_errorcount");
  45. sqlCon="";
  46. String query_grade=request.getParameter("Grade");
  47. String query_sub=request.getParameter("Subject");
  48. String query_knowpoint=request.getParameter("KnowPoint");
  49. String query_testtype=request.getParameter("testtype");
  50. if(query_grade!=null)
  51. {
  52.     session.setAttribute("query_grade",query_grade);
  53. }
  54. else
  55. {
  56.     query_grade=(String)session.getAttribute("query_grade");
  57. }
  58. if(query_sub!=null)
  59. {
  60.     session.setAttribute("query_sub",query_sub);
  61. }else
  62. {
  63.     query_sub=(String)session.getAttribute("query_sub");
  64. }
  65. if(query_knowpoint!=null)
  66. {
  67.     session.setAttribute("query_knowpoint",query_knowpoint);
  68. }
  69. else
  70. {
  71.     query_knowpoint=(String)session.getAttribute("query_knowpoint");
  72. }
  73. if(query_testtype!=null)
  74. {
  75.     session.setAttribute("query_testtype",query_testtype);
  76. }
  77. else
  78. {
  79.     query_testtype=(String)session.getAttribute("query_testtype");
  80. }
  81. if(query_grade==null)
  82.     query_grade="all";
  83. if(query_sub==null)
  84.     query_sub="all";
  85. if(query_knowpoint==null)
  86.     query_knowpoint="all";
  87. if(query_testtype==null)
  88.     query_testtype="2";
  89. if(debug){
  90.     out.print("<br>grade="+query_grade+
  91.     "<br>sub="+query_sub+
  92.     "<br>knowpoint="+query_knowpoint+
  93.     "<br>testtype="+query_testtype
  94.     );
  95. }
  96. sqlCon="";
  97. int itesttype=Integer.parseInt(query_testtype);
  98. switch (itesttype){
  99. case 1://自由测试
  100. //test.status=3:模拟考试,4:自由测试, 2:单元测试
  101. sqlCon=" (test.status<>3 AND test.status<>2)";
  102.         if(query_grade!=null){
  103.             if(!query_grade.equals("all")){
  104.                 if(query_grade.equals("c")){
  105.                     if(sqlCon.equals(""))
  106.                         sqlCon=" (test.gradenote='c1' OR test.gradenote='c2' OR test.gradenote='c3')";
  107.                     else
  108.                         sqlCon=sqlCon+ " AND "+" (test.gradenote='c1' OR test.gradenote='c2' OR test.gradenote='c3')";
  109.                 }else if(query_grade.equals("g")){
  110.                     if(sqlCon.equals(""))
  111.                         sqlCon=" (test.gradenote='g1' OR test.gradenote='g2' OR test.gradenote='g3l' OR test.gradenote='g3w')";
  112.                     else
  113.                         sqlCon=sqlCon+ " AND "+" (test.gradenote='g1' OR test.gradenote='g2' OR test.gradenote='g3l' OR test.gradenote='g3w')";
  114.                 }
  115.                 else if(sqlCon.equals(""))
  116.                         sqlCon=" (test.gradenote='"+query_grade+"')";
  117.                     else
  118.                         sqlCon=sqlCon+ " AND "+" (test.gradenote='"+query_grade+"')";
  119.             }
  120.         }
  121.         if(debug)   out.println("<br>grade sql="+sqlCon);
  122.         if(query_sub!=null){
  123.         if(!query_sub.equals("all")){
  124.             if (!sqlCon.equals(""))
  125.                 sqlCon=sqlCon +" AND (test.subid="+query_sub+")";
  126.             else
  127.                 sqlCon=" (test.subid="+query_sub+")";
  128.             }
  129.         }
  130.         if(debug)    out.println("<br>subject 4"+sqlCon);
  131.         if(query_knowpoint!=null){
  132.             if(!query_knowpoint.equals("all")){
  133.                 if(!sqlCon.equals(""))
  134.                     sqlCon=sqlCon+" AND(test.knowpointid1="+query_knowpoint +
  135.                         " OR test.knowpointid2="+query_knowpoint+
  136.                         " OR test.knowpointid3="+query_knowpoint+")";
  137.                 else
  138.                     sqlCon=" (test.knowpointid1="+query_knowpoint +
  139.                         " OR test.knowpointid2="+query_knowpoint+
  140.                         " OR test.knowpointid3="+query_knowpoint+")";
  141.             }
  142.         }
  143.         if(debug)    out.println("<br>knowpoint sql="+sqlCon);
  144.         sql="SELECT   `test`.`id`, `test`.`status`, `grade`.`Name` AS `gradename`,"+
  145.             "  `test`.`title` AS `testname`,  `test`.`mark`,  `test`.`date` AS `testdate`"+
  146.             "  FROM  `test`  LEFT OUTER JOIN `grade` ON (`test`.`gradenote` = `grade`.`note`)";
  147.         if(!sqlCon.equals("")) sql=sql+" WHERE "+sqlCon;
  148.         sql=sql+" ORDER BY  `test`.`gradenote`,`test`.`subid`,`test`.`id`";
  149.         if(debug) out.println("<br>test sql="+sql);
  150.         stmt=con.createStatement();
  151.         rs=stmt.executeQuery(sql);
  152.         while(rs.next()){
  153.             Test t=new Test();
  154.             if(rs.getInt("status")==4)
  155.                 t.status="已发布";
  156.             else
  157.                 t.status="己注销";
  158.             t.id=rs.getString("id");
  159.             //<a href="Query_test_mn.jsp" target="_self">test</a>
  160.             t.name="<a href="+"modify_test_free.jsp?testID="+t.id+" target="_self">"+
  161.                         rs.getString("testname")+"</a>";
  162.             t.grade=rs.getString("gradename");
  163.             t.totalMark=rs.getString("mark");
  164.             t.testclass="单元测试";
  165.             t.time=rs.getString("testdate");
  166.             testSet.add(t);
  167.         }
  168.         rs.close();
  169.         stmt.close();
  170.         break;
  171.     case 2://单元测试
  172. //test.status=3:模拟考试,4:自由测试
  173. sqlCon=" (test.status<>3 AND test.status<>4)";
  174.         if(query_grade!=null){
  175.             if(!query_grade.equals("all")){
  176.                 if(query_grade.equals("c")){
  177.                     if(sqlCon.equals(""))
  178.                         sqlCon=" (test.gradenote='c1' OR test.gradenote='c2' OR test.gradenote='c3')";
  179.                     else
  180.                         sqlCon=sqlCon+ " AND "+" (test.gradenote='c1' OR test.gradenote='c2' OR test.gradenote='c3')";
  181.                 }else if(query_grade.equals("g")){
  182.                     if(sqlCon.equals(""))
  183.                         sqlCon=" (test.gradenote='g1' OR test.gradenote='g2' OR test.gradenote='g3l' OR test.gradenote='g3w')";
  184.                     else
  185.                         sqlCon=sqlCon+ " AND "+" (test.gradenote='g1' OR test.gradenote='g2' OR test.gradenote='g3l' OR test.gradenote='g3w')";
  186.                 }
  187.                 else if(sqlCon.equals(""))
  188.                         sqlCon=" (test.gradenote='"+query_grade+"')";
  189.                     else
  190.                         sqlCon=sqlCon+ " AND "+" (test.gradenote='"+query_grade+"')";
  191.             }
  192.         }
  193.         if(debug)   out.println("<br>grade sql="+sqlCon);
  194.         if(query_sub!=null){
  195.         if(!query_sub.equals("all")){
  196.             if (!sqlCon.equals(""))
  197.                 sqlCon=sqlCon +" AND (test.subid="+query_sub+")";
  198.             else
  199.                 sqlCon=" (test.subid="+query_sub+")";
  200.             }
  201.         }
  202.         if(debug)    out.println("<br>subject 4"+sqlCon);
  203.         if(query_knowpoint!=null){
  204.             if(!query_knowpoint.equals("all")){
  205.                 if(!sqlCon.equals(""))
  206.                     sqlCon=sqlCon+" AND(test.knowpointid1="+query_knowpoint +
  207.                         " OR test.knowpointid2="+query_knowpoint+
  208.                         " OR test.knowpointid3="+query_knowpoint+")";
  209.                 else
  210.                     sqlCon=" (test.knowpointid1="+query_knowpoint +
  211.                         " OR test.knowpointid2="+query_knowpoint+
  212.                         " OR test.knowpointid3="+query_knowpoint+")";
  213.             }
  214.         }
  215.         if(debug)    out.println("<br>knowpoint sql="+sqlCon);
  216.         sql="SELECT   `test`.`id`, `test`.`status`, `grade`.`Name` AS `gradename`,"+
  217.             "  `test`.`title` AS `testname`,  `test`.`mark`,  `test`.`date` AS `testdate`"+
  218.             "  FROM  `test`  LEFT OUTER JOIN `grade` ON (`test`.`gradenote` = `grade`.`note`)";
  219.         if(!sqlCon.equals("")) sql=sql+" WHERE "+sqlCon;
  220.         sql=sql+" ORDER BY  `test`.`gradenote`,`test`.`subid`,`test`.`id`";
  221.         if(debug) out.println("<br>test sql="+sql);
  222.         stmt=con.createStatement();
  223.         rs=stmt.executeQuery(sql);
  224.         while(rs.next()){
  225.             Test t=new Test();
  226.             if(rs.getInt("status")==2)
  227.                 t.status="已发布";
  228.             else
  229.                 t.status="己注销";
  230.             t.id=rs.getString("id");
  231.             //<a href="Query_test_mn.jsp" target="_self">test</a>
  232.             t.name="<a href="+"modify_test_unit.jsp?testID="+t.id+" target="_self">"+
  233.                         rs.getString("testname")+"</a>";
  234.             t.grade=rs.getString("gradename");
  235.             t.totalMark=rs.getString("mark");
  236.             t.testclass="单元测试";
  237.             t.time=rs.getString("testdate");
  238.             testSet.add(t);
  239.         }
  240.         rs.close();
  241.         stmt.close();
  242.         break;
  243.     case 3://模拟测试
  244.         if(query_grade!=null){
  245.             if(!query_grade.equals("all")){
  246.                 if(query_grade.equals("c")){
  247.                     if(sqlCon.equals(""))
  248.                         sqlCon=" (mn_test.grade_note='c1' OR mn_test.grade_note='c2' OR mn_test.grade_note='c3')";
  249.                     else
  250.                         sqlCon=sqlCon+" AND "+" (mn_test.grade_note='c1' OR mn_test.grade_note='c2' OR mn_test.grade_note='c3')";
  251.                 }else if(query_grade.equals("g")){
  252.                     if(sqlCon.equals(""))
  253.                         sqlCon=" (mn_test.grade_note='g1' OR mn_test.grade_note='g2' OR mn_test.grade_note='g3l' OR mn_test.grade_note='g3w')";
  254.                     else
  255.                         sqlCon=sqlCon+" AND "+" (mn_test.grade_note='g1' OR mn_test.grade_note='g2' OR mn_test.grade_note='g3l' OR mn_test.grade_note='g3w')";
  256.                 }
  257.             else  if(sqlCon.equals(""))
  258.                     sqlCon=" (mn_test.grade_note='"+query_grade+"')";
  259.                 else
  260.                     sqlCon=sqlCon+" AND "+" (mn_test.grade_note='"+query_grade+"')";
  261.             }
  262.         }
  263.         if(debug)   out.println("<br>grade sql="+sqlCon);
  264.         sql="SELECT   `mn_test`.`id`,`mn_test`.`status`,  `mn_test`.`name` AS `testname`,"+
  265.             "  `grade`.`Name` AS `gradename`,  `mn_test`.`mntotalmark`,"+
  266.             "  CONCAT(`mn_test`.`begin_date`,"至",  `mn_test`.`end_date`) as testtime FROM  `mn_test`"+
  267.             "  LEFT OUTER JOIN `grade` ON (`mn_test`.`grade_note` = `grade`.`note`)";
  268.         if(!sqlCon.equals("")) sql=sql+" WHERE "+sqlCon;
  269.         sql=sql+" ORDER BY  `mn_test`.`grade_note`,`mn_test`.`begin_date`";
  270.         stmt=con.createStatement();
  271.         rs=stmt.executeQuery(sql);
  272. if(debug) out.print("<br>mn_test sql="+sql);
  273.         while(rs.next()){
  274.             Test t=new Test();
  275.             if(rs.getInt("status")==2)
  276.                 t.status="已发布";
  277.             else
  278.                 t.status="己注销";
  279.             t.id=rs.getString("id");
  280.             //<a href="Query_test_mn.jsp" target="_self">test</a>
  281.             t.name="<a href="+"modify_test_mn.jsp?mnID="+t.id+" target="_self">"+
  282.                         rs.getString("testname")+"</a>";
  283.             t.grade=rs.getString("gradename");
  284.             t.totalMark=rs.getString("mntotalmark");
  285.             t.testclass="模拟考试";
  286.             t.time=rs.getString("testtime");
  287.             testSet.add(t);
  288.         }
  289.         rs.close();
  290.         stmt.close();
  291.         break;
  292.     default:
  293. }
  294. if(debug)
  295.     out.println("<br>at last sql="+sql);
  296. //rs.last();//移到最后一条记录;
  297. //Total=rs.getRow();//记录的总数;
  298. //TotalPage=(Total%EveryPage==0)?(Total/EveryPage):(Total/EveryPage+1);
  299. %>
  300. <!--年级,科目,知识点三个下拉列表框联动-->
  301. <%
  302. out.print(Tools.sub_know(con));
  303. out.print(Tools.grade_sub(con));
  304. %>
  305. <script language="JavaScript">
  306. function changegs(locationid){
  307. document.myform.Subject.length =1;
  308.         document.myform.KnowPoint.length =1;
  309.         var locationid=locationid;
  310.         var i;
  311.         for (i=0;i < gscount; i++){
  312.             if (grade_sub[i][0] == locationid) {
  313.             document.myform.Subject.options[document.myform.Subject.length] = new Option(grade_sub[i][2], grade_sub[i][1]);
  314.             }
  315. }
  316. }
  317. function changesk(locationid){
  318. document.myform.KnowPoint.length =1;
  319. var locationid=locationid;
  320. var i;
  321. for (i=0;i < gskcount; i++){
  322. if (grade_sub_know[i][1] == locationid){
  323. document.myform.KnowPoint.options[document.myform.KnowPoint.length] = new Option(grade_sub_know[i][3], grade_sub_know[i][2]);
  324. }
  325. }
  326. }
  327. function delit(myform)
  328. {
  329.   if (confirm("将删除所有选择的知识点数据?"))
  330.   {
  331.     myform.action="errorpaddel.jsp";
  332.     myfrom.target="_self";
  333.     myform.submit();
  334.   }
  335. }
  336. function del_check()
  337. {
  338. var count = myform.elements.length;
  339. var noSelect = true;
  340.   for(var i=0;i<count;i++)
  341.   {
  342.      if(myform.elements[i].checked)
  343.      {
  344.              noSelect = false;
  345.       break;
  346. }
  347.    }
  348. if(noSelect == true)
  349. {
  350.     alert("您还没有选择要删除的试卷!");
  351.     return(false);
  352.  }
  353.    else
  354.    {
  355.          if(confirm("将删除所有选择的试卷吗?"))
  356.          {
  357.                 document.myform.method = "POST";
  358.                 document.myform.action = "test_del.jsp";
  359.                 document.myform.target="_self";
  360.                 document.myform.submit();
  361.          }
  362.          else
  363.          {
  364.                 document.myform.method = "GET";
  365.                 document.myform.action = "";
  366. }
  367.      }
  368.      return false;
  369. }
  370. function active_check()
  371. {
  372. var count = myform.elements.length;
  373. var noSelect = true;
  374.   for(var i=0;i<count;i++)
  375.   {
  376.      if(myform.elements[i].checked)
  377.      {
  378.              noSelect = false;
  379.       break;
  380. }
  381.    }
  382. if(noSelect == true)
  383. {
  384.     alert("您还没有选择要激活的试卷!");
  385.     return(false);
  386.  }
  387.    else
  388.    {
  389.          if(confirm("激活所有选择的试卷吗?"))
  390.          {
  391.                 document.myform.method = "POST";
  392.                 document.myform.action = "test_activde.jsp";
  393.                 document.myform.target="_self";
  394.                 document.myform.submit();
  395.          }
  396.          else
  397.          {
  398.                 document.myform.method = "GET";
  399.                 document.myform.action = "";
  400. }
  401.          }
  402.          return false;
  403. }
  404. function deactive_check()
  405. {
  406. var count = myform.elements.length;
  407. var noSelect = true;
  408.   for(var i=0;i<count;i++)
  409.   {
  410.      if(myform.elements[i].checked)
  411.      {
  412.              noSelect = false;
  413.       break;
  414. }
  415.    }
  416. if(noSelect == true)
  417. {
  418.     alert("您还没有选择要注销的试卷!");
  419.     return(false);
  420.  }
  421.    else
  422.    {
  423.          if(confirm("注销所有选择的试卷吗?"))
  424.          {
  425.                 document.myform.method = "POST";
  426.                 document.myform.action = "test_deactivde.jsp";
  427.                 document.myform.target="_self";
  428.                 document.myform.submit();
  429.          }
  430.          else
  431.          {
  432.                 document.myform.method = "GET";
  433.                 document.myform.action = "";
  434. }
  435.          }
  436.          return false;
  437. }
  438. function subform(stract)
  439. {
  440. switch (stract){
  441. case "del":
  442.             del_check();
  443. break;
  444. case "active":
  445.             active_check();
  446. break;
  447. case "deactive":
  448. deactive_check();
  449. break;
  450. }
  451. }
  452. function selectid(){
  453.     var winpoint=window.open('','err_test_type','height=240,width=470,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no,depended=yes,alwaysRaised =yes,z-look=yes');
  454.     var toppos=(window.screen.height-240)/2;
  455.     var leftpos=(window.screen.width-470)/2;
  456.     winpoint.moveTo(toppos,leftpos);
  457.     winpoint.focus();
  458.     document.errorpad.method="POST";
  459.     document.errorpad.action="err_test_type.jsp";
  460.     document.errorpad.target="err_test_type";
  461.     document.errorpad.submit();
  462. }
  463. function printerror(){
  464.     var winpoint=window.open('','err_print_type','height=240,width=520,top=0,left=0,toolbar=no,menubar=no,scrollbars=no, resizable=no,location=no, status=no,depended=yes,alwaysRaised =yes,z-look=yes');
  465.     var toppos=(window.screen.height-240)/2;
  466.     var leftpos=(window.screen.width-470)/2;
  467.     winpoint.moveTo(toppos,leftpos);
  468.     winpoint.focus();
  469.     document.errorpad.method="POST";
  470.     document.errorpad.action="err_print_type.jsp";
  471.     document.errorpad.target="err_print_type";
  472.     document.errorpad.submit();
  473. }
  474. function openDetail(var1){
  475.     var winpoint=window.open('err_query_detail.jsp?id='+var1,'newwindow','height=400,width=300,top=0,left=0,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no,depended=yes,alwaysRaised =yes,z-look=yes');
  476.     winpoint.focus();
  477. }
  478. function InitMyform(){
  479.     document.myform.Grade.value='<%=query_grade%>';
  480.     changegs(document.myform.Grade.options[document.myform.Grade.selectedIndex].value);
  481.     document.myform.Subject.value='<%=query_sub%>';
  482.     changesk(document.myform.Subject.options[document.myform.Subject.selectedIndex].value);
  483.     document.myform.KnowPoint.value='<%=query_knowpoint%>';
  484.     document.myform.testtype.value='<%=query_testtype%>';
  485. }
  486. </script>
  487. <HTML>
  488. <HEAD>
  489. <META http-equiv=Content-Type content="text/html; charset=gb2312">
  490. <TITLE>共创学堂-考试查询</TITLE>
  491. <SCRIPT language=JavaScript>
  492. <!--
  493. function SymError()
  494. {
  495.   return true;
  496. }
  497. window.onerror = SymError;
  498. //-->
  499. </SCRIPT>
  500. <!-- saved from url=(0041)http://jsptestonline.cosoft.org.cn/senior/none_xt.jsp -->
  501. <META http-equiv=Content-Type content="text/html; charset=gb2312"><LINK
  502. href="../errorpad/style/style.css" type=text/css rel=stylesheet>
  503. <SCRIPT src=""></SCRIPT>
  504. <SCRIPT src=""></SCRIPT>
  505. <SCRIPT src=""></SCRIPT>
  506. <SCRIPT src=""></SCRIPT>
  507. <SCRIPT src=""></SCRIPT>
  508. <META content="MSHTML 6.00.2462.0" name=GENERATOR>
  509. <link rel="stylesheet" type="text/css" href="../css.css">
  510. </HEAD>
  511. <BODY bgColor=#ffffff text=#000000 onLoad="InitMyform()">
  512. <CENTER>
  513. <TABLE cellSpacing=0 cellPadding=0 width=650 border=0>
  514.   <TBODY>
  515.   <TR>
  516.           <TD><IMG height=27 src="../errorpad/images/test_pop_01.gif" width=102></TD>
  517.           <TD align=right><IMG height=27 src="../errorpad/images/test_pop_02.gif"
  518.       width=134></TD>
  519.         </TR></TBODY></TABLE>
  520.   <strong><font color="#3366FF" size="+2" face="黑体">共创学堂试卷查询</font></strong>
  521.   <!--begin test -->
  522.   <FORM action=modify_test.jsp method=post name=myform target="_self" id="myform">
  523.     <TABLE width=100% height="60" border=0 cellPadding=0 cellSpacing=0>
  524.       <TBODY>
  525.         <TR>
  526.           <TD height="75"  align=middle valign="bottom">
  527.             <table width="600" height="56" border="1" align="center" cellspacing="1" bordercolor="#799AE1" id="AutoNumber3" style="border-collapse: collapse">
  528.               <tr>
  529.                 <td width="100" height="52" align="center" valign="baseline" nowrap background="../errorpad/images/admin_bg_1.gif" bgcolor="#FFFDE8">
  530.                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  531.                     <tr>
  532.                       <td>年&nbsp;级:</td>
  533.                     </tr>
  534.                     <tr>
  535.                       <td height="24" nowrap> <select id=select30 name=Grade onclick="changegs(document.myform.Grade.options[document.myform.Grade.selectedIndex].value)" size="1">
  536.                           <option value="all" selected>-全 部-</option>
  537.                           <%Tools.showGradeOption(con,out);%>
  538.                         </select> </td>
  539.                     </tr>
  540.                   </table>
  541.                   &nbsp; </td>
  542.                 <td width="88" align="center" valign="baseline" nowrap background="../errorpad/images/admin_bg_1.gif" bgcolor="#FFFDE8">
  543.                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  544.                     <tr>
  545.                       <td nowrap>科&nbsp;目:</td>
  546.                     </tr>
  547.                     <tr>
  548.                       <td nowrap> <select id=select29 name=Subject onclick="changesk(document.myform.Subject.options[document.myform.Subject.selectedIndex].value)"
  549. size="1">
  550.                           <option value="all" selected>全 部</option>
  551.                         </select> </td>
  552.                     </tr>
  553.                   </table>
  554.                   <strong> </strong> </td>
  555.                 <td width="187" align="center" valign="baseline" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8">
  556.                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  557.                     <tr>
  558.                       <td nowrap>知识点:</td>
  559.                     </tr>
  560.                     <tr>
  561.                       <td nowrap> <select name=KnowPoint id="select31">
  562.                           <option value="all" selected>----全 部----</option>
  563.                         </select> </td>
  564.                     </tr>
  565.                   </table></td>
  566.                 <td width="104" align="center" valign="baseline" nowrap background="../errorpad/images/admin_bg_1.gif" bgcolor="#FFFDE8">
  567.                   <table width="100%" border="0" cellspacing="0" cellpadding="0">
  568.                     <tr>
  569.                       <td nowrap>考试类型:</td>
  570.                     </tr>
  571.                     <tr>
  572.                       <td nowrap> <select name="testtype" id="select8">
  573.                           <option value="1">自由测试</option>
  574.                           <option value="2" selected>单元测试</option>
  575.                           <option value="3">模拟测试 </option>
  576.                         </select> </td>
  577.                     </tr>
  578.                   </table></td>
  579.               </tr>
  580.             </table>
  581.             </TD>
  582.         </TR>
  583. <tr>
  584.           <td valign="top">
  585.             <table width="600" height="44" border="1" align="center" cellspacing="1" bordercolor="#799AE1" id="AutoNumber3" style="border-collapse: collapse">
  586.               <tr>
  587.                 <td width="150" height="40" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8">
  588.                   <p align="center">
  589.                     <input name="errDel" type="button" class="s03" id="errDel" value="删 除" border="0" onClick=subform("del")>
  590.                     <b><font color="#FFFFFF"> </font></b></td>
  591.                 <td width="150" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8">
  592.                   <p align="center"><b>
  593.                     <input name="errAscRate" type="button" class="s03" id="errAscRate2" value="激 活" border="0" onClick=subform("active")>
  594.                     </b> </td>
  595.                 <td width="150" nowrap background="../images/admin_bg_1.gif" bgcolor="#FFFDE8">
  596.                   <p align="center"><b>
  597.                     <input name="errDescRate" type="button" class="s03" id="errDescRate" value="注 销" border="0" onClick=subform("deactive")>
  598.                     </b><b> </b></td>
  599.                 <td width="150" background="../images/admin_bg_1.gif" bgcolor="#FFFDE8">
  600.                   <div align="center"><b>
  601.                     <input type="submit"  class="s03" name="Submit" value="查 询">
  602.                     </b> </div></td>
  603.               </tr>
  604.             </table></td></tr>
  605.       </TBODY>
  606.     </TABLE>
  607.  <%if (testSet.size()>0){
  608.  %>
  609.     <br>
  610.     <TABLE width=600 border=1 align=center cellSpacing=1 bordercolor="#799AE1" style="border-collapse: collapse">
  611.       <TBODY>
  612.         <TR>
  613.           <td width="587" height=22 bgColor=#E3E3E3 class=l> <table width="100%" border="0" cellspacing="0" cellpadding="0">
  614.               <tr>
  615.                 <td width="49" height="20" nowrap><div align="center"><strong>序号</strong></div></td>
  616.                 <td width="49" nowrap><div align="center"><strong>年级</strong></div></td>
  617.                 <td width="180" nowrap> <div align="left"><strong>考试名称</strong></div></td>
  618.                 <td width="142" nowrap><div align="center"><strong>考试发布时间</strong></div></td>
  619.                 <td width="66" nowrap><div align="center"><strong>考试类型</strong></div></td>
  620.                 <td width="49" nowrap><div align="center"><strong>总分</strong></div></td>
  621.                 <td width="57" nowrap><div align="center"><strong>状态</strong></div></td>
  622.               </tr>
  623.             </table></td>
  624.         </TR>
  625. <%          Iterator iter = testSet.listIterator();
  626.             int order=0;
  627.             while (iter.hasNext()) {
  628.                 Test t = (Test) iter.next();
  629.                 order++;
  630. %>
  631.             <TR>
  632.           <td width="587" height=22 class=l> <table width="100%" border="0" cellspacing="0" cellpadding="0">
  633.               <tr>
  634.                 <td width="49" height="20" align="left" valign="middle" nowrap>
  635.                   <div align="left">
  636.                     <input name="id" type="checkbox" id="id" value="<%=t.id%>">
  637.                     <%=order%>.</div></td>
  638.                 <td width="47" nowrap><div align="center"><%=t.grade%></div></td>
  639.                 <td width="185" nowrap> <div align="left"><%=t.name%></div></td>
  640.                 <td width="141" nowrap><div align="center"><%=t.time%></div></td>
  641.                 <td width="65" nowrap><div align="center"><%=t.testclass%></div></td>
  642.                 <td width="49" nowrap> <div align="center"><%=t.totalMark%></div></td>
  643.                 <td width="56" nowrap><div align="center"><%=t.status%></div></td>
  644.               </tr>
  645.             </table></td>
  646.         </TR>
  647. <%
  648.             }
  649. %>
  650.       </TBODY>
  651.     </TABLE>
  652.     <p>
  653. <input name="stu_id" type="hidden" id="studentid2" value="">
  654. </FORM>
  655. <%}
  656. else{
  657.    %>
  658.   <table width="77%" border="0" cellspacing="0" cellpadding="0">
  659.     <tr>
  660.       <td width="33%"><img src="images/pic_notice.gif" width="150" height="150"></td>
  661.       <td width="67%" align="center" valign="middle" nowrap>
  662.         <div align="center"><font size="+2">没有查询到满足条件的数据!</font></div></td>
  663.     </tr>
  664.   </table>
  665.    <%
  666. }
  667. %>
  668.   <!--end test -->
  669.   <!--begin bottom -->
  670.   <!--end bottom -->
  671. </CENTER>
  672. </BODY>
  673. </HTML>
  674. <%}
  675. catch(SQLException se){
  676.     out.println("<br>sql="+sql);
  677.     out.println("<br>"+se.toString());
  678. }
  679. catch(Exception e){
  680.     out.println("<br>sql="+sql);
  681.     out.print(e.toString());
  682. }
  683. finally{
  684.     DBCon.dropConnection();
  685. }
  686. %>