|
@@ -102,39 +102,67 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|
examing: function () {
|
|
examing: function () {
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
var countdownTime = Config.timer; // 倒计时时间,单位为秒
|
|
var countdownTime = Config.timer; // 倒计时时间,单位为秒
|
|
|
|
+ var countdownTime1 = 600; // 10分钟倒计时时间,单位为秒
|
|
var display = $('#timer');
|
|
var display = $('#timer');
|
|
var fenzhong = 0;
|
|
var fenzhong = 0;
|
|
var timer = setInterval(function() {
|
|
var timer = setInterval(function() {
|
|
var minutes = parseInt(countdownTime / 60, 10);
|
|
var minutes = parseInt(countdownTime / 60, 10);
|
|
var seconds = parseInt(countdownTime % 60, 10);
|
|
var seconds = parseInt(countdownTime % 60, 10);
|
|
-
|
|
|
|
- minutes = minutes < 10 ? "0" + minutes : minutes;
|
|
|
|
- seconds = seconds < 10 ? "0" + seconds : seconds;
|
|
|
|
-
|
|
|
|
|
|
+ // minutes = minutes < 10 ? "0" + minutes : minutes;
|
|
|
|
+ // seconds = seconds < 10 ? "0" + seconds : seconds;
|
|
display.text(minutes + "分" + seconds+'秒');
|
|
display.text(minutes + "分" + seconds+'秒');
|
|
-
|
|
|
|
// console.log(minutes.replace("0-",''));
|
|
// console.log(minutes.replace("0-",''));
|
|
// console.log(parseInt(minutes.replace("0-",'')));
|
|
// console.log(parseInt(minutes.replace("0-",'')));
|
|
if (--countdownTime < 0) {
|
|
if (--countdownTime < 0) {
|
|
- // clearInterval(timer);
|
|
|
|
- $(".djs").html('已到考试结束时间,10分钟内系统自动交卷。')
|
|
|
|
- // display.text("时间到!");
|
|
|
|
- }
|
|
|
|
- if(minutes<1){
|
|
|
|
- fenzhong = parseInt(minutes.replace("0-",''));
|
|
|
|
- console.log(fenzhong);
|
|
|
|
- if(fenzhong==7){
|
|
|
|
- $('#update-form').submit();
|
|
|
|
- clearInterval(timer);
|
|
|
|
- }
|
|
|
|
|
|
+ // $(".djs").html('已经超时,10分钟00秒后系统自动交卷。');
|
|
|
|
+ $.ajax({
|
|
|
|
+ url: "student/collection/countdown/ids/"+Config.ids,
|
|
|
|
+ type: 'post',
|
|
|
|
+ data: {},
|
|
|
|
+ success: function (data) {
|
|
|
|
+ if(data.code==1){
|
|
|
|
+ console.log(data.msg);
|
|
|
|
+ $(".djs").html(data.msg);
|
|
|
|
+ if(data.msg==0){
|
|
|
|
+ $('#update-form').submit();
|
|
|
|
+ clearInterval(timer);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(data.code==0){
|
|
|
|
+ Layer.alert(data.msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ // setTimeout(function() {
|
|
|
|
+ // var minutes1 = parseInt(countdownTime1 / 60, 10);
|
|
|
|
+ // var seconds1 = parseInt(countdownTime1 % 60, 10);
|
|
|
|
+ // $(".djs").html('已经超时,'+minutes1 + "分" + seconds1 +'秒后系统自动交卷。');
|
|
|
|
+ // if (--countdownTime1>0) {
|
|
|
|
+ // var minutes2 = parseInt(countdownTime1 / 60, 10);
|
|
|
|
+ // var seconds2 = parseInt(countdownTime1 % 60, 10);
|
|
|
|
+ // $(".djs").html('已经超时,'+minutes2 + "分" + seconds2 +'秒后系统自动交卷。');
|
|
|
|
+ // console.log(minutes2+'@@@@'+seconds2);
|
|
|
|
+ // if(minutes2==0 && seconds2==1){
|
|
|
|
+ // $('#update-form').submit();
|
|
|
|
+ // clearInterval(timer);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // }, 1000); // 第二个定时器2秒后执行
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+ // if(minutes<1){
|
|
|
|
+ // fenzhong = parseInt(minutes.replace("0-",''));
|
|
|
|
+ // console.log(fenzhong);
|
|
|
|
+ // if(fenzhong==7){
|
|
|
|
+ // $('#update-form').submit();
|
|
|
|
+ // clearInterval(timer);
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
}, 1000);
|
|
}, 1000);
|
|
|
|
|
|
//五秒刷新,同步更换件列表数据
|
|
//五秒刷新,同步更换件列表数据
|
|
if(Config.isloading==1 && countdownTime>0){
|
|
if(Config.isloading==1 && countdownTime>0){
|
|
setInterval(function() {
|
|
setInterval(function() {
|
|
- window.location.reload();
|
|
|
|
|
|
+ window.location.reload();
|
|
}, 30000);
|
|
}, 30000);
|
|
}
|
|
}
|
|
|
|
|