|
|
|
@ -132,8 +132,9 @@
|
|
|
|
|
</header>
|
|
|
|
|
|
|
|
|
|
<div class="mui-content mui-scroll-wrapper">
|
|
|
|
|
<div style="margin-left: 10px;margin-top: 10px;"><span class="mui-icon-extra mui-icon-extra-outline"
|
|
|
|
|
id="time">123</span></div>
|
|
|
|
|
<div style="margin-left: 10px;margin-top: 10px;"><span
|
|
|
|
|
class="mui-icon-extra mui-icon-extra-outline"></span>考试剩余时间:<span id="time"
|
|
|
|
|
style="color: red;font-weight: bold;"></span></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mui-card" id="examinfo"></div>
|
|
|
|
@ -198,11 +199,56 @@
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/getRemainSecond",
|
|
|
|
|
async: false,
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
var remainSecond = res.remainSecond;
|
|
|
|
|
|
|
|
|
|
if (remainSecond > 0) {
|
|
|
|
|
var timer = new easytimer.Timer();
|
|
|
|
|
timer.start({ countdown: true, startValues: { seconds: remainSecond } });
|
|
|
|
|
|
|
|
|
|
$('#time').html(timer.getTimeValues().toString());
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
timer.addEventListener('secondsUpdated', function (e) {
|
|
|
|
|
$('#time').html(timer.getTimeValues().toString());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
timer.addEventListener('targetAchieved', function (e) {
|
|
|
|
|
mui.alert('考试时间已到,将自动提交!', '提示', function () {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/jiaoJuan",
|
|
|
|
|
type: 'POST',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
window.location = "./result.html";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (remainSecond == 0) {
|
|
|
|
|
mui.alert('考试时间已到,将自动提交!', '提示', function () {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/jiaoJuan",
|
|
|
|
|
type: 'POST',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
window.location = "./result.html";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else if (remainSecond == -1) {
|
|
|
|
|
mui.alert('您的考试已完成,无需重复考试!', '提示', function () {
|
|
|
|
|
window.location = "./result.html";
|
|
|
|
|
});
|
|
|
|
|
} else if (remainSecond == -2) {
|
|
|
|
|
window.location = "./login.html";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -250,7 +296,7 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 侧边栏对象
|
|
|
|
@ -384,18 +430,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var timer = new easytimer.Timer();
|
|
|
|
|
timer.start({ countdown: true, startValues: { seconds: 30 } });
|
|
|
|
|
|
|
|
|
|
$('#time').html(timer.getTimeValues().toString());
|
|
|
|
|
|
|
|
|
|
timer.addEventListener('secondsUpdated', function (e) {
|
|
|
|
|
$('#time').html(timer.getTimeValues().toString());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
timer.addEventListener('targetAchieved', function (e) {
|
|
|
|
|
$('#time').html('KABOOM!!');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|