124 lines
7.3 KiB
HTML
124 lines
7.3 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
<title>答题详情</title>
|
|
<script type="text/javascript" src="/static/safesite/easyui/jquery.min.js"></script>
|
|
</head>
|
|
|
|
|
|
<body >
|
|
|
|
<div style="height:100%;overflow:auto;width:70%;background-color:lightcyan;margin:0 auto;">
|
|
<div id="examname" style="font-size: 36px;color: #73348a;text-align: center;margin-top: 30px;font-weight: bold;"></div>
|
|
<div style="height:200px" id="user">
|
|
|
|
</div>
|
|
<div id="examtype1"></div>
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>
|
|
<script>
|
|
|
|
var id = {{id }};
|
|
var html;
|
|
$.ajax({
|
|
type: "get",
|
|
url: "/api/examtestdetail?a=detail",
|
|
data: { 'id': id },
|
|
dateType: "json",
|
|
success: function (data) {
|
|
document.getElementById("examname").innerHTML = data.examtest__name;
|
|
var divUserHtml = "";
|
|
divUserHtml += '<div style="margin-left:10px;padding-bottom:13px;float:left"><image style="margin: 10px 10px;" src=' + data.user__headimgurl + '></image></div>';
|
|
divUserHtml += '<div style="float:left;margin-top: 20px;margin-left:20px"><p>姓名:' + data.user__name + '</p><p>得分:' + data.score + '</p><p>是否通过:' + (data.passcode == 1 ? '通过' : '不通过') + '</p></div > ';
|
|
|
|
$("#user").append(divUserHtml);
|
|
|
|
for (var i = 1; i <= data.testdetail.length; i++) {
|
|
|
|
|
|
if (data.testdetail[i].question__type == 3)
|
|
{
|
|
var divHtml = "";
|
|
divHtml += '<div style="margin-left:30px;padding-bottom:13px">';
|
|
divHtml += '<span style="color:blue">' + "【判断题】</span></span>"+"第"+i+"题:" + data.testdetail[i].question__title +'</span>';
|
|
divHtml += '<span style=" margin-left: 40px; color:#d5cc1d;">此题得分:' + data.testdetail[i].iscore + ' 分</span>';
|
|
divHtml += '<br />';
|
|
divHtml += '<div style="margin-left: 80px;margin-top: 15px;"><span>A.' + data.testdetail[i].question__answer.A + '</span></br></br><span>B.' + data.testdetail[i].question__answer.B +'</span></div>';
|
|
divHtml += '<br />';
|
|
divHtml += '<div style="padding-left: 10px; padding-top: 10px;">';
|
|
divHtml += '<div style="color:green;">正确答案:' + data.testdetail[i].question__right + '</div>';
|
|
if (data.testdetail[i].iscore == 0) {
|
|
divHtml += '<div style="color:red;">您的答案错误:' + data.testdetail[i].userchecked + '</div>';
|
|
}
|
|
else {
|
|
divHtml += '<div style="color:green;">您的答案正确:' + data.testdetail[i].userchecked + '</div>';
|
|
}
|
|
divHtml += '<div style="margin-top: 10px;color: #4f3b08;font-size:13px;">' + (data.testdetail[i].question_resolution == undefined ? '本题无解析!' : data.testdetail[i].question_resolution) +'</div>';
|
|
}
|
|
else if (data.testdetail[i].question__type == 2) {
|
|
var divHtml = "";
|
|
var answrText = "";
|
|
divHtml += '<div style="margin-left:30px;padding-bottom:13px">';
|
|
divHtml += '<span style="color:blue">' + "【多选题】</span></span>" +"第" + i + "题:" + data.testdetail[i].question__title + '</span>';
|
|
divHtml += '<span style=" margin-left: 40px; color:#d5cc1d;">此题得分:' + data.testdetail[i].iscore + ' 分</span>';
|
|
divHtml += '<br />';
|
|
divHtml += '<div style="margin-left: 80px;margin-top: 15px;"><span>A.' + data.testdetail[i].question__answer.A + '</span></br></br><span>B.' + data.testdetail[i].question__answer.B + '</span></br></br><span>C.' + data.testdetail[i].question__answer.C + '</span></br></br><span>D.' + data.testdetail[i].question__answer.D + '</span></br></br><span>E.' + (data.testdetail[i].question__answer.E == undefined ? '无该选项' : data.testdetail[i].question__answer.E) + '</span></br></br><span>F.' + (data.testdetail[i].question__answer.F == undefined ? '无该选项' : data.testdetail[i].question__answer.F) + '</span></div>';
|
|
divHtml += '<br />';
|
|
divHtml += '<div style="padding-left: 10px; padding-top: 10px;">';
|
|
divHtml += '<div style="color:green;">正确答案:' + data.testdetail[i].question__right + '</div>';
|
|
|
|
if (data.testdetail[i].iscore == data.testdetail[i].score) {
|
|
divHtml += '<div style="color:green;">您的答案正确:' + data.testdetail[i].userchecked + '</div>';
|
|
}
|
|
else if (data.testdetail[i].iscore == 0) {
|
|
divHtml += '<div style="color:red;">您的答案错误:' + data.testdetail[i].userchecked + '</div>';
|
|
}
|
|
else {
|
|
divHtml += '<div style="color:yellow;">您没有选全答案:' + data.testdetail[i].userchecked + '</div>';
|
|
}
|
|
divHtml += '<div style="margin-top: 10px;color: #4f3b08;font-size:13px;">' + (data.testdetail[i].question_resolution == undefined ? '本题无解析!' : data.testdetail[i].question_resolution) + '</div>';
|
|
}
|
|
else {
|
|
var divHtml = "";
|
|
var answrText = "";
|
|
divHtml += '<div style="margin-left:30px;padding-bottom:13px">';
|
|
divHtml += '<span style="color:blue">' + "【单选题】</span></span>" + "第" + i + "题:" + data.testdetail[i].question__title + '</span>';
|
|
divHtml += '<span style=" margin-left: 40px; color:#d5cc1d;">此题得分:' + data.testdetail[i].iscore + ' 分</span>';
|
|
divHtml += '<br />';
|
|
divHtml += '<div style="margin-left: 80px;margin-top: 15px;"><span>A.' + data.testdetail[i].question__answer.A + '</span></br></br><span>B.' + data.testdetail[i].question__answer.B + '</span></br></br><span>C.' + data.testdetail[i].question__answer.C + '</span></br></br><span>D.' + data.testdetail[i].question__answer.D + '</span></div>';
|
|
divHtml += '<br />';
|
|
divHtml += '<div style="padding-left: 10px; padding-top: 10px;">';
|
|
divHtml += '<div style="color:green;">正确答案:' + data.testdetail[i].question__right + '</div>';
|
|
if (data.testdetail[i].iscore == 0) {
|
|
divHtml += '<div style="color:red;">您的答案错误:' + data.testdetail[i].userchecked + '</div>';
|
|
}
|
|
else {
|
|
divHtml += '<div style="color:green;">您的答案正确:' + data.testdetail[i].userchecked + '</div>';
|
|
}
|
|
divHtml += '<div style="margin-top: 10px;color: #4f3b08;font-size:13px;">' + (data.testdetail[i].question_resolution == undefined ? '本题无解析!' : data.testdetail[i].question_resolution) + '</div>';
|
|
}
|
|
$("#examtype1").append(divHtml);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
},
|
|
error: function () {
|
|
return false;
|
|
},
|
|
async: false
|
|
});
|
|
|
|
|
|
|
|
</script>
|