[分享]给大家贴一个随机出题的代码

hyjia hyjia 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
大家还有什么好的方法,贴出来看看.

response.Write "一.单选题("&numtype1&"个×"&marktype1&"分)<br/>"
i=0
j=0
dim tarray(20)
sql="select * from 试题 where 类型=1"
rs.open sql,conn,1,1


'response.End()
'''''''''''''''''''''''''''''''''''''''''''''实现不重复出题的关键代码''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''2006-4-30 16:56
while(numtype1>0)
randomize
a=int(maxtype1*rnd+1)
doublequ=0
rs.movefirst
rs.move a
for each qu in tarray
if qu=rs("编号") then
doublequ=1
exit for
end if
next
if doublequ=0 then
response.Write j+1&") "&rs("题目")&"<br/>"
tarray(j)=rs("编号")
j=j+1
numtype1=numtype1-1
end if
'rs.movefirst
wend
'''''''''''''''''''''''''''''''''''''''''''''''hyjia''''''''''''''''''''''''''''''''''''''''''''
rs.close
...全文
评论 2
收藏 已收藏
分享
返回顶部
hyjia
ASP 28,401 成员 356,940 内容