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

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*"  import="jinghua.*" errorPage="" %>
  2. <
  3. <HTML><HEAD><TITLE>共创在线测试)</TITLE>
  4. <%@ page import="java.sql.*"%>
  5. <%@ page import="jinghua.*"%>
  6. <%@ page import="java.util.*"%>
  7. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  8. </jsp:useBean>
  9. <jsp:useBean id="Tools" class="jinghua.Tools" scope="session">
  10. </jsp:useBean>
  11. <%
  12. PreparedStatement pstmt=null;
  13. String title=null;
  14. Statement stmt=null;
  15. String sql=null;
  16. String temp=null;
  17. ResultSet rs=null;
  18. int studentID=-1;
  19. StringBuffer msgsb=new StringBuffer("OK");
  20. Connection con=null;
  21. //un_debug
  22. try{//取回学生的ID号
  23.   studentID=((Integer)session.getAttribute("studentID")).intValue();
  24. }catch(Exception e){
  25.   msgsb.append("teacherID Errorn");
  26. }
  27. String questTypeID=request.getParameter("QuestType");//试题类型ID
  28. int subjectID=Integer.parseInt(request.getParameter("Subject"));//科目ID
  29. String gradeID=request.getParameter("Grade");//年级ID
  30. String testPointID=request.getParameter("TestPoint");//测试点ID
  31. String difficulty=request.getParameter("Difficulty");//难度
  32. int knowPointID=Integer.parseInt(request.getParameter("KnowPoint"));//知识点ID
  33. int testNum=Integer.parseInt(request.getParameter("testnum"));
  34. //取回试题
  35. sql="select name from subject where id="+subjectID;
  36. con=DBCon.getConnection();
  37. stmt=con.createStatement();
  38. rs=stmt.executeQuery(sql);
  39. String tt;
  40. if (rs.next()){
  41. tt=rs.getString("name");
  42. //title=Tools.codestring(tt);
  43. title=tt;
  44. }
  45. rs.close();
  46. stmt.close();
  47. stmt=con.createStatement();
  48. sql="select name from knowpoint where id="+knowPointID;
  49. rs=stmt.executeQuery(sql);
  50. if(rs.next()){
  51. tt=rs.getString("name");
  52. title+=" :"+tt;
  53. }
  54. sql="SELECT   `question`.`ID`,  `question`.`QuestText`,  `question`.`Mark`, " +
  55. "  `question`.`Answer`,  `question`.`Tip`"+
  56. " FROM   `question` " +
  57. " WHERE  (`question`.`SubjectID` ="+subjectID+")  AND   " +
  58. "((`question`.`KnowPointID1` = "+knowPointID+") OR (`question`.`KnowPointID2` = "+knowPointID+") OR (`question`.`KnowPointID3` = "+knowPointID+")) ";
  59. //String t1[]=request.getParameterValues("QuestType");
  60. //String t2[]=request.getParameterValues("TestPoint");
  61. stmt=con.createStatement();
  62. rs=stmt.executeQuery(sql);
  63. %>
  64. <SCRIPT language=JavaScript>
  65. <!--
  66. function SymError()
  67. {
  68.   return true;
  69. }
  70. window.onerror = SymError;
  71. //-->
  72. </SCRIPT>
  73. <STYLE type=text/css>A:link {
  74. COLOR: #ef7321; TEXT-DECORATION: none
  75. }
  76. A:hover {
  77. COLOR: #666666; TEXT-DECORATION: underline
  78. }
  79. A:visited {
  80. COLOR: #666666; TEXT-DECORATION: none
  81. }
  82. BODY {
  83. FONT-SIZE: 9pt; FONT-FAMILY: "宋体"
  84. }
  85. H2 {
  86. COLOR: #cc6600; FONT-FAMILY: "宋体"
  87. }
  88. TD {
  89. FONT-SIZE: 9pt; COLOR: #666666; FONT-FAMILY: "宋体"
  90. }
  91. </STYLE>
  92. </HEAD>
  93. <BODY bgColor=#FFFFFF leftMargin=30>
  94. <CENTER>
  95.   <H2><font color="#74a8d1eF"><strong><a name="anchor"></a>共创在线测试</strong></font></H2>
  96. </CENTER>
  97. <HR width="60%">
  98. <!--单项选择<BR>
  99. 从A、B、C、四个选项中,选出可以填入空白处的最佳答案。 --><br>
  100. <TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
  101.   <TBODY>
  102.     <TR>
  103.       <TD width=4 bgColor=#b6e2fc height=366></TD>
  104.       <TD vAlign=top> <TABLE height=8 cellSpacing=0 width="100%" align=center border=0>
  105.           <TBODY>
  106.             <TR>
  107.               <TD vAlign=top height=238> <FORM name=exam action=#>
  108.                   <TABLE borderColor=#0a81e7 cellSpacing=0 cellPadding=4
  109.                   width="100%" align=center border=0>
  110.                     <TBODY>
  111.                       <TR bgColor=#b6e2fc>
  112.                         <TD width="43%" height=34> <DIV align=center><FONT color="#000000" size=2>考试类别:<%=title%></font></FONT></DIV></TD>
  113.                         <TD height=34> <DIV align=center></DIV>
  114.                           <DIV align=center><FONT color="#00000" size=2>已用时间:</FONT><FONT
  115.                         color=#80ff80>
  116.                             <INPUT size=10 name=input1>
  117.                             </FONT></DIV></TD>
  118.                       </TR>
  119.                     </TBODY>
  120.                   </TABLE>
  121.                 </FORM>
  122.             <FORM name=exam1 action=student/Marks.jsp method=post>
  123.               <CENTER>
  124.                     <DIV align=center> </DIV>
  125.                   </CENTER>
  126.                   <DIV align=left>
  127.                     <TABLE borderColor=#999999 height=133 cellSpacing=0
  128.                   cellPadding=0 width="100%" align=center bgColor=#ffffff
  129.                   border=0>
  130.                       <TBODY>
  131.                         <TR align=middle>
  132.                           <TD vAlign=top align=middle height=89> <TABLE cellSpacing=0 cellPadding=0 width="100%"
  133. border=0>
  134.                               <TBODY>
  135. <% int i=1;
  136.   while (rs.next() && i<testNum){
  137. %>
  138.                                 <TR>
  139.                                   <TD align="left" bgColor=#b6e2fc><font color="#00000">
  140.                                     <%out.print("("+i+")"+".");%>
  141.                                     </font></TD>
  142.                                 </TR>
  143.                                 <TR>
  144.                                   <TD valign="top">
  145.     <%
  146.     out.print(rs.getString("QuestText"));
  147. %>
  148.   &nbsp;</TD>
  149.                                 </TR>
  150. <%
  151. rs.next();
  152. i++;
  153. }
  154. rs.close();
  155. stmt.close();
  156. %>
  157.                             </TABLE>
  158.                             <DIV align=center>
  159.                               <INPUT style="FONT-SIZE: 9pt; FONT-FAMILY: 宋体" type=submit value=我要交卷了 name=Submit>
  160.                               <INPUT name=Reset type=reset onClick="MM_goToURL('parent','#anchor');return document.MM_returnValue" value=我要检查>
  161.                               <INPUT type=reset value=我要重填 name=Reset2>
  162.                               <BR>
  163.                             </DIV></TD>
  164.                         </TR>
  165.                     </TABLE>
  166.                   </DIV>
  167.                 </FORM></TD>
  168.             </TR>
  169.         </TABLE></TD>
  170.       <TD width=4 bgColor=#b6e2fc></TD>
  171.     </TR>
  172.     <TR>
  173.       <TD width=4 bgColor=#b6e2fc></TD>
  174.       <TD> <DIV align=center>〖<A onclick=javascript:window.close(1)
  175.             href="http://202.113.13.168/netclass/test/bookexam.php?class=%B4%F3%D1%A7%CB%C4%BC%B6#">关闭窗口</A>〗</DIV></TD>
  176.       <TD width=4 bgColor=#b6e2fc></TD>
  177.     </TR>
  178.     <TR>
  179.       <TD bgColor=#b6e2fc height=4></TD>
  180.       <TD bgColor=#b6e2fc height=4></TD>
  181.       <TD bgColor=#b6e2fc height=4></TD>
  182.     </TR>
  183.   </TBODY>
  184. </TABLE>
  185. <P>&nbsp;
  186. <TABLE width=100% border=0 align="center" cellPadding=0 cellSpacing=0>
  187.   <TBODY>
  188.   <TR>
  189.     <TD width=194>&nbsp;</TD>
  190.       <TD width=178 vAlign=bottom>版权所有:<A href="http://jsptestonline.cosoft.org.cn/"
  191.             target=_blank>共创教育机构</A></TD>
  192.       <TD vAlign=bottom width=304> 
  193.         <div align="left"><img src="/image/line_index.gif" width="160" height="45"></div></TD>
  194.     </TR></TBODY></TABLE>
  195. <CENTER></CENTER></BODY></HTML>