如何做考场编排
如何做考场编排,两个考点,一个考点又有汉授考生、有蒙授考生,蒙汉不在一个考场考试,但汉在前考场数,蒙在后考场数。每个考场30人,同班考生无领近。
** ksxxb 考生信息表 ** kmdm 科目代码 ** xh 学号 *!* zkzh 准考证号 *!* bj 班级(可以用班号代替) *!* kch 考场号 整数 *!* zwh 座位号 整数(1-30) ** SELECT distinct kmdm,COUNT(*) as kmrs FROM ksxxb INTO CURSOR kmtj ORDER BY kmdm asc && 如果BM大的在前用 desc 代替 ASC FOR i=1 TO RECCOUNT('kmtj') SELECT kmtj GO i ckmdm=ALLTRIM(kmdm) nkcs= INT(kmrs,30) nfb=MOD(kmrs,30) &&非标考场人数 SELECT bj,COUNT(*) as bjrs FROM ksxxb GROUP by bj ORDER BY bjrs DESC INTO CURSOR bjtmp FOR ibjs=1 TO RECCOUNT('bjtmp') SELECT bjtmp GO ibjs cbj=ALLTRIM(bj) cbjrs=PADL(ALLTRIM(STR(bjrs)),3,'0') SELECT ksxxb REPLACE zkzh WITH cbjrs FOR ALLTRIM(bj)==cbj AND kmdm=ckmdm ENDFOR SELECT zkzh,xh,kch,zwh FROM ksxxb INTO CURSOR zkztmp WHERE kmdm=ckmdm ORDER BY zkzh desc,bj READWRITE SELECT zkztmp GO 1 FOR j=1 TO nfb FOR k=1 TO nkcs+1 REPLACE kch WITH k,zwh WITH j skip ENDFOR ENDFOR FOR j=nfb+1 TO 30 FOR k=1 TO nkcs REPLACE kch WITH k,zwh WITH j skip ENDFOR ENDFOR SELECT zkztmp REPLACE zkzh WITH ckmdm +PADL(ALLTRIM(STR(kch)),3,'0')+PADL(ALLTRIM(STR(zwh)),2,'0') all irecc=RECCOUNT() FOR j=1 TO irecc SELECT zkztmp GO j cxh=ALLTRIM(xh) czkzh=zkzh ikch=kch izwh=zwh SELECT ksxxb LOCATE FOR ALLTRIM(xh)==cxh IF FOUND() REPLACE zkzh WITH czkzh,kch WITH ikch,zwh WITH izwh ELSE =MESSAGEBOX('程序出错!') ENDIF ENDFOR ENDFOR
[此贴子已经被作者于2019-4-20 10:43编辑过]