?? epaperedit.jsp
字號:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ include file="/agt/public/jsp/top.jsp" %>
<!-- title>培訓(xùn)考試系統(tǒng)編輯試卷頁面</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">總分數(shù)*
</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:試題內(nèi)容,8:試題選項,2:試題分數(shù),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"> <%=rs.getString(3)%> (
<input type="text" name="testScores" size="2" value="<%=rs.getString(2)%>" class="input1-2">
分) (<%=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;
}
//重新設(shè)置順序號
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;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -