122 lines
4.7 KiB
HTML
122 lines
4.7 KiB
HTML
<!DOCTYPE HTML>
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
|
|
<meta charset="utf-8">
|
|
<head th:include="web/index::cmsHeader">
|
|
</head>
|
|
<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">
|
|
|
|
<div class="layui-col-md12">
|
|
<div class="layui-col-md12">
|
|
<div class="layui-card" style="text-align: center;">
|
|
<span style="font-size: 30px;line-height: 60px">[[${examExamination.name}]]</span><br>
|
|
<button style="width: 100px;margin-bottom: 20px" class="layui-btn layui-btn-warm" onclick="endPaper()" >交卷</button>
|
|
</div>
|
|
<div class="layui-card question" th:each="question:${data}">
|
|
<input type="hidden" class="questionId" th:value="${question.id}">
|
|
<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>-->
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</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;
|
|
$(function () {
|
|
layui.use('layer', function () {
|
|
layer = layui.layer;
|
|
});
|
|
})
|
|
|
|
|
|
|
|
function endPaper() {
|
|
var data = [];
|
|
$(".question").each(function(){
|
|
var examQuestionId = $(this).find(".questionId").eq(0).val()
|
|
var userAnswer = "";
|
|
$(this).find("."+examQuestionId+"useranswer:checked").each(function(){
|
|
userAnswer+=$(this).val()+",";
|
|
})
|
|
userAnswer = userAnswer.substring(0,userAnswer.length-1)
|
|
|
|
data.push({examQuestionId:examQuestionId,userAnswer:userAnswer})
|
|
})
|
|
$.ajax({
|
|
type: 'post',
|
|
url: "/web/examination/finish/"+[[${examUserExaminationId}]]+"/"+[[${examExamination.id}]]+"/"+[[${paperId}]],
|
|
contentType: "application/json",
|
|
data: JSON.stringify(data),
|
|
success: function (result) {
|
|
if (result.code != web_status.SUCCESS) {
|
|
layer.msg(result.msg, {icon: 2})
|
|
}else{
|
|
layer.msg("已交卷", {icon: 1})
|
|
location.href="/web/user/myuserexamination/detail/"+result.id;
|
|
}
|
|
}
|
|
|
|
});
|
|
}
|
|
|
|
function checkbox(value) {
|
|
$(value).prev().prop("checked", !$(value).prev().prop("checked"));
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
</body>
|
|
</html> |