求高手帮忙看看代码哪里错了!
<!--#include file="conn.asp"--><%
if session("adminlogin")="" then
Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
subject=request("科目")
singlecount=request("单选数目")
singleper=request("单选分值")
multicount=request("多选数目")
multiper=request("多选分值")
score=0
j=0
for each element in request.form
for i=1 to request.form(element).count
if instr(element,"NO")<>0 then
id=mid(element,3,1)
result=request.form(element)(i)
sql="select * from 题库 where id="& clng(id)
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
if rs("type")="单选题" then
if result=rs("正确答案") then
score=score+cint(singleper)
end if
end if
if rs("type")="多选题" then
if instr(rs("正确答案"),result)<>0 then
score=score+cint(multiper)/4
j=j+1
answer=split(rs("正确答案"),",")
answercount=ubound(answer)+1
if answercount=j then
score=score+cint(multiper)*(1-j/4)
end if
else
score=score-cint(multiper)/4*(j)
end if
end if
end if
next
next
sql="select * from 成绩表"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
rs.addnew
rs("userid")=userid
rs("学号")=request.cookies("学号")
rs("姓名")=request.cookies("姓名")
rs(" & session("subject") & ")=score
rs.update
rs.close
sql="select * from 考试记录"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
rs("学号")=request.cookies("学号")
rs("姓名")=request.cookies("姓名")
rs(" & session("subject") & ")=1
rs.update
rs.close
%>