📄 复件 test.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<script language=javascript>
function btnadd()
{
window.navigate("testadd.asp");
}
function btnedit()
{
if ((document.form1.pd.value=="") || (document.form1.xz.value=="") || (document.form1.tk.value==""))
{alert("你提交的为空记录!");
document.form1.pd.focus();
return false;}
if ((document.form1.pd.value!="" )&&(document.form1.pds.value=="" ))
{alert("数据不全!");
document.form1.pds.focus();
return false;}
if ((document.form1.xz.value!="" )&&(document.form1.xzs.value=="" ))
{alert("数据不全!");
document.form1.xzs.focus();
return false;}
if ((document.form1.tk.value!="" )&&(document.form1.tks.value=="" ))
{alert("数据不全!");
document.form1.tks.focus();
return false;}
if (document.form1.time.value=="")
{alert("请输入考试时间");
document.form1.time.focus();
return false;
}
if (document.form1.time.value!="")
{if (isNaN(document.form1.ttime.value))
{alert("请输入数字!");
document.form1.ttime.focus();
return false;
}
}
document.form1.ctype.value="edit";
document.form1.submit();
}
</script>
<%flag=0
flags=0
sqlfind="select * from test order by examinationid desc"
set rss=conn.execute(sqlfind)
if rss.eof then
flag=1
title="<font color=red> 暂无 </font>"
else
set rs=conn.execute("select * from test order by examinationid desc")
title="第 <font color=red> "&rs("examinationid")&" </font> 期"
end if
if trim(request("ctype"))="edit" then
if request("c1")="on" then
flags=1
sqledit="update test set rightorwrongid="&trim(request("pd"))&",rightorwrongscore="&trim(request("pds"))&",setupdata='"&date()&"',testdata="&trim(request("ttime"))&" where examinationid="&rs("examinationid")
set rsedit=conn.execute(sqledit)
end if
if request("c2")="on" then
flags=1
sqledit="update test set selectid="&trim(request("xz"))&",selectscore="&trim(request("xzs"))&",setupdata='"&date()&"',testdata="&trim(request("ttime"))&" where examinationid="&rs("examinationid")
set rsedit=conn.execute(sqledit)
end if
if request("c3")="on" then
flags=1
sqledit="update test set fillingid="&trim(request("tk"))&",fillingscore="&trim(request("tks"))&",setupdata='"&date()&"',testdata="&trim(request("ttime"))&" where examinationid="&rs("examinationid")
set rsedit=conn.execute(sqledit)
end if
sqledit="update test set setupdata='"&date()&"',testdata="&trim(request("ttime"))&" where examinationid="&rs("examinationid")
set rsedit=conn.execute(sqledit)
flags=1
if flags=1 then
%>
<script language=javascript>
alert ("修改成功!");
now=new Date();
window.navigate("test.asp?time="+now.getTime());
</script>
<%else%>
<script language=javascript>
alert ("请选择要修改项!");
</script>
<%end if
end if %>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上考试系统</title>
<link rel="stylesheet" type="text/css" href="../css.css">
</head>
<body topmargin="0" leftmargin="0">
<p>
<p align="center"><font face="隶书" size="6" >试卷管理理</font></p>
<div align="center">
<center>
<form name=form1 action="">
<input type="hidden" name="ctype" >
<table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="400">
<tr>
<td align="center" colspan="4"><%=title%> 考卷设置(最新一期的)</td>
</tr>
<tr>
<td align="center" bgcolor="#000080"><font color="#FFFFFF">编号</font></td>
<td align="center" bgcolor="#000080"><font color="#FFFFFF">数目</font></td>
<td align="center" bgcolor="#000080"><font color="#FFFFFF">分数</font></td>
<td align="center" bgcolor="#000080"><font color="#FFFFFF">修改</font></td>
</tr>
<%if flag=1 then%>
<tr>
<td align=center colspan="4"><font color=red>暂无考卷设置信息</font></td></tr>
<%else%>
<tr>
<td align="center">判断题</td>
<td align="center"> <input type="text" name="pd" size="5" class="line" value=<%=rs("rightorwrongid")%>></td>
<td align="center">
<input type="text" name="pds" size="5" class="line" value=<%=rs("rightorwrongscore")%>></td>
<td align="center">
<input type="checkbox" name="C1" value="on"></td>
</tr>
<tr>
<td align="center" bgcolor="#EFEFF7">选择题</td>
<td bgcolor="#EFEFF7" align="center">
<input type="text" name="xz" size="5" class="line" value=<%=rs("selectid")%>></td>
<td align="center" bgcolor="#EFEFF7">
<input type="text" name="xzs" size="5" class="line" value=<%=rs("selectscore")%>></td>
<td align="center" bgcolor="#EFEFF7">
<input type="checkbox" name="C2" value="on"></td>
</tr>
<tr>
<td align="center">填空题</td>
<td align="center">
<input type="text" name="tk" size="5" class="line" value="<%=rs("fillingid")%>"></td>
<td align="center">
<input type="text" name="tks" size="5" class="line" value=<%=rs("fillingscore")%>></td>
<td align="center">
<input type="checkbox" name="C3" value="on"></td>
</tr>
<tr>
<td colspan="4" align="center">
</td>
</tr>
<%end if %>
<tr>
<td colspan="4" align="center">
<input type="button" value="增加" name="B1" onclick="btnadd()" style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF">
<%if flag=0 then%>
<input type="button" value="修改" name="B1" onclick="btnedit()" style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF">
<input type="reset" value="重置" name="B2" style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF">
<%end if %></td>
</tr>
</table>
</form>
</center>
</div>
<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="400">
<%while not rss.eof %>
<tr>
<td>◆ 第 <%=rss("examinationid")%> 期(判断题 <%=rss("rightorwrongid")%> 道/ <%=rss("rightorwrongscore")%> 分,选择题 <%=rss("selectid")%> 道/ <%=rss("selectscore")%> 分,填空题 <%=rss("fillingid")%> 道/ <%=rss("fillingscore")%> 分)</td>
</tr>
<%rss.movenext
wend%>
</table>
</center>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -