一个关于用Authorware制作考试系统的问题
我用Authorware和Access作考试系统,运行总是不能显示出试题。源代码如下:创建数据源:dbRegType:=4dbType:="MicrosoftAccess...
我用Authorware和Access作考试系统,运行总是不能显示出试题。
源代码如下:
创建数据源:
dbRegType:=4
dbType:="Microsoft Access Driver (*.mdb)"
dbList:="DSN=test info;"
dbList:=dbList^"Description=试题库;"
dbList:=dbList^"FIL=MS Access;"
dbList:=dbList^"DBQ="^"D:\\test\\test.mdb"
result:=tMsDBRegister(dbRegType, dbType, dbList)
打开数据源:
DatabaseName:="test info"
odbcError:=""
ODBChandle:=ODBCOpen(WindowHandle,odbcError,DatabaseName,"","")
读取试题总数:
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的人看一下我的代码有什么问题,如果最终我要实现随机出题,并统计分数应该怎么写,毕业设计的一部分,急啊,谢谢大家了! 展开
源代码如下:
创建数据源:
dbRegType:=4
dbType:="Microsoft Access Driver (*.mdb)"
dbList:="DSN=test info;"
dbList:=dbList^"Description=试题库;"
dbList:=dbList^"FIL=MS Access;"
dbList:=dbList^"DBQ="^"D:\\test\\test.mdb"
result:=tMsDBRegister(dbRegType, dbType, dbList)
打开数据源:
DatabaseName:="test info"
odbcError:=""
ODBChandle:=ODBCOpen(WindowHandle,odbcError,DatabaseName,"","")
读取试题总数:
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的人看一下我的代码有什么问题,如果最终我要实现随机出题,并统计分数应该怎么写,毕业设计的一部分,急啊,谢谢大家了! 展开
2个回答
展开全部
本文将通过实例进行讲解,帮助你逐步掌握用Authorware制作考试程序整个流程。这里要求你对Authorware有相当的了解,因为本文要用到较多Authorware的函数,而且不对用Authorware制作的细节做详细讲解。下面进入正题,我们实例讲解一个“初级中学微机考试系统”制作过程,这个作品运行后的界面如图1、图2、图3所示。
参考资料: http://www.moon-soft.com/doc/15028.htm
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询