Compare commits

..

2 Commits

File diff suppressed because one or more lines are too long

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="71px" height="27px" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient cx="306.72193088611" cy="205.149253731343" r="38.8059701492538" gradientTransform="matrix(0 1 -0.63963963963964 0 437.943525615168 -101.572677154767 )" gradientUnits="userSpaceOnUse" id="RadialGradient25">
<stop id="Stop26" stop-color="#d0bc93" offset="0" />
<stop id="Stop27" stop-color="#b18f6d" offset="1" />
</radialGradient>
</defs>
<g transform="matrix(1 0 0 1 -272 -191 )">
<path d="M 272 193 A 2 2 0 0 1 274 191 L 341 191 A 2 2 0 0 1 343 193 L 343 216 A 2 2 0 0 1 341 218 L 274 218 A 2 2 0 0 1 272 216 L 272 193 Z " fill-rule="nonzero" fill="url(#RadialGradient25)" stroke="none" />
</g>
</svg>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="39px" height="39px" xmlns="http://www.w3.org/2000/svg">
<defs>
<radialGradient cx="190.072609923356" cy="239.437810945274" r="56.0530679933666" gradientTransform="matrix(0 1 -0.243243243243244 0 248.314239612747 49.3652010219174 )" gradientUnits="userSpaceOnUse" id="RadialGradient4">
<stop id="Stop5" stop-color="#d0bc93" offset="0" />
<stop id="Stop6" stop-color="#b18f6d" offset="1" />
</radialGradient>
</defs>
<g transform="matrix(1 0 0 1 -171 -219 )">
<path d="M 190.5 221 C 200.3 221 208 228.7 208 238.5 C 208 248.3 200.3 256 190.5 256 C 180.7 256 173 248.3 173 238.5 C 173 228.7 180.7 221 190.5 221 Z " fill-rule="nonzero" fill="#be4331" stroke="none" />
<path d="M 190.5 220.5 C 200.58 220.5 208.5 228.42 208.5 238.5 C 208.5 248.58 200.58 256.5 190.5 256.5 C 180.42 256.5 172.5 248.58 172.5 238.5 C 172.5 228.42 180.42 220.5 190.5 220.5 Z " stroke-width="3" stroke="url(#RadialGradient4)" fill="none" />
</g>
</svg>

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>知识答题</title>
<!--标准mui.css-->
<link rel="stylesheet" href="../css/mui.min.css">
@ -15,6 +16,20 @@
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="../css/app.css" />
<style>
.mui-card-header::after {
display: none !important;
}
.mui-input-row.mui-radio.mui-left::after {
display: none !important;
}
.mui-input-row.mui-checkbox.mui-left::after {
display: none !important;
}
.flex-container {
display: -webkit-box;
display: -webkit-flex;
@ -83,8 +98,46 @@
.mui-content a.already {
color: #fff;
border: 1px solid #E73A30;
background-color: #E73A30;
border: 1px solid #DD524D;
background-color: #DD524D;
}
.star {
position: absolute;
top: 3px;
left: 50%;
transform: translate(-50%, -50%);
width: 40px;
height: 40px;
}
.num {
position: absolute;
top: 3px;
left: 50%;
transform: translate(-50%, -50%);
color: #FFF5E1;
font-weight: bolder;
font-size: 16px;
}
.button {
background-image: url('../images/submit.svg');
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
padding: 5px 20px;
color: #FFF5E1;
text-shadow: 1px 1px 1px gray;
/*给文字添加阴影*/
border: none;
/*去掉按钮边框*/
border-radius: 5px;
}
.mui-checkbox input[type=checkbox]:checked:before,
.mui-radio input[type=radio]:checked:before {
color: #DD524D;
}
</style>
</head>
@ -126,31 +179,29 @@
<!-- 主页面容器 -->
<div class="mui-inner-wrap">
<!-- 主页面标题 -->
<header class="mui-bar mui-bar-nav" style="height: 70px;text-align: center;font-size: 14px;font-weight:bolder;">
<div style="margin-top: 3px;">“学深悟透担使命,踔厉奋发建新功”</div>
<div>长春市教育局学习贯彻习近平新时代中国特色社会主义思想</div>
<div>知识答题活动</div>
</header>
<div class="mui-content mui-scroll-wrapper" style="margin-top: 25px;">
<div style="margin-left: 10px;margin-top: 10px;"><span
<div class="mui-content mui-scroll-wrapper"
style="background-image: url('../images/bg_img.png');padding-top: 20px;">
<div style="margin-left: 10px;"><span style="color: #FDE6AA;"
class="mui-icon-extra mui-icon-extra-outline"></span><span
style="margin-left: 3px;">考试剩余时间:</span><span id="time"
style="color: red;font-weight: bold;"></span>
style="margin-left: 3px;color: #FDE6AA;">考试剩余时间:</span><span id="time"
style="color: #B70318;font-weight: bold;"></span>
<span style="float: right;margin-right: 10px;"><button id="submit" type="button" class="mui-btn mui-btn-danger">
<span style="float: right;margin-right: 10px;"><button id="submit" type="button" class="button">
提 交
</button></span>
</div>
<div class="mui-card" id="examinfo"></div>
<div class="mui-card" id="examinfo"
style="margin-top: 20px;background-color: #FFF5E1;position: relative;"></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>&nbsp{{:content}}</div>
<div class="mui-card-content" style="font-size:16px">
<div class="mui-card-content-inner mui-input-group">
<img class="star" style="filter: drop-shadow(0px 1px 2px #576574)" src="../images/tihao.svg">
<div class="num">{{:order_id}}</div>
<div class="mui-card-header" style="font-size:18px;line-height: 1.8;padding-top: 25px;"><font style="color:#DD524D;">[{{:type_name}}]</font>&nbsp{{:content}}</div>
<div class="mui-card-content" style="font-size:16px;color:#576574">
<div class="mui-card-content-inner mui-input-group" style="background-color: #FFF5E1;padding-bottom: 15px;">
{{if type_id == 3}}
{{for xuanxiang}}
<div class="mui-input-row mui-checkbox mui-left">
@ -181,15 +232,15 @@
<nav class="mui-bar mui-bar-tab">
<a class="mui-tab-item" href="#" id="showMenu" style="color:#007aff">
<a class="mui-tab-item" href="#" id="showMenu" style="color:#DD524D">
<span class="mui-icon mui-icon-bars"></span>
<span class="mui-tab-label">答题卡</span>
</a>
<a class="mui-tab-item" href="#" id="previous" style="color:#007aff">
<a class="mui-tab-item" href="#" id="previous" style="color:#DD524D">
<span class="mui-icon mui-icon-arrowthinleft"></span>
<span class="mui-tab-label">上一题</span>
</a>
<a class="mui-tab-item" href="#" id="next" style="color:#007aff">
<a class="mui-tab-item" href="#" id="next" style="color:#DD524D">
<span class="mui-icon mui-icon-arrowthinright"></span>
<span class="mui-tab-label">下一题</span>
</a>
@ -331,6 +382,8 @@
orderId++;
$.cookie('order_id', orderId, { path: '/' });
getQuestionInfo();
} else {
mui.alert('已到最后一题', '提示');
}
});

@ -1,38 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EasyTimer.js 示例</title>
</head>
<body>
<div id="timer"></div>
<script src="../js/easytimer.min.js"></script>
<script>
var timerElement = document.getElementById('timer');
// 创建一个计时器实例
var timer = new easytimer.Timer();
timer.start({ countdown: true, startValues: { seconds: 4768 } });
// $('#time').html(timer.getTimeValues().toString());
timerElement.innerHTML = timer.getTimeValues().toString();
timer.addEventListener('secondsUpdated', function (e) {
timerElement.innerHTML = timer.getTimeValues().toString();
});
timer.addEventListener('targetAchieved', function (e) {
timerElement.innerHTML = "KABOOM!!";
});
</script>
</body>
</html>

@ -0,0 +1,447 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<!--标准mui.css-->
<link rel="stylesheet" href="../css/mui.min.css">
<link rel="stylesheet" type="text/css" href="../css/icons-extra.css" />
<!--App自定义的css-->
<link rel="stylesheet" type="text/css" href="../css/app.css" />
<style>
.flex-container {
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row wrap;
/* justify-content: space-between; */
text-align: center;
}
.mui-content-padded {
padding: 10px;
}
.mui-content-padded a {
margin: 10px;
width: 35px;
height: 35px;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 25px;
background-clip: padding-box;
}
.legend {
display: flex;
justify-content: space-around;
align-items: center;
}
.legend a {
margin: 10px;
width: 20px;
height: 20px;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 25px;
background-clip: padding-box;
}
.legend span {
font-size: 14px;
}
.mui-content-padded a .mui-icon {
margin-top: 12px;
}
.mui-spinner,
.mui-spinner-white {
margin-top: 12px
}
.active .mui-spinner-indicator {
background: #007AFF;
}
.mui-content a {
color: #8F8F94;
}
.mui-content a.already {
color: #fff;
border: 1px solid #E73A30;
background-color: #E73A30;
}
</style>
</head>
<body>
<!-- 侧滑导航根容器 -->
<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable">
<!-- 菜单容器 -->
<aside class="mui-off-canvas-left">
<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>
<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>
</div>
</div>
</aside>
<!-- 主页面容器 -->
<div class="mui-inner-wrap">
<!-- 主页面标题 -->
<header class="mui-bar mui-bar-nav" style="height: 70px;text-align: center;font-size: 14px;font-weight:bolder;">
<div style="margin-top: 3px;">“学深悟透担使命,踔厉奋发建新功”</div>
<div>长春市教育局学习贯彻习近平新时代中国特色社会主义思想</div>
<div>知识答题活动</div>
</header>
<div class="mui-content mui-scroll-wrapper" style="margin-top: 25px;">
<div style="margin-left: 10px;margin-top: 10px;"><span
class="mui-icon-extra mui-icon-extra-outline"></span><span
style="margin-left: 3px;">考试剩余时间:</span><span id="time"
style="color: red;font-weight: bold;"></span>
<span style="float: right;margin-right: 10px;"><button id="submit" type="button" class="mui-btn mui-btn-danger">
提 交
</button></span>
</div>
<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>&nbsp{{:content}}</div>
<div class="mui-card-content" style="font-size:16px">
<div class="mui-card-content-inner mui-input-group">
{{if type_id == 3}}
{{for xuanxiang}}
<div class="mui-input-row mui-checkbox mui-left">
<label>{{:key}}. {{:value}}</label>
{{if checked}}
<input name="options" value="{{:key}}" type="checkbox" checked>
{{else}}
<input name="options" value="{{:key}}" type="checkbox">
{{/if}}
</div>
{{/for}}
{{else}}
{{for xuanxiang}}
<div class="mui-input-row mui-radio mui-left">
<label>{{:key}}. {{:value}}</label>
{{if checked}}
<input name="options" value="{{:key}}" type="radio" checked>
{{else}}
<input name="options" value="{{:key}}" type="radio">
{{/if}}
</div>
{{/for}}
{{/if}}
</div>
</div>
</script>
</div>
<nav class="mui-bar mui-bar-tab">
<a class="mui-tab-item" href="#" id="showMenu" style="color:#007aff">
<span class="mui-icon mui-icon-bars"></span>
<span class="mui-tab-label">答题卡</span>
</a>
<a class="mui-tab-item" href="#" id="previous" style="color:#007aff">
<span class="mui-icon mui-icon-arrowthinleft"></span>
<span class="mui-tab-label">上一题</span>
</a>
<a class="mui-tab-item" href="#" id="next" style="color:#007aff">
<span class="mui-icon mui-icon-arrowthinright"></span>
<span class="mui-tab-label">下一题</span>
</a>
</nav>
<!-- 遮罩 -->
<div class="mui-off-canvas-backdrop"></div>
</div>
</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 src="../js/easytimer.min.js"></script>
<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());
timer.addEventListener('secondsUpdated', function (e) {
$('#time').html(timer.getTimeValues().toString());
});
timer.addEventListener('targetAchieved', function (e) {
$.ajax({
url: "/FengHuang/exam/jiaoJuan",
type: 'POST',
success: function (res) {
mui.alert('考试结束时间已到,系统已自动交卷!', '提示', function () {
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";
}
}
});
if (!$.cookie('order_id')) {
$.cookie('order_id', 1, { path: '/' });
}
// 获取一共有多少道题
var queCount = getExamInfo();
//获取题的信息
getQuestionInfo();
//获取答题卡信息
getAnswerSheet();
// 右上角增加提交按钮
var submitBtn = document.getElementById("submit");
// var submitBtn = document.createElement('button');
// submitBtn.className = 'mui-btn mui-btn-red 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) {
window.location = "./result.html";
}
});
}
});
});
// 侧边栏对象
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 () {
var orderId = $.cookie('order_id');
if (orderId < queCount) {
orderId++;
$.cookie('order_id', orderId, { path: '/' });
getQuestionInfo();
}
});
document.getElementById("previous").addEventListener("tap", function () {
var orderId = $.cookie('order_id');
if (orderId > 1) {
orderId--;
$.cookie('order_id', orderId, { path: '/' });
getQuestionInfo();
}
});
mui(".mui-content").on("tap", "a", function () {
$.cookie('order_id', this.textContent, { path: '/' });
getQuestionInfo();
offCanvasWrapper.offCanvas('close');
});
// 根据题号获取题的信息
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,
type: 'GET',
success: function (res) {
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;
}
});
saveReply(orderId, reply);
});
//绑定单选框的事件
$('input[type="radio"]').on('change', function () {
// 获取选中的radio元素的值
var reply = $(this).val();
saveReply(orderId, reply);
setTimeout(function () {
orderId++;
console.log(orderId);
$.cookie('order_id', orderId, { path: '/' });
getQuestionInfo(orderId);
}, 500);
});
}
});
};
// 获取答题卡信息
function getAnswerSheet() {
$.ajax({
url: "/FengHuang/exam/getPersonAllInfo",
async: false,
type: 'GET',
success: function (res) {
var template = $.templates('#answersTemplate');
var htmlOutput = template.render(res);
$('#answers').html(htmlOutput);
}
});
}
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);
}
});
}
});
</script>
</body>
</html>

@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title>知识答题</title>
<!--标准mui.css-->
<link rel="stylesheet" href="../css/mui.min.css">
@ -94,11 +95,11 @@
</head>
<body>
<header class="mui-bar mui-bar-nav" style="height: 70px;text-align: center;font-size: 14px;font-weight:bolder;">
<!-- <header class="mui-bar mui-bar-nav" style="height: 70px;text-align: center;font-size: 14px;font-weight:bolder;">
<div style="margin-top: 3px;">“学深悟透担使命,踔厉奋发建新功”</div>
<div>长春市教育局学习贯彻习近平新时代中国特色社会主义思想</div>
<div>知识答题活动</div>
</header>
</header> -->
<div class="mui-content" style="margin-top: 25px;">
<div class="mui-card">

Loading…
Cancel
Save