📄 result.asp
字号:
<%response.buffer="true"%>
<HTML>
<HEAD>
<TITLE><%=title%></TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<link rel="stylesheet" type="text/css" href="css/index1.css">
<link rel="stylesheet" type="text/css" href="css/toolbar2.css">
<META content="Microsoft FrontPage 4.0" name=GENERATOR>
<base target="_self">
</HEAD>
<BODY background="image/A-bg.gif" leftMargin=0 topMargin=0>
<%chapterid=trim(request("chapterid"))
num=trim(request("num"))
j=num
order=trim(request("order"))
for i=1 to j
if request.form("ans"&i)="" then
Response.Write "<center><font color='#FF0000'>"&"第"&i&"题没有填写"&"</font></center><br>"
Response.Write "<center><a href='javascript:window.history.go(-1);'>返回</a></center>"
Response.End
end if
next%>
<TABLE align=center border=0 cellPadding=0 cellSpacing=0 class=c width=764 height="35">
<tr>
<td height="13" width="223" valign="middle" align="center">现在位置:<font face="华文行楷" size="4"><a href="index.asp">首页</a>—测验结果</font>
</td>
<td height="245" width="3" valign="middle" align="center" rowspan="3" bgcolor="#000000">
<td height="13" width="630" valign="middle" align="center"></td>
<tr>
<td height="35" width="223" valign="middle" align="center"></td>
<td height="232" width="630" valign="top" align="left" rowspan="2">
<table border="1" width="90%" align="center" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellspacing="0" cellpadding="5" bgcolor="#A4D1FF" height="81">
<tr>
<td bgcolor="#A4D1FF" height="1" width="100%" align="center" colspan="4">
<font color="#FF0000">本次测验结果</font>
</td>
</tr>
<tr>
<td bgcolor="#EFF3FF" height="1" width="22%" align="center">
<font color="#FF0000">『题目编号』</font>
</td>
<td bgcolor="#EFF3FF" height="1" width="26%" align="center">
<font color="#FF0000">『你的答案』</font>
</td>
<td bgcolor="#EFF3FF" height="1" width="27%" align="center">
<font color="#FF0000">『正确答案』</font>
</td>
<td bgcolor="#EFF3FF" height="1" width="25%" align="center">
<font color="#FF0000">『题目说明』</font>
</td>
</tr>
<%if chapterid="all" then
sql="select top "&num&" * from test order by "&order&" desc"
else
sql="select top "&num&" * from test where ID="&chapterid&" order by "&order&" desc"
end if
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("CSTUDY.mdb")
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
ycorrect=0
rsCount=0
for i=1 to rs.recordcount
i=1
Do while not rs.eof
rsCount=rsCount+1%>
<tr>
<td bgcolor="#EFF3FF" height="1" width="22%" align="center">
<%=i%>
</td>
<td bgcolor="#EFF3FF" height="1" width="26%" align="center">
<%if Request.Form(i)<>rs("answer") then
Response.Write "<font color='#FF0000'>"&Request.Form(i)&"(错误)"&"</font>"
else
Response.Write Request.Form(i)&"(正确)"
end if%>
</td>
<td bgcolor="#EFF3FF" height="1" width="27%" align="center">
<%Response.Write rs("answer")
if Request.Form(rsCount)=rs("answer") then
ycorrect=ycorrect + 1
end if%>
</td>
<td bgcolor="#EFF3FF" height="1" width="25%" align="center">
<%response.write rs("subject")%>
</td>
</tr>
<%rs.movenext
i=i+1
loop
next%>
<tr>
<td bgcolor="#A4D1FF" height="1" width="100%" align="center" colspan="4">
<font color="#FF0000">你的成绩:</font>
<%score=int(ycorrect/rscount*100)
Response.Write score&"分,"
if score < 60 then Response.Write "你不及格!"
if score >= 60 and score <= 80 then Response.Write "及格"
if score > 80 and score <= 100 then Response.Write "优秀!"%>
</td>
</tr>
</table><br>
</td>
</tr>
<tr>
<td height="197" width="223" valign="top" align="center">
<form method="post" action="test.asp" name="test" onsubmit="return checkdata()">
<select size="1" name="chapter" class="td1">
<option value="">请选择题目所属的章节</option>
<%Set rs1=Server.CreateObject("ADODB.RecordSet")
mySQL = "SELECT * FROM tutorial order by ID"
rs1.Open mySQL,conn,1,1
Do While Not rs1.Eof
response.write "<option value='"&rs1("ID")&"'>"& rs1("rule") & rs1("title")
response.write "</option>"
rs1.movenext
loop
response.write "<option value='all'>"&"全部题目"
response.write "</option>"%>
</select><p>题目数量 <input type="text" name="num" size="4" class="td1" value="5" style="text-align: center;">
题</p>
<p><input type="submit" value="开始答题" name="B1"></p>
</form>
<p>
</td>
</tr>
</table>
</BODY>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -