* 编号:A0014
* 功能:随机抽题组成试卷表 设置本次考试范围: 1,仅考A类的 2,难中易比例为1:2:1 3,题目为40题 先在“A类”-“难”中抽10题 再在“A类”-“中”中抽20题 再在“A类”-“易”中抽10题 假设你的表中有字段:知识点(字符型)、难易程度(字符型)等 生成试题的按钮的Click事件: rand(-1) ****开始抽“A类”-“难” 10题 select * into cursor t1 from 题目表 where alltrim(知识点)== 'A类 ' and alltrim(难易程度)== '难 ' select t1 J=reccount() J=reccount() for I=1 to 10 lnRecno=INT(J*RAND()+1) go lnRecno if !deleted() delete else I=I-1 Endif Endfor ****开始抽“A类”-“中” 20题 select * into cursor t2 from 题目表 where alltrim(知识点)== 'A类 ' and alltrim(难易程度)== '中 ' select t2 J=reccount() for I=1 to 20 lnRecno=INT(J*RAND()+1) go lnRecno if !deleted() delete else I=I-1 endif endfor ****开始抽“A类”-“易” 10题 |
|