如何设计与实现当前网上考试系统(3)
2012-08-28 21:54
〈form method=“POST" action=“result.asp"〉?
〈%?
i=1?
rs.movefirst?
do while not(rs.eof)%〉?
〈%=i%〉??
〈%=rs(“question")%〉?
〈br〉〈hr〉?
〈table border=“O" width=“100%"〉?
〈tr〉?
〈td width=”50%"〉〈input type=radio name=ans〈%=i%〉value=”a"〉A〈%=rs(“a")%〉〈/td〉
〈td width=“50%"〉〈input type=radio name=ans〈%=i%〉value=”b"〉B〈%=rs(“b")%〉〈/td〉
〈/tr〉?
〈tr〉?
〈td width=”50%”〉〈input type=radio name=ans〈%=i%〉 value=”c”〉C〈%=rs(“c”)%〈/td〉?
〈td width=”50%"〉〈input type=radio name=ans〈%=i%〉value=”d"〉D〈%=rs(“d")%〉〈/td〉
〈/tr〉?
〈/table〉?
〈%?
i=i+1?
rs.movenext?
loop?
%〉?
〈input type=”submit" name=”submit1" value=”交卷"〉?
〈input type=”reset" name=”reset1" value=“重做"〉?
〈/form〉
〈/body〉?
〈/html〉?
评分源代码 result.asp 如下:?
〈%@ language=vbscript%〉??
〈%?
set rs=server.createobject(“adodb.recorbset”)?
set conn=server.createobje
ct(“adodb.connection")?
connser=”excise"?
conn.open connstr?
sql=”select ans from test"?
set rs=conn.execute(sql)?
correct=0?
count=0?
do while not rs.eof?
count=count+1?
if request.form(count)=rs(“ans") then?
correct=correct+1?
end if?
rs.movenext?
loop?
scores=correct/count*100?
response.write“你的成绩是:"&scores?
sql=”update user set score=”&scores& where user='”&session(“user")&"'"?
conn.execute(sql)?
%〉
如何设计与实现当前网上考试系统(3).doc
将本文的Word文档下载到电脑
下载失败或者文档不完整,请联系客服人员解决!