| 发表于:2007-04-02 15:07:035楼 得分:0 |
大家看一下这样写这个函数行吗 <script language= "vbscript "> flag=0 <% timeget=session( "xztime ") response.write( "timegetf= "&timeget) %> timenum=timegetf*60 sub changetime() timenum=timenum-1 timenumf=timenum\60 timenumm=timenum mod 60 if timenumf <10 and timenumm=10 and flag <2 then msgbox( "在线考试系统提示你只剩下 "&timenumf& "分钟!请抓紧时间! ") flag=flag+1 elseif timenumf <5 and timenumm=10 and flag <5 then msgbox( "在线考试系统提示你只剩下 "&timenumf& "分钟!请准备提交试卷! ") flag=flag+1 elseif timenum=0 and timenumf=0 and timenumm=0 then msgbox( "在线考试系统提示你时间到,请交卷! ") window.location.href( "ns_exam_result.asp ") end if window.status= "在线考试系统提示你的时间还剩 "&timenumf& "分 "&timenumm& "秒 " settimeout "changetime ",1000 end sub </script> 然后那个答题页面里面 <body onload= "changetime() "> <form action= "ns_exam_result.asp " method= "post " name= "form1 " id= "form1 "> ... <input type= "submit " name= "submit " value= "交卷 "> </form> 现在我的情况是:不管考生是不是点击交卷了,只要时间一到就自动点击“交卷”这个提交按钮 | | |
|