4.2.2在线考试 考生登陆考试系统时,系统根据登录名和密码判断考生是否为报名后的考生,如果没有报名则提示考生先注册,注册完成后需要管理员审核考生是否符合条件,审核通过后考生才能参加考试。 copyright paper51.com 考生登录后,可以选择相应的试题进行在线考试。考试过程中考生的答案保存在考试过程控制表(prj_process)中。自动生成试卷函数根据考试计划中的设置,从试题库中随机按要求组成试卷并存入考试过程控制表(prj_process)中。 内容来自论文无忧网 www.paper51.com 考试结束采取自动交卷和到了规定的时间系统强制交卷的有机结合的方式予以实现。系统根据管理员制定好的答案进行判断,自动给出考生的考试成绩。 http://www.paper51.com 在线考试主要页面有function.asp,考试页面testing.asp,保存答案页面test_saveanswer.asp,考试结束显示结果页面testfinish.asp,成绩查询页面student_markquery.asp . 内容来自www.paper51.com
自动生成试卷的主要代码片段如下: http://www.paper51.com '生成试卷 paper51.com function makePaper(intPrjID,intStudentID) 内容来自www.paper51.com dimrsPaper,strSqlPaper,rsNew,strSqlNew,intCourseID,intCount,arrTemp,intSSCount,arrSS,intMSCount,arrMS,intBCount,arrB,intCurType,I,J,intPos,blnPass copyright paper51.com
G_CONN.execute"delete from prj_process where prjid=" & intPrjID & "and studentid=" & intStudentID http://www.paper51.com setrsPaper = server.createobject("ADODB.Recordset") copyright paper51.com strSqlPaper= "select courseid,ss_count,ms_count,b_count from project whereprjid=" & intPrjID 内容来自www.paper51.com rsPaper.openstrSqlPaper,G_CONN,1,1 paper51.com ifnot rsPaper.bof and not rsPaper.eof then 内容来自www.paper51.com intCourseID= rsPaper("courseid") paper51.com intSSCount= rsPaper("ss_count") http://www.paper51.com intMSCount= rsPaper("ms_count") http://www.paper51.com intBCount= rsPaper("b_count") copyright paper51.com else 内容来自www.paper51.com rsPaper.close http://www.paper51.com
setrsPaper = nothing 内容来自www.paper51.com
makePaper= false http://www.paper51.com exitfunction paper51.com endif 内容来自论文无忧网 www.paper51.com rsPaper.close copyright paper51.com
forintCurType = 1 to 3 copyright paper51.com selectcase intCurType 内容来自论文无忧网 www.paper51.com case1 内容来自论文无忧网 www.paper51.com intCount= intSSCount copyright paper51.com case2 paper51.com intCount= intMSCount paper51.com case3 内容来自论文无忧网 www.paper51.com
intCount= intBCount http://www.paper51.com endselect paper51.com ifintCount > 0 then paper51.com redimarrTemp(intCount) 内容来自www.paper51.com strSqlPaper= "select id from subject where type=" & intCurType & "and courseid=" & intCourseID 内容来自论文无忧网 www.paper51.com rsPaper.openstrSqlPaper,G_CONN,1,1 内容来自论文无忧网 www.paper51.com ifrsPaper.recordcount < intCount then '判断当前题库内试题是否足够 paper51.com rsPaper.close http://www.paper51.com
setrsPaper = nothing http://www.paper51.com makePaper= false http://www.paper51.com exitfunction 内容来自论文无忧网 www.paper51.com endif 内容来自www.paper51.com randomizetimer http://www.paper51.com intPos= int(rnd() * rsPaper.recordcount) copyright paper51.com arrTemp(1)= intPos http://www.paper51.com forI = 2 to intCount paper51.com intPos= int(rnd() * rsPaper.recordcount) 内容来自论文无忧网 www.paper51.com blnPass= false copyright paper51.com whileblnPass = false 内容来自www.paper51.com
forJ = 1 to I - 1 copyright paper51.com ifintPos = arrTemp(J) then 内容来自www.paper51.com exitfor http://www.paper51.com endif 内容来自论文无忧网 www.paper51.com next 内容来自www.paper51.com if J = Ithen 内容来自www.paper51.com
blnPass= true http://www.paper51.com
else http://www.paper51.com '使用线性探测解决冲突问题 paper51.com intPos= intPos + 1 copyright paper51.com ifintPos = rsPaper.recordcount then 内容来自www.paper51.com
intPos= 0 paper51.com
endif paper51.com endif 内容来自www.paper51.com wend http://www.paper51.com arrTemp(I)= intPos copyright paper51.com next copyright paper51.com strSqlNew= "select * from prj_process" 内容来自论文无忧网 www.paper51.com setrsNew = server.createobject("ADODB.Recordset") 内容来自论文无忧网 www.paper51.com rsNew.openstrSqlNew,G_CONN,1,3 http://www.paper51.com forI = 1 to intCount paper51.com rsPaper.movearrTemp(I),1 http://www.paper51.com
rsNew.addnew 内容来自www.paper51.com rsNew("prjid")= intPrjID http://www.paper51.com rsNew("subid")= rsPaper("id") paper51.com
rsNew("studentid")= intStudentID 内容来自www.paper51.com rsNew.update copyright paper51.com
next copyright paper51.com rsNew.close 内容来自www.paper51.com rsPaper.close 内容来自论文无忧网 www.paper51.com endif 内容来自www.paper51.com next paper51.com
G_CONN.execute"update prj_student set state=2" 内容来自论文无忧网 www.paper51.com G_CONN.execute"update prj_student set starttime=now()" 内容来自www.paper51.com setrsPaper = nothing 内容来自论文无忧网 www.paper51.com makePaper= true paper51.com end function 内容来自www.paper51.com
|