<%
Subject=Request("Subject")
Set rs = Server.CreateObject("ADODB.Recordset")
sql="Select * From "&Subject&" order by no"
rs.open sql,conn,2,2
score=0
while not rs.EOF
answer=rs("result")
select case rs("type")
case 1:
selection=Request("Name"&rs("no"))
case 2:
selection=""
for n=1 to 4
if not Request("Name"&rs("no")&"-"&n)="" then
selection=selection&Request("Name"&rs("no")&"-"&n)
end if
next
case 3:
case else:response.write"<b>其他题目还未确定评分规则!</b>"
end select
if answer=selection then
score=score+rs("grade")
end if
rs.movenext
wend
rs.close%>
<table border=1 width="56%">
<tr bgcolor=green><td bgcolor="#FFCCFF">学科</td><td bgcolor="#FFccFF">总分</td>
</tr>
<tr><td><%response.Write Subject%></td><td><%response.Write score%></td></tr>
</table>
最后一句 reponse.write score 为什么不能计算出的分值,只能显示0分