📄 test.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
flagpd=0
flagxz=0
flagtk=0
randomize
set rss=conn.execute("select * from examination where studentnumber="&session("number")&" and (pass=0 or makeup<>0) order by examinationid desc ")
if rss.eof then
qi=1
else
qi=rss("examinationid")+1
end if
set rss=conn.execute("select * from examination where studentnumber="&session("number")&" and (pass=1 and makeup=0) order by examinationid desc ")
if not rss.eof then
qi=rss("examinationid")
end if
set rss=conn.execute("select * from test order by examinationid desc")
if rss.eof then
%>
<script language=javascript>
alert("请先出题!再进行考试!");
history.back();
</script>
<%
else
pd=rss("rightorwrongid")
pds=rss("rightorwrongscore")
xz=rss("selectid")
xzs=rss("selectscore")
tk=rss("fillingid")
tks=rss("fillingscore")
zf=pd*pds+xz*xzs+tk*tks
testid=rss("examinationid")
set rs=conn.execute("select * from rightorwrong order by rightorwrongid desc")
maxtype1=rs("rightorwrongid")
set rs=conn.execute("select * from selecting order by selectid desc")
maxtype2=rs("selectid")
set rs=conn.execute("select * from filling order by fillingid desc")
maxtype3=rs("fillingid")
sqlfind="select * from examination where examinationid="&testid&" and studentnumber="&session("number")&" and (pass=0 or makeup<>0)"
set rsfind=conn.execute (sqlfind)
if not rsfind.eof then
%>
<script language=javascript>
alert("你已经参加过这次考试了,请等待下一次考试!");
window.navigate("index.asp");
</script>
<%else
set rsfinds=conn.execute("select * from examination where examinationid="&testid&" and studentnumber="&session("number")&" and (pass=1 and makeup=0)")
if not rsfinds.eof then
else
sqlin="insert into examination (examinationid,studentnumber,score) values("&testid&","&session("number")&",0)"
'response.write sqlin
'response.end
set rsin=conn.execute(sqlin)
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">
<!--#include file="top2.htm"-->
<div align="center">
<center>
<form name=form1 action="test_over.asp">
<table border="1" cellpadding="4" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="760" height="100">
<tr>
<td align="center"><font class=test1>第 <%=qi%> 期考试</font>
<input type="hidden" name=qi value=<%=qi%>>
<input type=hidden name=testid value=<%=testid%>>
<br>(本期考试 <%=pd%> 道判断题,<%=xz%> 道选择题,<%=tk%> 道填空题,总分 <%=zf%> 分)<br><br>
<input type=hidden name=pd value=<%=pd%>>
<input type=hidden name=xz value=<%=xz%>>
<input type=hidden name=tk value=<%=tk%>>
<input type=hidden name=zf value=<%=zf%>>
<input type=hidden name=pds value=<%=pds%>>
<input type=hidden name=xzs value=<%=xzs%>>
<input type=hidden name=tks value=<%=tks%>>
<br><font color="#000080">考生姓名:<%=session("student")%> 性别: <%=session("sex")%> 班级:<%=session("classes")%> 学号:<%=session("number")%></font><br>
<br>
<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750">
<tr>
<td bgcolor="#CBEFDC">一、判断题(共 <%=pd%> 道,每题 <%=pds%> 分)</td>
</tr>
<%
if pd=0 then
response.write "<input type=hidden name=messagepd value='本次考无判断题'>"
flagpd=0
%><tr>
<td align=center>本次考无判断题
</td>
</tr>
<%
else
for i=1 to pd
if maxtype1=0 then
response.write "<input type=hidden name=messagepd value='题库里暂无判断题'>"
flagpd=0
%><tr>
<td align=center>题库里暂无判断题
</td>
</tr>
<%
else
randomize
sid=int(maxtype1*rnd+1)
set rst=conn.execute("select * from rightorwrong where rightorwrongid="&sid)
while rst.eof
randomize
sid=int(maxtype1*rnd+1)
set rst=conn.execute("select * from rightorwrong where rightorwrongid="&sid)
wend
%>
<tr>
<td> <%=i%>、<%=rst("question")%>
<input type=hidden name="tgpd<%=i%>" value="<%=rst("question")%>">
<select name="cate<%=i%>" size="1" style="background-color: rgb(224,252,255)">
<option selected value=True>对</option>
<option value=False>错</option></select>
<input type=hidden name="pdda<%=i%>" value="<%=rst("answer")%>">
</td>
</tr>
<%
end if
next
end if %>
</table>
</center>
</div>
<br>
<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750">
<tr>
<td bgcolor="#CBEFDC">一、选择题(共 <%=xz%> 道,每题 <%=xzs%> 分)</td>
</tr>
<%if xz=0 then
response.write "<input type=hidden name=messagepd value='本次考无选择题'>"
flagxz=0
%><tr>
<td align=center>本次考无选择题
</td>
</tr>
<%else
for i=1 to xz
if maxtype2=0 then
response.write "<input type=hidden name=messagepd value='题库里暂无选择题'>"
flagxz=0
%><tr>
<td align=center>题库里暂无选择题
</td>
</tr>
<%else
randomize
sid=int(maxtype2*rnd+1)
set rst=conn.execute("select * from selecting where selectid="&sid)
while rst.eof
randomize
sid=int(maxtype2*rnd+1)
set rst=conn.execute("select * from selecting where selectid="&sid)
wend
%>
<tr>
<td> <%=i%>、<%=rst("question")%>
<input type=hidden name="tgxz<%=i%>" value="<%=rst("question")%>"></td>
</tr>
<tr>
<td>
<input type="radio" value="A" name="sele<%=i%>"> A.<%=rst("result1")%>
<input type=hidden name="xzxx1<%=i%>" value="<%=rst("result1")%>" >
<input type="radio" value="B" name="sele<%=i%>"> B.<%=rst("result2")%>
<input type=hidden name="xzxx2<%=i%>" value="<%=rst("result2")%>" >
<input type="radio" value="C" name="sele<%=i%>"> C.<%=rst("result3")%>
<input type=hidden name="xzxx3<%=i%>" value="<%=rst("result3")%>" >
<input type="radio" value="D" name="sele<%=i%>"> D.<%=rst("result4")%>
<input type=hidden name="xzxx4<%=i%>" value="<%=rst("result4")%>" >
<input type=hidden name="xzda<%=i%>" value="<%=rst("answer")%>" >
</td>
</tr>
<%
end if
next
end if %>
</table>
</center>
</div>
<br>
<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="750">
<tr>
<td bgcolor="#CBEFDC">一、填空题(共 <%=tk%> 道,每题 <%=tks%> 分)</td>
</tr>
<%if tk=0 then
response.write "<input type=hidden name=messagepd value='本次考无填空题'>"
flagtk=0
%><tr>
<td align=center>本次考无填空题
</td>
</tr>
<%else
for i=1 to tk
if maxtype3=0 then
response.write "<input type=hidden name=messagepd value='题库里暂无填空题'>"
flagtk=0
%><tr>
<td align=center>题库里暂无填空题
</td>
</tr>
<%else
randomize
sid=int(maxtype3*rnd+1)
set rst=conn.execute("select * from filling where fillingid="&sid)
while rst.eof
randomize
sid=int((maxtype3+1)*rnd+1)
set rst=conn.execute("select * from filling where fillingid="&sid)
wend
%>
<tr>
<td> <%=i%>、<%=rst("question")%>
<input type=hidden name="tgtk<%=i%>" value="<%=rst("question")%>">
您的答案:<input type="text" name="T<%=i%>" size="20" class="line"></td>
<input type="hidden" name="tkda<%=i%>" value="<%=rst("answer")%>">
</tr>
<%
end if
next
end if %>
</table>
</center>
</div>
<br>
<input type="submit" value="提交" name="B1" 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">
<p>
<br>
</td>
</tr>
</table>
</form>
</center>
</div>
</body>
</html>
<%end if %>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -