📄 result.asp
字号:
<link href="../Style.css" rel="stylesheet" type="text/css">
<!--#include file="conn2.asp"-->
<%
subject= request("subject")
'session("testid")=request("testid")
'response.write(testid)
testid=request("testid")
singlecount=request("singlecount")
singleper=request("singleper")
multicount=request("multicount")
multiper=request("multiper")
judgecount=request("judgecount")
judgeper=request("judgeper")
userid=request.Cookies("stu_num")
'response.Write(userid)
starttime=request("mystarttime")
endtime=time()
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,3)
result=request.form(element)(i)
sql="select * from "&subject&" where id="& clng(id)
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
if rs("try_type")="2" then
if rs("try_key")=result then
score=score+cint(singleper)
end if
end if
if rs("try_type")="3" then
if instr(rs("try_key"),result)<>0 then
score=score+cint(multiper)/4
j=j+1
answer=split(rs("try_key"),",")
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
if rs("try_type")="1" then
if rs("try_key")=result then
score=score+cint(judgeper)
end if
end if
end if
next
next
sql="select * from score1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
rs.addnew
rs("stu_num")=userid
rs("stu_name")=request.cookies("stu_name")
rs("subject")=subject
rs("testid")=testid
rs("starttime")=starttime
rs("endtime")=endtime
rs("score")=score
rs.update
rs.close
querysql="select * from test_rec where testid="&testid& " and stu_num=" & userid
set rs=server.createobject("adodb.recordset")
'set rs1=conn.execute(querysql)
rs.open querysql,conn,3,2
'response.Write(rs1("testid"))
'response.End()
'do while not rs.eof
rs("tested")=1
rs.update
'rs.movenext
'loop
'rs1("tested")=1
'rs1.update
rs.close
response.redirect "displayresult.asp?stu_num=" & userid & "&testid=" & testid
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -