|
谁能具体解释一下这段代码所表达的意思?最好能一行行解释
for each element in request.form
for i=1 to request.form(element).count
if instr(element,"NO")<>0 then
id=mid(element,3,3)
result=request.form(element)(i)
sql="select * from exam_database where id="& clng(id)
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
if rs("type")="单选题" then
if result=rs("answer") then
score=score+cint(singleper)
end if
end if
if rs("type")="多选题" then
if instr(rs("answer"),result)<>0 then
score=score+cint(multiper)/4
j=j+1'多选循环
answer=split(rs("answer"),",")
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
(multiper)/4是多选题的少选每答对一题得<%=multiper/4%>分 |
|