考试题的得分出错

scwaho 2019-04-29 10:49:27
一个题干,可以有1—5个空可填。第1小题有5个空填写,第2小题有4个空,出现计分错误。

现象:当第1小题5个答案全部正确时,统计得分,从第2小题以后会多加一次第1小题的1/5得分。



求助大侠们指点!

<div align="center">
<center>
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td bgcolor="#66CCFF"><font class=test2>五、看图题(共 <%=request("ypic")%> 道,每题 <%=request("ypics")%> 公里)</td>
</tr>

<%if request("flagypic")=1 then
%><tr><td><%=request("messageypic")%></td></tr>
<%else


for i=1 to request("ypic")
'为每个小题
'IF rst("问题1")<> "" THEN
tid1=request("thypic1"&i)

set rst=conn.execute("select * from type5 where id="&tid1)
cp1=rst("错频1")
'end if

IF rst("问题2")<> "" THEN

tid2=request("thypic2"&i)

set rst=conn.execute("select * from type5 where id="&tid2)
cp2=rst("错频2")
end if

IF rst("问题3")<> "" THEN

tid3=request("thypic3"&i)

set rst=conn.execute("select * from type5 where id="&tid3)
cp3=rst("错频3")

end if
'IF request("问题4")<> "" THEN
IF rst("问题4")<> "" THEN
tid4=request("thypic4"&i)

set rst=conn.execute("select * from type5 where id="&tid4)
cp4=rst("错频4")
'response.write "公里"&tid4&"kkk"&cp4&")"
end if

'此句为测试句
'response.write "tid4的值:"&tid4&" 错频4的值:"&cp4&")"
'

' IF request("问题5")<> "" THEN
IF rst("问题5")<> "" THEN
tid5=request("thypic5"&i)

set rst=conn.execute("select * from type5 where id="&tid5)
cp5=rst("错频5")
end if

%>
<tr>
<td><font class=test3>  <%=i%>.<%=rst("题干")%>  <%=rst("问题1")%>  <%=rst("问题2")%>  <%=rst("问题3")%>  <%=rst("问题4")%>  <%=rst("问题5")%>
<p font class=test3>


<%
n=0
IF rst("问题1")<> "" THEN
n=n+1
end if

IF rst("问题2")<> "" THEN
n=n+1
end if
' response.write "公里"&tid2&"kkk"&n&")"
IF rst("问题3")<> "" THEN
n=n+1
end if
'response.write "公里"&tid3&"kkk"&n&")"
IF rst("问题4")<> "" THEN
n=n+1
end if
'response.write "公里"&tid4&"kkk"&n&")"
IF rst("问题5")<> "" THEN
n=n+1
end if

'response.write "公里"&tid5&"kkk"&n&")"

IF rst("正确答案1")<> "" THEN
if trim(request("tp"&i))=rst("正确答案1") then


fncolor="#FF0000"
df=request("ypics")
df1=round(df/n,1)
response.write "<font color="&fncolor&">(答案1:"&rst("正确答案1")&"   批阅:√   里程:"&df1&"公里)</font>"

else
fncolor="#0000FF"
cp1=cp1+1
df1=0


response.write "<font color="&fncolor&">(参考1:"&rst("正确答案1")&"  提交:"&request("tp"&i)&"  批阅:×   里程:"&df1&"公里)</font>"

'response.write "公里"&tid&"kkk"&cp1&")"

conn.execute "update type5 set 错频1="&cp1&" where id="&tid1
end if '测试
end if

IF rst("正确答案2")<> "" THEN

if trim(request("tp2"&i))=rst("正确答案2") then


fncolor="#FF0000"
df=request("ypics")
df2=round(df/n,1)
response.write "<font color="&fncolor&">(答案2:"&rst("正确答案2")&"   批阅:√   里程:"&df2&"公里)</font>"

else
fncolor="#0000FF"

cp2=cp2+1
df2=0
response.write "<font color="&fncolor&">(参考2:"&rst("正确答案2")&"  提交:"&request("tp2"&i)&"  批阅:×   里程:"&df2&"公里)</font>"

conn.execute "update type5 set 错频2="&cp2&" where id="&tid2
end if
end if


IF rst("正确答案3")<> "" THEN

if trim(request("tp3"&i))=rst("正确答案3") then


fncolor="#FF0000"
df=request("ypics")
df3=round(df/n,1)
response.write "<font color="&fncolor&">(答案3:"&rst("正确答案3")&"   批阅:√   里程:"&df3&"公里)</font>"

else
fncolor="#0000FF"
cp3=cp3+1

df3=0
response.write "<font color="&fncolor&">(参考3:"&rst("正确答案3")&"  提交:"&request("tp3"&i)&"  批阅:×   里程:"&df3&"公里)</font>"

conn.execute "update type5 set 错频3="&cp3&" where id="&tid3
end if
end if

IF rst("正确答案4")<> "" THEN
'补充一图5题中的第4空和第5空,20190417
if trim(request("tp4"&i))=rst("正确答案4") then


fncolor="#FF0000"
df=request("ypics")
df4=round(df/n,1)
response.write "<font color="&fncolor&">(答案4:"&rst("正确答案4")&"   批阅:√   里程:"&df4&"公里)</font>"

else
fncolor="#0000FF"

cp4=cp4+1
df4=0
response.write "<font color="&fncolor&">(参考4:"&rst("正确答案4")&"  提交:"&request("tp4"&i)&"  批阅:×   里程:"&df4&"公里)</font>"


'此句为测试句
'response.write "tid4的值:"&tid4&" 错频4的值:"&cp4&")"
'


conn.execute "update type5 set 错频4="&cp4&" where id="&tid4
end if
end if

IF rst("正确答案5")<> "" THEN
'补充一图5题中的第5空,20190417
if trim(request("tp5"&i))=rst("正确答案5") then


fncolor="#FF0000"
df=request("ypics")
' df5=FormatNumber(df/n,1)
df5=Round(df/n,1)
response.write "<font color="&fncolor&">(答案5:"&rst("正确答案5")&"   批阅:√   里程:"&df5&"公里)</font>"

else
fncolor="#0000FF"

cp5=cp5+1
df5=0
response.write "<font color="&fncolor&">(参考5:"&rst("正确答案5")&"  提交:"&request("tp5"&i)&"  批阅:×   里程:"&df5&"公里)</font>"

conn.execute "update type5 set 错频5="&cp5&" where id="&tid5
end if
else

end if
'此句为测试句
response.write "小题总分的值:"&df1+df2+df3+df4+df5&" 错频5的值:"&cp5&")"
'


zfenypic=zfenypic+(df1+df2+df3+df4+df5)

next


%>
</p>
</tr>

<tr>
<td align="right">
<b><font color="#FF0000">看图题小计里程:<%=zfenypic%>公里</font></b></td>
</tr>
<%end if %>
</table>
</center>
</div>
...全文
104 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧