|
|
|
@ -27,7 +27,7 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.mui-content-padded a {
|
|
|
|
|
margin: 10px;
|
|
|
|
|
margin: 8px;
|
|
|
|
|
width: 35px;
|
|
|
|
|
height: 35px;
|
|
|
|
|
display: flex;
|
|
|
|
@ -88,87 +88,55 @@
|
|
|
|
|
</head>
|
|
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
<div class="mui-content">
|
|
|
|
|
<div class="mui-card">
|
|
|
|
|
<div class="mui-card-content">
|
|
|
|
|
<div class="mui-content-padded">
|
|
|
|
|
<p style="text-align: center;color: red;font-size: 16px;">本次成绩</p>
|
|
|
|
|
<p style="text-align: center;font-size: 16px;">得分:100分 用时:1小时36分05秒</p>
|
|
|
|
|
<div class="flex-container" id="answers"></div>
|
|
|
|
|
<script id="answersTemplate" type="text/x-jsrender">
|
|
|
|
|
{{for list}}
|
|
|
|
|
<a>{{:order_id}}</a>
|
|
|
|
|
{{/for}}
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
<!-- <div class="legend">
|
|
|
|
|
<div class="legend"><a class="already"></a><span>已做</span></div>
|
|
|
|
|
<div class="legend"><a></a><span>未做</span></div>
|
|
|
|
|
</div> -->
|
|
|
|
|
<p style="text-align: center;">开始时间:2023-05-06 13:45:10 </p>
|
|
|
|
|
<p style="text-align: center;">交卷时间:2023-05-06 13:45:10 </p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 侧滑导航根容器 -->
|
|
|
|
|
<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable">
|
|
|
|
|
|
|
|
|
|
<!-- 菜单容器 -->
|
|
|
|
|
<aside class="mui-off-canvas-left">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<header id="header" class="mui-bar mui-bar-nav">
|
|
|
|
|
<h1 class="mui-title">党史党建知识问答</h1>
|
|
|
|
|
</header>
|
|
|
|
|
<div class="mui-content mui-scroll-wrapper">
|
|
|
|
|
<div class="mui-card" id="examinfo"></div>
|
|
|
|
|
<script id="myTemplate" type="text/x-jsrender">
|
|
|
|
|
<div class="mui-card-header" style="font-size:18px;line-height: 1.8;">{{:order_id}}、<font style="color:#E73A30;">[{{:type_name}}]</font> {{:content}}</div>
|
|
|
|
|
<div class="mui-card-content" style="font-size:16px">
|
|
|
|
|
<div class="mui-card-content-inner mui-input-group">
|
|
|
|
|
{{for xuanxiang}}
|
|
|
|
|
<div class="mui-input-row mui-left">
|
|
|
|
|
<label style="width:100%;margin-left:10px">{{:key}}. {{:value}}</label>
|
|
|
|
|
</div>
|
|
|
|
|
{{/for}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mui-card-footer">
|
|
|
|
|
<span>考生答案:A</span><span class="mui-icon mui-icon-closeempty" style="color:red"></span>
|
|
|
|
|
<span>正确答案:B</span>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
</aside>
|
|
|
|
|
|
|
|
|
|
<!-- 主页面容器 -->
|
|
|
|
|
<div class="mui-inner-wrap">
|
|
|
|
|
<div class="mui-scroll-wrapper">
|
|
|
|
|
<div class="mui-scroll">
|
|
|
|
|
<div class="mui-content">
|
|
|
|
|
<div class="mui-content-padded">
|
|
|
|
|
<p style="text-align: center;">答题卡</p>
|
|
|
|
|
<div class="flex-container" id="answers"></div>
|
|
|
|
|
<script id="answersTemplate" type="text/x-jsrender">
|
|
|
|
|
{{if flag == 1}}
|
|
|
|
|
<a class="already">{{:order_id}}</a>
|
|
|
|
|
{{else}}
|
|
|
|
|
<a>{{:order_id}}</a>
|
|
|
|
|
{{/if}}
|
|
|
|
|
</script>
|
|
|
|
|
<div class="mui-card" id="examinfo"></div>
|
|
|
|
|
<script id="myTemplate" type="text/x-jsrender">
|
|
|
|
|
<div class="mui-card-header" style="font-size:18px;line-height: 1.8;">{{:order_id}}、<font style="color:#E73A30;">[{{:type_name}}]</font> {{:content}}</div>
|
|
|
|
|
<div class="mui-card-content" style="font-size:16px">
|
|
|
|
|
<div class="mui-card-content-inner mui-input-group">
|
|
|
|
|
{{for xuanxiang}}
|
|
|
|
|
<div class="mui-input-row mui-left">
|
|
|
|
|
<label style="width:100%;margin-left:10px">{{:key}}. {{:value}}</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="legend">
|
|
|
|
|
<div class="legend"><a class="already"></a><span>已做</span></div>
|
|
|
|
|
<div class="legend"><a></a><span>未做</span></div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 菜单具体展示内容 -->
|
|
|
|
|
<button id="closeMenu" type="button" class="mui-btn mui-btn-danger mui-btn-block"
|
|
|
|
|
style="padding: 5px 20px;margin-top: 10px;">关闭</button>
|
|
|
|
|
{{/for}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 遮罩 -->
|
|
|
|
|
<div class="mui-off-canvas-backdrop"></div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="mui-card-footer">
|
|
|
|
|
<span>考生答案:A</span><span class="mui-icon mui-icon-closeempty" style="color:red"></span>
|
|
|
|
|
<span>正确答案:B</span>
|
|
|
|
|
</div>
|
|
|
|
|
</script>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<script src="../js/jquery.min.js"></script>
|
|
|
|
|
<script src="../js/jquery.cookie.min.js"></script>
|
|
|
|
|
<script src="../js/mui.min.js"></script>
|
|
|
|
|
<script src="../js/jsrender.min.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
|
|
|
|
|
|
|
var orderId = 1;
|
|
|
|
@ -176,88 +144,23 @@
|
|
|
|
|
orderId = $.cookie('order_id');
|
|
|
|
|
} else {
|
|
|
|
|
$.cookie('order_id', orderId, { path: '/' });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取一共有多少道题
|
|
|
|
|
var queCount = getExamInfo();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取题的信息
|
|
|
|
|
getQuestionInfo(orderId);
|
|
|
|
|
|
|
|
|
|
//获取答题卡信息
|
|
|
|
|
getAnswerSheet();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 右上角增加提交按钮
|
|
|
|
|
var header = document.getElementById("header");
|
|
|
|
|
var submitBtn = document.createElement('button');
|
|
|
|
|
submitBtn.className = 'mui-btn mui-btn-blue mui-btn-link mui-pull-right';
|
|
|
|
|
submitBtn.innerText = '提交';
|
|
|
|
|
header.appendChild(submitBtn);
|
|
|
|
|
submitBtn.addEventListener('tap', function () {
|
|
|
|
|
var btnArray = ['取消', '确认'];
|
|
|
|
|
var message = "是否确认交卷?";
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/getPersonUnFinishCount",
|
|
|
|
|
async: false,
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
if (res.count > 0) {
|
|
|
|
|
message = "您还有 " + res.count + " 道题未做,是否确认交卷?"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
mui.confirm(message, '确认交卷', btnArray, function (e) {
|
|
|
|
|
if (e.index == 1) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/jiaoJuan",
|
|
|
|
|
type: 'POST',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 侧边栏对象
|
|
|
|
|
var offCanvasWrapper = mui('#offCanvasWrapper');
|
|
|
|
|
document.getElementById("showMenu").addEventListener("tap", function () {
|
|
|
|
|
//获取答题卡信息
|
|
|
|
|
getAnswerSheet();
|
|
|
|
|
offCanvasWrapper.offCanvas('show');
|
|
|
|
|
});
|
|
|
|
|
document.getElementById("closeMenu").addEventListener("tap", function () {
|
|
|
|
|
offCanvasWrapper.offCanvas('close');
|
|
|
|
|
});
|
|
|
|
|
// 禁用手势侧滑
|
|
|
|
|
var offCanvasInner = offCanvasWrapper[0].querySelector('.mui-inner-wrap');
|
|
|
|
|
offCanvasInner.addEventListener('drag', function (event) {
|
|
|
|
|
event.stopPropagation();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.getElementById("next").addEventListener("tap", function () {
|
|
|
|
|
if (orderId < queCount) {
|
|
|
|
|
orderId++;
|
|
|
|
|
$.cookie('order_id', orderId, { path: '/' });
|
|
|
|
|
getQuestionInfo(orderId);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
document.getElementById("previous").addEventListener("tap", function () {
|
|
|
|
|
if (orderId > 1) {
|
|
|
|
|
orderId--;
|
|
|
|
|
$.cookie('order_id', orderId, { path: '/' });
|
|
|
|
|
getQuestionInfo(orderId);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mui(".mui-content").on("tap", "a", function () {
|
|
|
|
|
console.log("123");
|
|
|
|
|
orderId = this.textContent;
|
|
|
|
|
getQuestionInfo(this.textContent);
|
|
|
|
|
offCanvasWrapper.offCanvas('close');
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -271,31 +174,6 @@
|
|
|
|
|
var template = $.templates('#myTemplate');
|
|
|
|
|
var htmlOutput = template.render(res);
|
|
|
|
|
$('#examinfo').html(htmlOutput);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//绑定复选框的事件
|
|
|
|
|
$('input[type="checkbox"]').on('change', function () {
|
|
|
|
|
var reply = "";
|
|
|
|
|
$('input[type="checkbox"]').each(function () {
|
|
|
|
|
if (this.checked) {
|
|
|
|
|
reply += this.value;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
console.log(orderId)
|
|
|
|
|
console.log(reply)
|
|
|
|
|
saveReply(orderId, reply);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//绑定单选框的事件
|
|
|
|
|
$('input[type="radio"]').on('change', function () {
|
|
|
|
|
// 获取选中的radio元素的值
|
|
|
|
|
var reply = $(this).val();
|
|
|
|
|
console.log(orderId)
|
|
|
|
|
console.log('选中的值为:' + reply);
|
|
|
|
|
saveReply(orderId, reply);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
@ -303,7 +181,7 @@
|
|
|
|
|
// 获取答题卡信息
|
|
|
|
|
function getAnswerSheet() {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/getPersonAllInfo",
|
|
|
|
|
url: "/FengHuang/exam/getPersonAllInfoAfterJiaoJuan",
|
|
|
|
|
async: false,
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: function (res) {
|
|
|
|
@ -313,31 +191,9 @@
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getExamInfo() {
|
|
|
|
|
var queCount = 0;
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/getExamInfo",
|
|
|
|
|
async: false,
|
|
|
|
|
type: 'GET',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
queCount = res.allCount;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return queCount;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function saveReply(orderId, reply) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
url: "/FengHuang/exam/save",
|
|
|
|
|
data: { "order_id": orderId, "reply": reply },
|
|
|
|
|
type: 'POST',
|
|
|
|
|
success: function (res) {
|
|
|
|
|
console.log(res);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|