2019-01-21 01:19:25 +08:00
|
|
|
<!DOCTYPE HTML>
|
|
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
|
|
|
|
<meta charset="utf-8">
|
|
|
|
|
<header th:include="web/index::cmsHeader"></header>
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
|
|
<div class="fly-header layui-bg-black" th:replace="web/index::top">
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="layui-container">
|
|
|
|
|
<div class="layui-row layui-col-space15">
|
|
|
|
|
<div class="layui-col-md12">
|
|
|
|
|
<div class="fly-panel">
|
|
|
|
|
|
2019-01-21 07:30:17 +08:00
|
|
|
<div class="layui-col-md9">
|
|
|
|
|
<div class="layui-col-md12">
|
|
|
|
|
<div class="layui-card" th:each="question:${data}">
|
|
|
|
|
<div class="layui-card-header">[[${questionStat.index+1}]]:<span
|
|
|
|
|
th:text="${question.title}"></span>
|
|
|
|
|
<span th:if="${question.type=='1'}">(单选)</span>
|
|
|
|
|
<span th:if="${question.type=='2'}">(多选)</span>
|
|
|
|
|
<span th:if="${question.type=='3'}">(判断)</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="layui-card-body" th:each="item:${question.questionItem}">
|
|
|
|
|
<input th:class="${question.id}+'useranswer'" th:if="${question.type=='2'}"
|
|
|
|
|
type="checkbox" th:name="${question.id}" th:value="${item.number}">
|
|
|
|
|
<input th:class="${question.id}+'useranswer'" th:if="${question.type != '2'}"
|
|
|
|
|
type="radio" th:name="${question.id}" th:value="${item.number}">
|
|
|
|
|
[[${item.number}]]:
|
|
|
|
|
<span th:text="${item.content}" onclick="checkbox(this)"></span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!--<div class="layui-card-body">-->
|
|
|
|
|
<!--<button class="layui-btn layui-btn-warm"-->
|
|
|
|
|
<!--th:onclick="'analysis('+${question.id}+',\''+${question.answer}+'\')'">解析-->
|
|
|
|
|
<!--</button>-->
|
|
|
|
|
<!--</div>-->
|
|
|
|
|
<!--<div class="layui-card-body" hidden th:id="${question.id}+'answer'">-->
|
|
|
|
|
<!--解析:正确答案[[${question.answer}]]<br>-->
|
|
|
|
|
<!--[[${question.label}]]-->
|
|
|
|
|
<!--</div>-->
|
2019-01-21 01:19:25 +08:00
|
|
|
</div>
|
2019-01-21 07:30:17 +08:00
|
|
|
|
|
|
|
|
<div class="layui-card">
|
|
|
|
|
<button class="layui-btn layui-btn-warm" onclick="endPaper()">交卷</button>
|
2019-01-21 01:19:25 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-01-21 07:30:17 +08:00
|
|
|
|
2019-01-21 01:19:25 +08:00
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="fly-footer" th:replace="web/index::cmsBottom">
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<script src="/web/res/layui/layui.js"></script>
|
|
|
|
|
<script src="/js/jquery.min.js"></script>
|
|
|
|
|
<script type="text/javascript">var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
|
|
|
|
|
document.write(unescape("%3Cspan id='cnzz_stat_icon_30088308'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "w.cnzz.com/c.php%3Fid%3D30088308' type='text/javascript'%3E%3C/script%3E"));</script>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
var layer;
|
2019-01-21 07:30:17 +08:00
|
|
|
$(function () {
|
|
|
|
|
layui.use('layer', function () {
|
2019-01-21 01:19:25 +08:00
|
|
|
layer = layui.layer;
|
|
|
|
|
});
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
2019-01-21 07:30:17 +08:00
|
|
|
function endPaper() {
|
|
|
|
|
var userAnswer = $("." + id + "useranswer:checked").val();
|
|
|
|
|
if (userAnswer != answer) {
|
2019-01-21 01:19:25 +08:00
|
|
|
layer.msg('回答错误', {icon: 2});
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
2019-01-21 07:30:17 +08:00
|
|
|
type: 'post',
|
|
|
|
|
url: "/api/v1/practice/answer",
|
|
|
|
|
contentType: "application/json",
|
|
|
|
|
data: "[" + id + "]",
|
|
|
|
|
success: function (result) {
|
2019-01-21 01:19:25 +08:00
|
|
|
if (result.code != web_status.SUCCESS) {
|
|
|
|
|
$.modal.msgError(result.msg);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2019-01-21 07:30:17 +08:00
|
|
|
$("#" + id + "answer").show()
|
2019-01-21 01:19:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</body>
|
|
|
|
|
</html>
|