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

教育系统应用

开发平台:

WORD

  1. <%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" %>
  2. <%@ page errorPage="QuestGen_error.jsp" %>
  3. <%@ page import="java.io.*"%>
  4. <%@ page import="jinghua.JH_Tools"%>
  5. <jsp:useBean id="DBCon" class="jinghua.JinghuaConn" scope="session">
  6. </jsp:useBean>
  7. <%!Connection con=null;
  8. String teachID="";
  9. %>
  10. <%
  11. try{
  12.     con=DBCon.getConnection();
  13.  %>
  14. <script language="javascript">
  15. function CheckForm(f)
  16. {
  17. //获取HTML文本
  18. var strText="";
  19. if (editor.EditMode.checked==true){
  20.   document.myform.Content.value=editor.Composition.document.body.innerText;
  21.   strText=editor.Composition.document.body.innerHTML;
  22.   }
  23.    else{
  24.   document.myform.Content.value=editor.Composition.document.body.innerHTML;
  25.   strText=editor.Composition.document.body.innerText;
  26. }
  27. //var v=document.myform.Content.value=editor.Composition.document.body.innerHTML;
  28. //alert(v);
  29. var imageindex;
  30. var strHtml=document.myform.Content.value;
  31. var arrQuest=new Array();
  32. arrQuest=strHtml.split("@@");
  33. var arrQuestText=new Array();
  34. arrQuestText=strText.split("@@");
  35. for( var i=0;i<arrQuest.length;i++){
  36. imageindex=arrQuest[i].indexOf("v:imagedata");
  37. if(imageindex>=0)
  38. {
  39.      alert("提交的试题中第 "+i+" 道含有从Word导入的图片信息,请仔细检查!n"+"原题目为:n"+arrQuestText[i]);
  40. return false;
  41. }
  42. }
  43.     if( f.Grade.selectedIndex == 0) {
  44.         alert("请选择年级信息!")
  45.         return false;
  46.     }
  47.     if(f.Subject.selectedIndex==0){
  48.         alert("请选择科目信息!")
  49.         return false;
  50.     }
  51.     if(f.mntest.selectedIndex==0){
  52.         alert("请选择模拟考试信息!")
  53.         return false;
  54.     }
  55. return true;
  56. }
  57. function isNumberString (InString,RefString)
  58. {
  59. if(InString.length==0) return (false);
  60. for (Count=0; Count < InString.length; Count++)  {
  61. TempChar= InString.substring (Count, Count+1);
  62. if (RefString.indexOf (TempChar, 0)==-1)
  63. return (false);
  64. }
  65. return (true);
  66. }
  67. </script>
  68. <!--年级,科目,知识点三个下拉列表框联动-->
  69. <%
  70. String temp=jinghua.JH_Tools.grade_mntest(con);
  71. out.print(temp);
  72. temp=jinghua.JH_Tools.sub_know(DBCon.getConnection());
  73. out.print(temp);
  74. temp=jinghua.JH_Tools.grade_sub(DBCon.getConnection());
  75. out.print(temp);
  76. %>
  77. <script language="JavaScript">
  78. function changegm(locationid){
  79.     document.myform.mntest.length =1;
  80. document.myform.Subject.length =1;
  81. document.myform.KnowPoint1.length =1;
  82.         document.myform.KnowPoint2.length =1;
  83.         document.myform.KnowPoint3.length =1;
  84.         var locationid=locationid;
  85.         var i;
  86.         for (i=0;i < gmcount; i++){
  87.             if (grade_mntest[i][0] == locationid) {
  88.             document.myform.mntest.options[document.myform.mntest.length] = new Option(grade_mntest[i][2], grade_mntest[i][1]);
  89.             }
  90. }
  91. for (i=0;i < gscount; i++){
  92.             if (grade_sub[i][0] == locationid) {
  93.             document.myform.Subject.options[document.myform.Subject.length] = new Option(grade_sub[i][2], grade_sub[i][1]);
  94.             }
  95. }
  96. }
  97. </script>
  98. <script language="JavaScript">
  99. function changesk(locationid){
  100. document.myform.KnowPoint1.length =1;
  101.     document.myform.KnowPoint2.length =1;
  102.     document.myform.KnowPoint3.length =1;
  103. var locationid=locationid;
  104. var i;
  105. for (i=0;i < gskcount; i++){
  106. if (grade_sub_know[i][1] == locationid){
  107. document.myform.KnowPoint1.options[document.myform.KnowPoint1.length] = new Option(grade_sub_know[i][3], grade_sub_know[i][2]);
  108.             document.myform.KnowPoint2.options[document.myform.KnowPoint2.length] = new Option(grade_sub_know[i][3], grade_sub_know[i][2]);
  109.             document.myform.KnowPoint3.options[document.myform.KnowPoint3.length] = new Option(grade_sub_know[i][3], grade_sub_know[i][2]);
  110. }
  111. }
  112. }
  113. </script>
  114. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  115. <html>
  116. <head>
  117. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  118. <link rel="stylesheet" type="text/css" href="../css.css">
  119. <title>模拟试题提交</title>
  120. </head>
  121. <body>
  122. <FORM name=myform action="updatetest_mn.jsp" method=post onSubmit="return CheckForm(this)">
  123.   <TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
  124.     <TBODY>
  125.       
  126.       <TR> 
  127.         <TD height=45><IMG height=45 src="images/logo.gif"
  128.   width=160></TD>
  129.       </TR>
  130.     </TBODY>
  131.   </TABLE>
  132.  
  133. <table width="100%" border="0" cellpadding="0" cellspacing="0">
  134.   <!--DWLayoutTable-->
  135.   <tr>
  136.     <td width="100%" height="535" valign="top">
  137. <table width="100%" height="321" border="1" bordercolor="#d3add1" background="images/lvbgcolor.gif">
  138.           <tr> 
  139.             <td width="17%" height="39" align="left" valign="middle">年 级: 
  140.               <select id=select16 name=Grade onclick="changegm(document.myform.Grade.options[document.myform.Grade.selectedIndex].value)" size="1">
  141.                 <option value="temp">未选择</option>
  142.                 <%jinghua.JH_Tools.showGradeOption(con,out);%>
  143.               </select> </td>
  144.             <td width="15%" align="left" valign="middle">题目类型: 
  145.               <select id=select15 name=QuestType>
  146.                 <%jinghua.JH_Tools.showOption("select * from questtype",con,out);%>
  147.               </select> </td>
  148.             <td width="68%" align="left" valign="middle"><table width="100%" border="0">
  149.                 <tr> 
  150.                   <td width="8%" height="31" nowrap>名称:</td>
  151.                   <td width="54%"><input name="suit_title" type="text" id="suit_title3" size="40" maxlength="200"></td>
  152.                   <td width="7%">&nbsp;</td>
  153.                   <td width="6%"><input name="Reset_Quest2" type="reset" class="s03" id="Reset_Quest4" value="重置"></td>
  154.                   <td width="6%">&nbsp;</td>
  155.                   <td width="19%"><input name="Submit2" type="submit" class="s03" value="提交"></td>
  156.                 </tr>
  157.               </table></td>
  158.           </tr>
  159.           <tr> 
  160.             <td height="50" colspan="2" align="left" valign="middle"> <table width="100%" border="0">
  161.                 <tr> 
  162.                   <td>模&nbsp;考: </td>
  163.                 </tr>
  164.                 <tr> 
  165.                   <td><select id=select6 name=mntest  size="1">
  166.                       <option value=-1>----未选择----</option>
  167.                     </select></td>
  168.                 </tr>
  169.               </table></td>
  170.             <td rowspan="3" align="center"> <iframe src="../editor/edit.jsp" id='editor' frameborder=0 scrolling=auto width=544 height=321> 
  171.               </iframe> <textarea name="Content" style="display:none"></textarea>
  172.               &nbsp;
  173.               <input name="group" type="hidden" id="group" value="suit"> 
  174.               <input name="teacherID" type="hidden" id="teacherID" value="1"></td>
  175.           </tr>
  176.           <tr> 
  177.             <td height="30" colspan="2" align="left" valign="middle"> 科 目: 
  178.               <select id=select4 name=Subject onClick="changesk(document.myform.Subject.options[document.myform.Subject.selectedIndex].value)"
  179. size="1">
  180.                 <option value="temp">未选择</option>
  181.                 <%--Tools.showOption("select * from subject order by id",con,out);--%>
  182.               </select>
  183.             </td>
  184.           </tr>
  185.           <tr> 
  186.             <td height="189" colspan="2" align="center" valign="middle"> 
  187.               <table width="100%" height="60%" border="0">
  188.                 <tr> 
  189.                   <td height="56"> <table width="100%" border="0">
  190.                       <tr> 
  191.                         <td>知识点1: </td>
  192.                       </tr>
  193.                       <tr> 
  194.                         <td><select name=KnowPoint1 id="select7">
  195.                             <option value=-1>----未选择----</option>
  196.                             <%-- Tools.showOption("select * from knowpoint order by id",con,out);--%>
  197.                           </select></td>
  198.                       </tr>
  199.                     </table></td>
  200.                 </tr>
  201.                 <tr> 
  202.                   <td height="62"> <table width="100%" border="0">
  203.                       <tr> 
  204.                         <td>知识点2:</td>
  205.                       </tr>
  206.                       <tr> 
  207.                         <td><select name=KnowPoint2 id="select">
  208.                             <option value=-1>----未选择----</option>
  209.                             <%-- Tools.showOption("select * from knowpoint order by id",con,out);--%>
  210.                           </select></td>
  211.                       </tr>
  212.                     </table></td>
  213.                 </tr>
  214.                 <tr> 
  215.                   <td height="59"><table width="100%" border="0">
  216.                       <tr> 
  217.                         <td>知识点3:</td>
  218.                       </tr>
  219.                       <tr> 
  220.                         <td><select name=KnowPoint3 id="select5">
  221.                             <option value=-1>----未选择----</option>
  222.                             <%-- Tools.showOption("select * from knowpoint order by id",con,out);--%>
  223.                           </select></td>
  224.                       </tr>
  225.                     </table></td>
  226.                 </tr>
  227.               </table></td>
  228.           </tr>
  229.         </table></td>
  230.   </tr>
  231. </table>
  232. </form>
  233. </body>
  234. </html>
  235. <%}
  236. catch(Exception e){
  237.     System.out.print(e.toString());
  238. }
  239. finally{
  240.     DBCon.dropConnection();
  241. }
  242. %>