|
|
|
@ -195,18 +195,15 @@
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
var orderId = 1;
|
|
|
|
|
if ($.cookie('order_id')) {
|
|
|
|
|
orderId = $.cookie('order_id');
|
|
|
|
|
} else {
|
|
|
|
|
$.cookie('order_id', orderId, { path: '/' });
|
|
|
|
|
if (!$.cookie('order_id')) {
|
|
|
|
|
$.cookie('order_id', 1, { path: '/' });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取一共有多少道题
|
|
|
|
|
var queCount = getExamInfo();
|
|
|
|
|
|
|
|
|
|
//获取题的信息
|
|
|
|
|
getQuestionInfo(orderId);
|
|
|
|
|
getQuestionInfo();
|
|
|
|
|
|
|
|
|
|
//获取答题卡信息
|
|
|
|
|
getAnswerSheet();
|
|
|
|
@ -235,10 +232,10 @@
|
|
|
|
|
mui.confirm(message, '确认交卷', btnArray, function (e) {
|
|
|
|
|
if (e.index == 1) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/jiaoJuan",
|
|
|
|
|
url: "/FengHuang/exam/jiaoJuan",
|
|
|
|
|
type: 'POST',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
window.location = "./result.html";
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -262,31 +259,39 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.getElementById("next").addEventListener("tap", function () {
|
|
|
|
|
var orderId = $.cookie('order_id');
|
|
|
|
|
if (orderId < queCount) {
|
|
|
|
|
orderId++;
|
|
|
|
|
$.cookie('order_id', orderId, { path: '/' });
|
|
|
|
|
getQuestionInfo(orderId);
|
|
|
|
|
getQuestionInfo();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.getElementById("previous").addEventListener("tap", function () {
|
|
|
|
|
var orderId = $.cookie('order_id');
|
|
|
|
|
if (orderId > 1) {
|
|
|
|
|
orderId--;
|
|
|
|
|
$.cookie('order_id', orderId, { path: '/' });
|
|
|
|
|
getQuestionInfo(orderId);
|
|
|
|
|
getQuestionInfo();
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mui(".mui-content").on("tap", "a", function () {
|
|
|
|
|
orderId = this.textContent;
|
|
|
|
|
getQuestionInfo(this.textContent);
|
|
|
|
|
$.cookie('order_id', this.textContent, { path: '/' });
|
|
|
|
|
getQuestionInfo();
|
|
|
|
|
offCanvasWrapper.offCanvas('close');
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据题号获取题的信息
|
|
|
|
|
function getQuestionInfo(orderId) {
|
|
|
|
|
function getQuestionInfo() {
|
|
|
|
|
var orderId = 0;
|
|
|
|
|
if ($.cookie('order_id')) {
|
|
|
|
|
orderId = $.cookie('order_id');
|
|
|
|
|
} else {
|
|
|
|
|
orderId = 1;
|
|
|
|
|
}
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/getQuestion?order_id=" + orderId,
|
|
|
|
|
async: false,
|
|
|
|
@ -305,8 +310,6 @@
|
|
|
|
|
reply += this.value;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log(orderId)
|
|
|
|
|
console.log(reply)
|
|
|
|
|
saveReply(orderId, reply);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -315,9 +318,15 @@
|
|
|
|
|
$('input[type="radio"]').on('change', function () {
|
|
|
|
|
// 获取选中的radio元素的值
|
|
|
|
|
var reply = $(this).val();
|
|
|
|
|
console.log(orderId)
|
|
|
|
|
console.log('选中的值为:' + reply);
|
|
|
|
|
saveReply(orderId, reply);
|
|
|
|
|
setTimeout(function () {
|
|
|
|
|
|
|
|
|
|
orderId++;
|
|
|
|
|
console.log(orderId);
|
|
|
|
|
$.cookie('order_id', orderId, { path: '/' });
|
|
|
|
|
getQuestionInfo(orderId);
|
|
|
|
|
}, 500);
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|