⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 epaperedit.jsp

📁 培训考试系统代码
💻 JSP
📖 第 1 页 / 共 2 页
字号:
<%@ page contentType="text/html;charset=gb2312"%> 
<%@ include file="/agt/public/jsp/top.jsp" %>
                  <!-- title>培训考试系统编辑试卷页面</title -->

                  <form name="epaperform" method="POST" action="/ExamPaperMan.do">
                  
            <input type="hidden" name="backURL" value="<%=request.getParameter("backURL")%>">        

                    <table width="539" border="0" cellpadding="3" cellspacing="1" class="table-cs1">
                      <input type="hidden" name="opeType" value="<%=OperatorFlagCode.EPAPER_MODIFY%>" >
    <input type="hidden" name="paperId" value="<%=(String)request.getAttribute("paperId")%>">
                      <tr> 
                        <td class="td-cs1" align="center">试卷名称*</td>
                        <td class="td-cs2" colspan="3"> 
                          <input name="title" type="text" class="input2" value="<%=request.getAttribute("title")%>" maxlength="50"></td>
     </tr>
                      <tr> 
                        <% 
        SysResultSet rs  =  (SysResultSet)request.getAttribute("EPAPER-QUERY-TESTSET");

        int allScore = 0;
        if(rs != null)
        {  for(int i=0;rs.setRecord(i)&&i<rs.getMetaData().getRecordCount();i++)
           {
               allScore += rs.getInt(2);
           }
        }

        int paperType = Integer.parseInt((String)request.getAttribute("paperType"));
  %>
                        <td width="15%" class="td-cs1" align="center">类型名称*</td>
                        <td width="35%" class="td-cs2"> 
                          <select  name="paperType" class="input3">
          <option value="0" <%if(paperType==0){%> selected <%}%>>考试题</option>
          <option value="1" <%if(paperType==1){%> selected <%}%>>自测题</option>
          <option value="2" <%if(paperType==2){%> selected <%}%>>考试题&自测题</option>
        </select></td>
        
                               <td class="td-cs1" align="center">所属类别*</td>
                        <td class="td-cs2 colspan="2"> 
                        <table>
                        <tr><td><input name="className" type="text" class="input1" value="<%=ClassInfo.get((String)request.getAttribute("classId"))%>" size="18"> 
                        <input name="classId" type="hidden"  value="<%=(String)request.getAttribute("classId")%>"> 
                        </td>
                        <td>
                         <a href="javascript:;" onClick="javascript:openClassWindow('/ClsMngOperatorAction.do?operatorFlag=<%=OperatorFlagCode.CLSMNG_CHOOSE%>&select=03','选择类别');" onMouseOver="MM_swapImage('Image13','','/agt/public/images/choise_2.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="/agt/public/images/choise.gif" name="Image13" width="48" height="25" border="0"></a></td>
                        </td>
                        </tr>
                        </table>
                             
    </tr>
    <tr>
    <td width="15%" class="td-cs1" align="center">总分数*
                      </td>
      <td width="35%" class="td-cs2"><input type="text" name="allScore"  value="<%=allScore%>" class="input1" maxlength="3"></td>

    <td  width="15%" class="td-cs1" align="center">总题量</td>
    <td  width="35%" class="td-cs2" ><font class="12"><%=rs.getMetaData().getRecordCount()%></font> 
                        </td>
    </tr>
  </table>
                    <table width="539" border="0" cellpadding="3" cellspacing="1">
                      <tr>
                        <td><input name="add2" type="image" onclick="openWindow('/agt/epaper/SelectTest.jsp','选择试题');return false;" src="/agt/public/images/add2.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"></td>
                        
						<td><input name="del2" type="image" onclick="delTest();return false;" src="/agt/public/images/del2.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"></td>
                        <td><input name="back2" type="image" onclick="moveFront();return false;" src="/agt/public/images/back2.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"></td>
                        <td><input name="forward" type="image" onclick="moveBack();return false;" src="/agt/public/images/forward.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"></td>
                        <td><input name="zd" type="image" onclick="appointPlace();return false;" src="/agt/public/images/zd.gif" width="100" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"></td>
                        <td>序号:
                          <input  name="newPlace" type="text" class="input1-2" size="3" maxlength="3"></td>
                      </tr>
                    </table>

                    <table width="539" border="0" cellpadding="3" cellspacing="1" bgcolor="81BBFB" class="table-cs1" id="testTable"  name="testTable">
                      <%         
        if(rs != null)
        {  for(int i=0;rs.setRecord(i)&&i<rs.getMetaData().getRecordCount();i++)
           {
           //5:试题类型,7:试题难度,3:试题内容,8:试题选项,2:试题分数,1:试题ID号,9:正确答案
      %>
                      <tr class="td-cs2">
                <td valign="top" width="5%"><%=i+1%>、</td>
                <td  valign="top" width="15%"  class="td-cs2"><input type="hidden" name="testIds" value="<%=rs.getString(1)%>"> 
              <input type="checkbox" name="testItem">(<%=rs.getString(5)%>)</td>
                
      <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr valign="top"> 
            <td style="word-break:break-all" class="td-cs2">&nbsp;<%=rs.getString(3)%>&nbsp;(
              <input type="text" name="testScores" size="2" value="<%=rs.getString(2)%>" class="input1-2">
              分)&nbsp;(<%=rs.getString(7)%>)</td>
          </tr>
          <tr valign="top"> 
                              <td align="left">
                                <%
		      int testType = rs.getInt(4);
		      String optionRsSet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
		      int loc = 0;
		     
		      StringTokenizer stoken = new StringTokenizer(rs.getString(8),"#");
		    
	              while(stoken.hasMoreTokens())
	              {  
		         String optionRs = optionRsSet.substring(loc,loc+1);
		     
		         if(testType == 1 || testType == 2)
		         {//判断题,单选题       
		     %>
                                <table border="0" cellpadding="1" cellspacing="0">
                            <tr> 		  <td width="30"></td>
                  <td valign="top"  class="td-cs2"> <%=optionRs%>.
                    <input type="radio" name="option" value="<%=optionRs%>">
                    <%=stoken.nextToken()%> </td>
                </tr>
              </table>
              <%}
		         else if(testType == 3)
		         {//多选题
		         %>
                          <table border="0" cellpadding="1" cellspacing="0">
                            <tr> 		  <td width="30"></td>
                  <td valign="top"  class="td-cs2"> <%=optionRs%>.
                    <input type="checkbox" name="option" value="<%=optionRs%>">
                    <%=stoken.nextToken()%> </td>
                </tr>
              </table>
              <%    
		         }
		         else
		       {//填空题,问答题
		       %>
                          <table border="0" cellpadding="1" cellspacing="0">
                            <tr> 		  <td width="30"></td>
                  <td valign="top"  class="td-cs2"> <%=optionRs%>.
                                      <textarea name="option" cols="45" rows="<%=stoken.nextToken()%>" class="remark"></textarea> 
                  </td>
                </tr>
              </table>
              <% 
		       }
		       loc++;
		     }
                  %>
</td>
          </tr>
          <!-- huangyuyuan add at 2004-06-03 -->
          <tr>
          	<td>正确答案:<%=rs.getString(9)%></td>
          </tr>
          <!-- end -->
        </table></td>
             </tr>
                
     <%   }
        }
     %>

</table>

  <table width="539" height="30" border="0" cellpadding="0" cellspacing="0">
    <tr>
      <td height="40" align="center"> 
        <table width="424" height="30" border="0" cellpadding="0" cellspacing="0">
          <tr> 
                              <td width="25%">
                                <input name="save" type="image" onclick="submitSave();return false;" src="/agt/public/images/save.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"> 
                              </td>
                              <td width="25%">
                                <input name="public" type="image" onclick="submitRelease();return false;" src="/agt/public/images/public.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"> 
                              </td>
                              <td>
                                <input name="reset" type="image" onclick="epaperform.reset();return false;" src="/agt/public/images/reset.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"> 
                              </td>
                              <td>
                                <input name="back" type="image" onclick="history.back();return false;" src="/agt/public/images/back.gif" width="82" height="22" border="0" onmouseover="this.src='/agt/public/images/'+ this.name + '_2.gif';" onmouseout="this.src='/agt/public/images/'+ this.name + '.gif'"> 
                              </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>
                  <script src="/agt/public/js/scriptfuns.js" type="text/javascript"></script>
<script src="/agt/public/js/my_functions.js" type="text/javascript"></script>
<script language="javascript">
//删除试卷的试题
function delTest()
{
    var allItem = document.all.testItem;	
    var selectedCount = 0;
    
    if(allItem == null)
    {
       return false;
    }
    
    if(allItem.checked == true)
    {
        selectedCount = 1;       
    }
    
   
    for(var i=0; i<allItem.length;i++)
    {
        if(allItem[i].checked == true)
        {
            selectedCount = selectedCount + 1;
        }
    }
    if(selectedCount == 0)
    {
        alert("必须先选中一条试题!") ;
        return false ;
    }
       
   for(var i=0;i<allItem.length;i++)
   {
       if(allItem[i].checked==true)
       {
           
           document.all.testTable.deleteRow(i);
           i=i-1;
       }
   }
   
   if(allItem.checked == true)
   {
         document.all.testTable.deleteRow(0);     
         return false; 
   }
   
   //重新设置顺序号
   order();
}

//位置往前的处理
function moveFront()
{
    var selectedCount = 0;
    var allItem = document.epaperform.testItem;

    if(allItem == null)
    {
       return false;
    }
    
    if(allItem.checked == true)
    {
        return false;       
    }
    
    for(var i=0; i<allItem.length;i++)
    {
        if(allItem[i].checked == true)
        {
            selectedCount = selectedCount + 1;
        }
    }
    if(selectedCount == 0)
    {
        alert("必须先选中一条试题!") ;
        return false ;
    }
    if(selectedCount != 1)
    {
        alert("只能对一条试题进行操作!") ;
        return false ;
    }
    if(allItem[0].checked == true)
    {
       alert("不能对第一条试题进行位置往前的操作!");
       return false;
    }
       

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -