📄 edittest.asp
字号:
<!--#include file="Check.asp"-->
<!--#include file="Conn.asp"-->
<%
TestID=request("TestID")
set oRs=server.createobject("adodb.recordset")
Sql="select * from TestName where TestID="&TestID
set oRs=server.createobject("adodb.recordset")
oRs.open sql,conn,1,1
if oRs.eof then
Response.Write "<script language=Javascript>alert('错误:该类不存在或已经被删除,\n请重新选择。谢谢!"&TestID&"');history.go(-1);</script>"
Response.End
else
Subject=Trim(oRs("Subject"))
Types=Trim(oRs("Types"))
DataID=Trim(oRs("DataID"))
Intro=Trim(oRs("Intro"))
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>试卷基本信息_修改</title>
<script language="javascript">
function submitit(MyForm)
{
<%If Types=3 Then%>
if (MyForm.List2.length==0){alert("请选择题目!");return false;}
for (i=0;i<(MyForm.List2.length);i++)
{
MyForm.List2.options.item(i).selected=true;
}
<%End If%>
result="确认无误?"
if (confirm(result))
{
MyForm.action="EditTestOK.asp";
MyForm.Types.disabled=false;
return true;
}
else
return false;
}
sortitems = 1; // Automatically sort items within lists? (1 or 0)
function move(fbox,tbox) {
for(var i=0; i<fbox.options.length; i++) {
if(fbox.options[i].selected && fbox.options[i].value != "") {
var no = new Option();
no.value = fbox.options[i].value;
no.text = fbox.options[i].text;
tbox.options[tbox.options.length] = no;
fbox.options[i].value = "";
fbox.options[i].text = "";
}
}
BumpUp(fbox);
if (sortitems) SortD(tbox);
}
function BumpUp(box) {
for(var i=0; i<box.options.length; i++) {
if(box.options[i].value == "") {
for(var j=i; j<box.options.length-1; j++) {
box.options[j].value = box.options[j+1].value;
box.options[j].text = box.options[j+1].text;
}
var ln = i;
break;
}
}
if(ln < box.options.length) {
box.options.length -= 1;
BumpUp(box);
}
}
function SortD(box) {
var temp_opts = new Array();
var temp = new Object();
for(var i=0; i<box.options.length; i++) {
temp_opts[i] = box.options[i];
}
for(var x=0; x<temp_opts.length-1; x++) {
for(var y=(x+1); y<temp_opts.length; y++) {
if(temp_opts[x].text > temp_opts[y].text) {
temp = temp_opts[x].text;
temp_opts[x].text = temp_opts[y].text;
temp_opts[y].text = temp;
temp = temp_opts[x].value;
temp_opts[x].value = temp_opts[y].value;
temp_opts[y].value = temp;
}
}
}
for(var i=0; i<box.options.length; i++) {
box.options[i].value = temp_opts[i].value;
box.options[i].text = temp_opts[i].text;
}
}
</script>
<link rel="stylesheet" type="text/css" href="css.css">
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
body {
background-color: #B1DB99;
}
-->
</style></head>
<body>
<table width="100%" height="18" cellspacing="1" bordercolor="#C0C0C0" bgcolor="#D9ECFF" id="AutoNumber2" style="border-collapse: collapse">
<tr>
<td width="100%" background="../images/Down_bg.gif"> ★ <strong>当前位置: <font color="#FF0000">修改自测题</font></strong></td>
</tr>
</table>
<br>
<table border="1" cellpadding="0" cellspacing="1" style="border-collapse: collapse" id="AutoNumber1" width="100%" bordercolor="#C0C0C0">
<form method="POST" name="MyForm" action="EditTestOK.asp" onSubmit="return submitit(MyForm);">
<tr height="20">
<td height="25" colspan="4" bgcolor="#D9ECFF"> <p align="center"><font color="#666666"><strong>试卷基本信息</strong></font></td>
</tr>
<tr height="20">
<td width="128" style="font-size: 9pt; color: #000000" bgcolor="#EEF7FF">
<p align="center"><b>选择类别</b></td>
<td style="font-size: 9pt; color: #000000"> <select size="1" name="subject" onChange="Javascript:document.MyForm.TestName.focus();">
<option selected>--选择类别--</option>
<% sql="select TestSubject from TestSubject"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof
Subjects=Trim(rs(0))
If Subject=Subjects Then
s="Selected"
Else
s=""
End if
%>
<option value="<%=Subjects%>" <%=s%>><%=Subjects%></option>
<% rs.movenext
loop
rs.close %>
</select> <input type=hidden name=TestID value="<%=TestID%>">
<td><p align="center"><b>填入标题:</b></p></td>
<td align=center><input type=text name=TestName size="18" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" value="<%=Trim(oRs("TestName"))%>">
</td>
</tr>
<tr align="center" height="20">
<td colspan="4" bgcolor="#D9ECFF"><font color="#666666"><b>试卷说明</b></font></td>
</tr>
<tr height="20">
<td bgcolor="#F4FAFF"> <p align="center"><b>试卷说明:</b></td>
<td colspan="3" > <textarea name="Intro" cols="60" rows="6" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()" ><%=Intro%></textarea></td>
</tr>
<tr height="20">
<td colspan="4" bgcolor="#D9ECFF"> <p align="center"><font color="#666666"><strong>试卷信息</strong></font></td>
</tr>
<tr height="20">
<td align="center" bgcolor="#EEF7FF"><b>卷面总分(<font color="#FF0000">分</font>)</b></td>
<td colspan="3"> <p align="left">
<input type="text" name="TotalResult" size="20" value="<%=oRs("TotalResult")%>" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()">
</td>
</tr>
<tr bgcolor="#D9ECFF" height="20">
<td align="center"><font color="#666666"><strong> </strong></font></td>
<td> <p align="center"><font color="#666666"><strong>单选题</strong></font></td>
<td> <p align="center"><font color="#666666"><strong>多选题</strong></font></td>
<td> <p align="center"><font color="#666666"><strong>判断题</strong></font></td>
</tr>
<tr height="20">
<td align="center" bgcolor="#EEF7FF"><b>题型分布(<font color="#FF0000">个</font>)</b></td>
<td> <p align="center">
<input type="text" name="CountA" size="12" value="<%=oRs("CountA")%>" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()">
</td>
<td> <p align="center">
<input type="text" name="CountB" size="12" value="<%=oRs("CountB")%>" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()">
</td>
<td> <p align="center">
<input type="text" name="CountC" size="12" value="<%=oRs("CountC")%>" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()">
</td>
</tr>
<tr height="20">
<td align="center" bgcolor="#EEF7FF"><b>分值分布(<font color="#FF0000">分</font>)</b></td>
<td> <p align="center">
<input type="text" name="ResultA" size="12" value="<%=oRs("ResultA")%>" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()">
</td>
<td> <p align="center">
<input type="text" name="ResultB" size="12" value="<%=oRs("ResultB")%>" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()">
</td>
<td> <p align="center">
<input type="text" name="ResultC" size="12" value="<%=oRs("ResultC")%>" class="inputnormal" onBlur="this.className='inputnormal'" onFocus="this.className='inputedit';this.select()">
</td>
</tr>
<tr height="20">
<td align="center" bgcolor="#EEF7FF"><b>选题方式</b></td>
<td colspan=3>
<select name=Types disabled=1>
<option value=1 <%If Types=1 then Response.Write "Selected"%>>最新题目方式</option>
<option value=2 <%If Types=2 then Response.Write "Selected"%>>随机选择方式</option>
<option value=3 <%If Types=3 then Response.Write "Selected"%>>自由组合方式</option>
</select> </td>
</tr>
<%If Types=3 then%>
<tr>
<td width="100%" colspan="5">
<table border="0">
<tr>
<td><select multiple size="10" name="List1">
<%
Sql="Select ID,Question,Type from TestTopic where Subject='"&Subject&"' and ID not in ( " & DataID & " )"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
i=0
while Not rs.eof
i=i+1
Question=Trim(rs(1))
L=Len(Question)
T=12
If L>T Then
Question=Left(Question,T)&"("& rs(2) &").."
Else
Question=Question&"("& rs(2) &")"
End If
Response.Write "<option value='"& rs(0) &"'>"& i &"."& Question &"</option>"
rs.MoveNext
Wend
rs.close()
Set rs=Nothing
%>
</select></td>
<td>
<input type="button" value=" >> " onClick="move(this.form.List1,this.form.List2)" name="B1" class="b2"><br><BR>
<input type="button" value=" << " onClick="move(this.form.List2,this.form.List1)" name="B2" class="b2">
</td>
<td><select multiple size="10" name="List2">
<%
Sql="Select ID,Question,Type from TestTopic where Subject='"&Subject&"' and ID in ( " & DataID & " )"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
i=0+i
while Not rs.eof
i=i+1
Question=Trim(rs(1))
L=Len(Question)
T=12
If L>T Then
Question=Left(Question,T)&"("& rs(2) &").."
Else
Question=Question&"("& rs(2) &")"
End If
Response.Write "<option value='"& rs(0) &"'>"& i &"."& Question &"</option>"
rs.MoveNext
Wend
rs.close()
Set rs=Nothing
%>
</select></td>
</tr>
</table>
</td>
</tr>
<%End If%>
<tr align="right" height="20">
<td colspan="4" bgcolor="#D9ECFF"> <font color="#666666"><strong>
<input type="submit" value=" 修改 " name="B1" class="b2">
</strong></font></td>
</tr>
</form>
</table>
</body>
</html>
<%
End If
oRs.close
set oRs=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -