📄 testmodquestion.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import="com.huawei.icd30.agt.code.*" %>
<%@ include file="/agt/public/jsp/TestModMenuTop.jsp" %>
<!-- title>业务代表管理系统录入试题</title -->
<br>
<form name="addtestform" method="POST" enctype="multipart/form-data" action="/servlet/com.huawei.icd30.agt.testman.TestModManServlet">
<table width="539" border="0" cellpadding="3" cellspacing="1" class="table-cs1">
<tr >
<td width="15%" align="center" class="td-cs1">试题题型</td>
<td width="85%" class="td-cs1"> <input name ="typeName" type="text" disabled class="input3" value="<%=request.getAttribute("typeName")%>" size="20">
<input type="hidden" name ="testType" value="<%=request.getAttribute("testType")%>">
</td>
</tr>
<input type="hidden" name="testId" value="<%=request.getAttribute("testId")%>">
<input type="hidden" name="content" value="">
<input type="hidden" name="optionRs" value="">
<input type="hidden" name="option" value="">
<input type="hidden" name="explain" value="">
<input type="hidden" name="degree" value="">
<input type="hidden" name="classId" value="<%=request.getAttribute("classId")%>">
<input type="hidden" name="testMeans" value="">
<input type="hidden" name="useLevel" value="">
<input type="hidden" name="referenceTime" value="">
<input type="hidden" name="queryTerm" value="<%=request.getParameter("queryTerm")%>">
<input type="hidden" name="byClass" value="1">
<tr align="center">
<td colspan="2" class="td-cs1">试题内容*</td>
</tr>
<tr>
<td colspan="2" class="td-cs2">
<%@ include file="../public/editor/editor.html" %> </td>
</tr>
</table>
<table id="optionTable" width="539" border="0" cellpadding="3" cellspacing="1" class="table-cs1">
<tr>
<td width="15%" height="25" align="center" class="td-cs1">试题答案*</td>
<td width="85%" class="td-cs2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="39%">(行数)
<input name="rowCount" type="text" class="input1" value="1" size="3" maxlength="3">
</td>
<td width="61%"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20%"><input name="add3" type="image" onClick="addOption();return false;" src="/agt/public/images/add3.gif" width="48" height="25" border="0" onMouseOver="this.src='/agt/public/images/'+ this.name + '_2.gif';" onMouseOut="this.src='/agt/public/images/'+ this.name + '.gif'"></td>
<td width="80%"><input name="del3" type="image" onClick="delOption();return false;" src="/agt/public/images/del3.gif" width="48" height="25" 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></td>
</tr>
<%
String testOption = (String)request.getAttribute("testOption");
String result = (String)request.getAttribute("result");
StringTokenizer stoken = new StringTokenizer(testOption,"#");
StringTokenizer resultStoken = new StringTokenizer(result,"#");
int loc = 0;
while(stoken.hasMoreTokens())
{
String row = stoken.nextToken();
%>
<tr>
<td height="25" align="center" class="td-cs1"> </td>
<td class="td-cs2">
<textarea name="optionRsDis" cols="45" rows="<%=row%>" class="remark"><%=resultStoken.nextToken()%></textarea>
<input type="hidden" name="optionDis" value="<%=row%>">
<%if(loc != 0 ){%> <input type="checkbox" name="optionCB" id="optionCB"> <%}%>
</tr>
<%
loc++;
}%>
</table>
<table width="539" border="0" cellpadding="3" cellspacing="1" class="table-cs1">
<tr>
<td align="center" class="td-cs1">简要说明</td>
<td colspan="3" class="td-cs2"> <textarea name="explainDis" cols="45" rows="2" class="remark"><%=request.getAttribute("explain")%></textarea></td>
</tr>
<tr>
<td width="15%" align="center" class="td-cs1">试题难度</td>
<td width="35%" class="td-cs2"> <select name="degreeDis" class="input3">
<% SysResultSet degreeRs = TestGetInfo.getDegreeRs();
String degree = (String)request.getAttribute("degree");
if(degreeRs != null)
{ for(int i=0;degreeRs.setRecord(i)&&i<degreeRs.getMetaData().getRecordCount();i++)
{
%>
<option value="<%=degreeRs.getString(0)%>" <%if( degree.equalsIgnoreCase(degreeRs.getString(0))){%> selected <%}%> ><%=degreeRs.getString(1)%></option>
<% }
}
%>
</select> </td>
<td width="15%" align="center" class="td-cs1">所属类别*</td>
<td width="35%" class="td-cs2">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="56%"><input name="className" type="text" class="input1" value="<%=ClassInfo.get((String)request.getAttribute("classId"))%>" size="18" readonly></td>
<td width="44%"><input name="choise" type="image" onClick="openClassWindow('/ClsMngOperatorAction.do?operatorFlag=<%=OperatorFlagCode.CLSMNG_CHOOSE%>&select=01','选择类别');return false;" src="/agt/public/images/choise.gif" width="48" height="25" 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>
<tr>
<td align="center" class="td-cs1">测试手段</td>
<td class="td-cs2"> <select name="testMeansDis" class="input3">
<% SysResultSet meansRs = TestGetInfo.getMeansRs();
String testMeans = (String)request.getAttribute("testMeans");
if(meansRs != null)
{ for(int i=0;meansRs.setRecord(i)&&i<meansRs.getMetaData().getRecordCount();i++)
{
%>
<option value="<%=meansRs.getString(0)%>" <%if( testMeans.equalsIgnoreCase(meansRs.getString(0))){%> selected <%}%>><%=meansRs.getString(1)%></option>
<% }
}
%>
</select></td>
<td align="center" class="td-cs1">答题参考时间</td>
<td class="td-cs2" > <input name="referenceTimeDis" type="text" class="input1" value="<%=request.getAttribute("referenceTime")%>" size="18" maxlength="25">
分钟</td>
</tr>
<td align="center" class="td-cs1">使用级别</td>
<td colspan="3" class="td-cs2"> <select name="useLevelDis" class="input3">
<%String useLevel = (String)request.getAttribute("useLevel");
%>
<option value="0" <%if("0".equalsIgnoreCase(useLevel)){%> selected <%}%>>常用</option>
<option value="1" <%if("1".equalsIgnoreCase(useLevel)){%> selected <%}%>>专用</option>
<option value="2" <%if("2".equalsIgnoreCase(useLevel)){%> selected <%}%>>暂不使用</option>
</select></td>
</tr>
</table>
<table width="539" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="35" align="center"> <table width="44%" height="25" border="0" cellpadding="0" cellspacing="0">
<tr align="left">
<td width="50%"><input name="submit" type="image" onClick="checkSubmit();return false;" src="/agt/public/images/submit.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="50%"><input name="reset" type="image" onclick="resetForm();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>
</tr>
</table></td>
</tr>
</table>
</form>
<form name="changetypeform" method="POST">
<input type="hidden" name="testType" value="">
</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 checkSubmit()
{
var hcontent = Composition.document.body.innerHTML;
if(trim(hcontent)=="")
{
alert("试题内容不能为空,请输入!");
return false;
}
if(hcontent.length >= 500)
{
alert("试题内容长度不能超过500个字符,输入已超过限制长度,请重新输入!")
return false;
}
var explain = document.addtestform.explainDis;
if(explain.value.length >= 250)
{
alert("试题简要说明不能超过250个字符,输入已超过限制长度,请重新输入!")
explain.focus();
return false;
}
var optionRsDis = document.addtestform.optionRsDis;
if(!(optionRsDis.length>1))
{//只有一个答案项
if(optionRsDis.value == null || trim(optionRsDis.value)=="")
{
alert("试题的答案项不能为空,请输入!");
optionRsDis.focus();
return false;
}
}
else
{
for(var i=0;i<optionRsDis.length;i++)
{
if(optionRsDis[i]== null || trim(optionRsDis[i].value)=="")
{
alert("试题的答案项不能为空,请输入!");
optionRsDis[i].focus();
return false;
}
}
}
var classId = document.addtestform.classId;
if(classId== null || trim(classId.value)=="")
{
alert("试题的所属类别不能为空,请输入!");
return false;
}
document.addtestform.content.value = hcontent;
//由于在include文件editor.html之后,取不到参数的值,所以做了如下的处理
var option=document.addtestform.option;
var optionRs = document.addtestform.optionRs;
var optionDis = document.addtestform.optionDis;
if(!(optionRsDis.length>1))
{//只有一个答案项
option.value = optionDis.value;
optionRs.value = optionRsDis.value;
}
else
{
option.value = optionDis[0].value;
optionRs.value = optionRsDis[0].value;
for(var i=1;i<optionRsDis.length;i++)
{
option.value = option.value + "#" + optionDis[i].value;
optionRs.value = optionRs.value + "#" + optionRsDis[i].value;
}
}
document.addtestform.explain.value = document.addtestform.explainDis.value;
document.addtestform.degree.value = document.addtestform.degreeDis.value;
document.addtestform.testMeans.value = document.addtestform.testMeansDis.value;
document.addtestform.useLevel.value = document.addtestform.useLevelDis.value;
document.addtestform.referenceTime.value = document.addtestform.referenceTimeDis.value
document.addtestform.submit();
}
function addOption()
{
var rowCount = document.all.addtestform.rowCount;
if(rowCount.value)
if(rowCount == null || rowCount.value == "")
{
alert("增加试题答案输入项所指定的行数不能为空,请输入!");
rowCount.focus();
return false;
}
if( !isNumber(rowCount.value) || rowCount.value > 999 || rowCount.value == 0)
{
alert("增加试题答案输入项所指定的行数输入不正确,请重新输入!");
rowCount.focus();
return false;
}
var row = document.all.optionTable.insertRow();
var cell=row.insertCell();
cell.innerHTML=' ';
cell.className="td-cs1";
var cell1=row.insertCell();
cell1.className="td-cs2";
cell1.innerHTML='<textarea class="remark" rows="'+ rowCount.value + '" name="optionRsDis" cols="45"></textarea> <input type="hidden" name="optionDis" value="'+ rowCount.value +'"> <input type="checkbox" name="optionCB" id="optionCB">';
}
function delOption()
{
var allOptionCB = document.all.optionCB;
var loc=0;
if(allOptionCB == null)
{
return false;
}
if(allOptionCB.checked == true)
{
document.all.optionTable.deleteRow(2);
}
for(var i=0;i<allOptionCB.length;i++)
{
if(allOptionCB[i].checked==true)
{
loc = i+2;
document.all.optionTable.deleteRow(loc);
i=i-1;
}
}
}
///:huangyuyuan modify 2004-06-26
//对编辑器里面的文件进行编码,把"\"修改为"\\",这样编辑器就不会把反斜杠认为是转义字符了
var oldContent = '<%=OperateUtility.convertStr(StringCode.editCode((String)request.getAttribute("content")))%>' ;
///:~
function resetForm()
{
document.addtestform.reset();
Composition.document.body.innerHTML=oldContent;
}
/**
* body.onload()调用此脚本作必要的预处理.
**/
function docPreload()
{
InitDocument();
// 需把"'"转为"\'".
Composition.document.body.innerHTML = oldContent ;
}
</script>
<%@ include file="/agt/public/jsp/haveMenuBot.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -