📄 testaddeditor.jsp
字号:
<%@ page contentType="text/html;charset=gb2312"%>
<%@ include file="/agt/public/jsp/top.jsp" %>
<%
String testType = request.getParameter("testType");
int testTypeInt = 0;
if(testType != null)
{
testTypeInt = Integer.parseInt(testType.trim());
}
%>
<%if("1".equalsIgnoreCase(request.getParameter("success")))
{
%>
<font color="#000000">已成功录入上一题,请录入下一题: </font>
<%}%>
<form name="addtestform" method="POST" enctype="multipart/form-data" action="/servlet/com.huawei.icd30.agt.testman.TestAddManServlet">
<table width="500" border="0" cellpadding="3" cellspacing="1" class="table-cs1">
<tr>
<td align="center" class="td-cs1">试题题型</td>
<td colspan="3" class="td-cs1"> <select name="testType" size="1" class="input3" onchange="changeType(this.value)">
<% SysResultSet typeRs = TestGetInfo.getTestTypeRs();
if(typeRs != null)
{ for(int i=0;typeRs.setRecord(i)&&i<typeRs.getMetaData().getRecordCount();i++)
{
%>
<option value="<%=typeRs.getString(0)%>" <%if(testTypeInt == typeRs.getInt(0)){%> selected <%}%>><%=typeRs.getString(1)%></option>
<% }
}
%>
</select> </td>
</tr>
<input type="hidden" name="content" value="">
<input type="hidden" name="opeType" value="<%=OperatorFlagCode.TEST_ADD%>">
<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="">
<input type="hidden" name="testMeans" value="">
<input type="hidden" name="useLevel" value="">
<input type="hidden" name="referenceTime" value="">
<input type="hidden" name="byClass" value="1">
<tr align="center">
<td colspan="4" class="td-cs1">试题内容*</td>
</tr>
<tr>
<td class="remark" colspan="4"> <%@ include file="../public/editor/editor.html" %></td>
</tr>
<tr>
<td align="center" class="td-cs1">试题选项*</td>
<td colspan="3" class="td-cs2">
<input type="radio" value="A" checked name="optionRsDis">
<input name="optionDis" type="text" class="input1" value="正确" size="43" maxlength="450"></td>
</tr>
<tr>
<td align="center" class="td-cs1"> </td>
<td colspan="3" class="td-cs2">
<input type="radio" value="B" name="optionRsDis">
<input name="optionDis" type="text" class="input1" value="错误" size="43" maxlength="450"></td>
</tr>
<tr>
<td align="center" class="td-cs1">简要说明</td>
<td colspan="3" class="td-cs2"> <textarea name="explainDis" cols="55" rows="5" class="remark"></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();
if(degreeRs != null)
{ for(int i=0;degreeRs.setRecord(i)&&i<degreeRs.getMetaData().getRecordCount();i++)
{
%>
<option value="<%=degreeRs.getString(0)%>"><%=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" 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();
if(meansRs != null)
{ for(int i=0;meansRs.setRecord(i)&&i<meansRs.getMetaData().getRecordCount();i++)
{
%>
<option value="<%=meansRs.getString(0)%>"><%=meansRs.getString(1)%></option>
<% }
}
%>
</select></td>
<td align="center" class="td-cs1">答题参考时间</td>
<td class="td-cs2" > <input name="referenceTimeDis" type="text" class="input1" size="18" maxlength="25">
分钟</td>
</tr>
<td align="center" class="td-cs1">使用级别</td>
<td colspan="3" class="td-cs2"> <select name="useLevelDis" class="input3">
<option value="0">常用</option>
<option value="1">专用</option>
<option value="2">暂不使用</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 option = document.addtestform.optionDis;
if(option[0]== null || trim(option[0].value)=="")
{
alert("试题的选项不能为空,请输入!");
option[0].focus();
return false;
}
if(option[1]== null || trim(option[1].value)=="")
{
alert("试题的选项不能为空,请输入!");
option[1].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 optionRsDis = document.addtestform.optionRsDis;
if(optionRsDis[0].checked == true)
{
document.addtestform.optionRs.value = optionRsDis[0].value;
}
else
{
document.addtestform.optionRs.value = optionRsDis[1].value;
}
document.addtestform.option.value = document.addtestform.optionDis[0].value + "#"
+ document.addtestform.optionDis[1].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 changeType(value)
{
document.changetypeform.testType.value =value;
<%
if(typeRs != null)
{ for(int i=0;typeRs.setRecord(i)&&i<typeRs.getMetaData().getRecordCount();i++)
{
%>
if(value == "<%=typeRs.getString(0)%>")
{
document.changetypeform.action = "<%=typeRs.getString(2)%>";
}
<% }
}
%>
document.changetypeform.submit();
}
function resetForm()
{
document.addtestform.reset();
Composition.document.body.innerHTML="";
}
document.addtestform.testType.focus();
</script>
<%@ include file="/agt/public/jsp/bot.jsp" %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -