发新话题
打印

aw中怎么显示试题啊?

本主题由 auth 于 2008-5-15 13:36 移动

aw中怎么显示试题啊?

读取试题总数:
SQLString:="select count(*) from singlechoice"
total:=ODBCExecute(ODBChandle,SQLString)
随机读取试题:
i:=1
repeat while i<11
tihao:=Random(1,total,1)
SQLString:="update score set singletihao='"^tihao^"'where score.bianhao="^i
huida:=ODBCExecute(ODBChandle,SQLString)
i:=i+1
end repeat
SQLString:="select distinct timu from singlechoice where singlechoice.tihao='tihao'"
xtimu:=ODBCExecute(ODBChandle,SQLString)
SQLString:="select distinct A from singlechoice where singlechoice.tihao='tihao'"
aa:=ODBCExecute(ODBChandle,SQLString)
SQLString:="select distinct B from singlechoice where singlechoice.tihao='tihao'"
bb:=ODBCExecute(ODBChandle,SQLString)
SQLString:="select distinct C from singlechoice where singlechoice.tihao='tihao'"
cc:=ODBCExecute(ODBChandle,SQLString)
SQLString:="select distinct D from singlechoice where singlechoice.tihao='tihao'"
dd:=ODBCExecute(ODBChandle,SQLString)
SQLString:="select distinct answer from singlechoice where singlechoice.tihao='tihao'"
rightanswer:=ODBCExecute(ODBChandle,SQLString)
其中singlechoice 是单项选择题表,包括tihao,timu,A,B,C,D,answer几列,score是计分表,在显示图标中写{timu},{A}等等,运行时显示不出来,麻烦熟悉Authorware的人看一下我的代码有什么问题,如果最终我要实现随机出题,并统计分数应该怎么写

TOP

变量tihao连接有误,随机出题不完善~~~

TOP

乱乱的,不是我喜欢的代码格式

SQLString:="select distinct timu from singlechoice where tihao='"^tihao^"';"

SQL语句和查询语句应该在循环体内
不用列表变量会很复杂

[[i] 本帖最后由 auth 于 2008-5-15 23:00 编辑 [/i]]
『海复教育网』http://www.hfzedu.cn『锐意工作室』  http://www.royidea.cn
接受毕业设计制作、光盘制作业务。

TOP

呵呵,是挺乱的,我改了下题目是出来了,但是不会设计评分的功能了?哪位高手帮忙指点,万分感谢!

TOP

发新话题