另三个考生步入考试后倒计时未有再度计时

复制代码 代码如下:function getCookie {
var offset,cookieValue; var search=name+”=”;
if(document.cookie.length>0) { offset=document.cookie.indexOf; if {
offset += search.length; end = document.cookie.indexOf; if end =
document.cookie.length; cookieValue=unescape(document.cookie.substring;
} } return cookieValue; } //name表示cookie的键的名字

另三个考生步入考试后倒计时未有再度计时。 开始考试时开始计时,点击提交答案按钮后,另一个考生进入考试后倒计时没有重新计时,怎么办? www.js8331.com,20C
var ksTime; //定义考试时间以分钟计算 ksTime = 60;//设置时间
这里设置为0.1代表是6秒,测试用 if(readCookie==””){ setCookie(“ss”,new
Date(),ksTime/60); } function sT(){ var tti = new Date(); var lt =
parseInt((tti-new Date(readCookie/1000) if((ksTime*60-lt)<0){
setCookie(“ss”,new Date; alert(“考试时间到!n即将提交试卷!”);
document.forms[0].submit(); }else{ lm = Math.floor; ls = lt % 60; allY
= ksTime*60-lt; ym = Math.floor(allY / 60); ys = allY % 60;
document.getElementById.innerHTML = “考试已经开始了” + lm + “分” + ls +
“秒” + “,剩余” + ym + “分” + ys + “秒”; var ttt = setTimeout”,1000); } }
function readCookie { var cookieValue = “”; var search = name + “=”;
if(document.cookie.length > 0) { offset = document.cookie.indexOf; if
(offset != -1) { offset += search.length; end =
document.cookie.indexOf(“;”, offset); if (end == -1) end =
document.cookie.length; cookieValue = document.cookie.substring(offset,
end) } } return cookieValue; } function setCookie(name, value, hours) {
var expire = “”; if(hours != null) { expire = new Date((new
Date.getTime() + hours * 3600000); expire = “; expires=” +
expire.toGMTString(); } document.cookie = name + “=” + value + expire;
}

发表评论

电子邮件地址不会被公开。 必填项已用*标注