|
|
|
@ -17,7 +17,8 @@ |
|
|
|
|
item.targetScore }}分)</h6> |
|
|
|
|
<ul class="serials"> |
|
|
|
|
<template v-for="(ques, j) in item.userAnswerList"> |
|
|
|
|
<li v-if="!sheetStatus || sheetStatus === ques.isCorrect" :key="j" :class="'status' + ques.isCorrect"> |
|
|
|
|
<li v-if="!sheetStatus || sheetStatus === ques.isCorrect" :key="j" :class="'status' + ques.isCorrect" |
|
|
|
|
@click="scrollToQues(ques)"> |
|
|
|
|
<p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{ j + 1 }}</p> |
|
|
|
|
<p class="score">{{ ques.userScore }}</p> |
|
|
|
|
</li> |
|
|
|
@ -101,7 +102,7 @@ |
|
|
|
|
</el-table> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
<ul v-if="paper" class="ques-wrap"> |
|
|
|
|
<ul v-if="paper" class="ques-wrap" id="quesWrap"> |
|
|
|
|
<li v-for="(item, i) in paper" :key="i"> |
|
|
|
|
<div class="outline"> |
|
|
|
|
{{ arabicToChinese(i + 1) }}、{{ item.questionTypeName }}(本题共{{ item.questionNum }}小题,共{{ |
|
|
|
@ -110,7 +111,7 @@ |
|
|
|
|
@click="item.shrink = !item.shrink"> |
|
|
|
|
</div> |
|
|
|
|
<div :class="['ques', { hide: item.shrink }]"> |
|
|
|
|
<div v-for="(ques, j) in item.userAnswerList" :key="j" class="item"> |
|
|
|
|
<div v-for="(ques, j) in item.userAnswerList" :key="j" class="item" :id="'ques' + ques.id"> |
|
|
|
|
<div class="stem-wrap"> |
|
|
|
|
<div class="labels"> |
|
|
|
|
<span class="label">{{ j + 1 }} / {{ item.questionNum }}</span> |
|
|
|
@ -126,9 +127,10 @@ |
|
|
|
|
v-if="item.questionType !== 'fill_blank' && item.questionType !== 'essay' && ques.questionAnswerVersionsList" |
|
|
|
|
class="m-b-10"> |
|
|
|
|
<div v-for="(opt, j) in ques.questionAnswerVersionsList" :key="j" class="opt"> |
|
|
|
|
<el-checkbox v-if="item.questionType === 'multiple_choice'" v-model="opt.answerIsCorrect" |
|
|
|
|
:true-label="1"></el-checkbox> |
|
|
|
|
<el-radio v-else v-model="opt.answerIsCorrect" :true-label="1" :label="1" disabled></el-radio> |
|
|
|
|
<img v-if="opt.optCorrect === 1" src="@/assets/img/right.svg" alt="" class="icon"> |
|
|
|
|
<img v-else-if="!opt.optCorrect" src="@/assets/img/wrong.svg" alt="" class="icon"> |
|
|
|
|
<span v-else class="icon not-ans"></span> |
|
|
|
|
|
|
|
|
|
<span>{{ numToLetter(j) }}. </span> |
|
|
|
|
<div class="text" v-html="opt.optionText"></div> |
|
|
|
|
</div> |
|
|
|
@ -164,7 +166,8 @@ |
|
|
|
|
</div> |
|
|
|
|
<div class="line"> |
|
|
|
|
<span>考生答案:</span> |
|
|
|
|
<div v-html="ques.answerContent"></div> |
|
|
|
|
<div v-if="ques.answerContent" v-html="ques.answerContent"></div> |
|
|
|
|
<div v-else>未作答</div> |
|
|
|
|
</div> |
|
|
|
|
<div v-if="ques.attachmentUrl" class="line"> |
|
|
|
|
<span>考生上传附件:</span> |
|
|
|
@ -179,7 +182,7 @@ |
|
|
|
|
<p v-if="item.questionType !== 'fill_blank'">{{ ques.userAnswerStr }}</p> |
|
|
|
|
<div v-else-if="ques.userAnswerFill" class="fill-answers"> |
|
|
|
|
<p v-for="(ans, j) in ques.userAnswerFill" :key="j" class="fill-answer"> |
|
|
|
|
填空{{ j + 1 }}:{{ ans.studentAnswer }} |
|
|
|
|
填空{{ j + 1 }}:{{ ans.studentAnswer || '未作答' }} |
|
|
|
|
<img v-if="ans.correct" src="@/assets/img/right.svg" alt="" class="icon"> |
|
|
|
|
<img v-else src="@/assets/img/wrong.svg" alt="" class="icon">; |
|
|
|
|
</p> |
|
|
|
@ -288,17 +291,26 @@ export default { |
|
|
|
|
|
|
|
|
|
const opts = n.questionAnswerVersionsList |
|
|
|
|
if (type !== 'fill_blank' && type !== 'essay') { // 选择题 |
|
|
|
|
if (!n.userScore) n.userScore = 0 |
|
|
|
|
n.isCorrect = n.userScore && n.userScore === n.questionScore ? 1 : 2 |
|
|
|
|
|
|
|
|
|
// 用户选择结果 |
|
|
|
|
let { userAnswer } = n |
|
|
|
|
if (userAnswer) { |
|
|
|
|
userAnswer = JSON.parse(userAnswer) |
|
|
|
|
n.userAnswerStr = userAnswer.length ? userAnswer.map(m => numToLetter(+m - 1)).join('') : '未作答' |
|
|
|
|
} else { |
|
|
|
|
userAnswer = [] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const quesAnswer = [] |
|
|
|
|
opts && opts.map((m, j) => { |
|
|
|
|
const selected = userAnswer.includes(m.optionNumber) |
|
|
|
|
m.optCorrect = m.answerIsCorrect ? (selected ? 1 : -1) : (selected ? 0 : -1) // 用户选择的结果跟正确答案是否匹配(1正确,0错误,-1未选择) |
|
|
|
|
m.answerIsCorrect && quesAnswer.push(numToLetter(j)) |
|
|
|
|
}) |
|
|
|
|
n.quesAnswer = quesAnswer.join('') |
|
|
|
|
let { userAnswer } = n |
|
|
|
|
if (userAnswer) { |
|
|
|
|
userAnswer = JSON.parse(userAnswer) |
|
|
|
|
n.userAnswerStr = userAnswer.map(m => numToLetter(+m - 1)).join('') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} else if (type === 'fill_blank') { // 填空题 |
|
|
|
|
// 学生做的填空题答案及分数 |
|
|
|
|
let { jsonText } = n |
|
|
|
@ -321,6 +333,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!n.userScore) n.userScore = 0 |
|
|
|
|
// 填空题需要区分部分正确还是正确、错误 |
|
|
|
|
let rightLen = 0 |
|
|
|
|
if (n.userAnswerFill) rightLen = n.userAnswerFill.filter(m => m.correct).length // 正确的空的数量 |
|
|
|
@ -349,6 +362,26 @@ export default { |
|
|
|
|
this.loading = false |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
scrollToSmooth (position, duration) { |
|
|
|
|
let startTime = Date.now() |
|
|
|
|
|
|
|
|
|
function scroll () { |
|
|
|
|
let now = Date.now() |
|
|
|
|
let progress = Math.min(1, (now - startTime) / duration) |
|
|
|
|
document.querySelector('#quesWrap').scrollTo(0, position * progress) |
|
|
|
|
|
|
|
|
|
if (progress < 1) { |
|
|
|
|
window.requestAnimationFrame(scroll) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
window.requestAnimationFrame(scroll) |
|
|
|
|
}, |
|
|
|
|
// 答题卡题目点击滚动 |
|
|
|
|
scrollToQues (e) { |
|
|
|
|
const el = document.querySelector('#ques' + e.id) |
|
|
|
|
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#quesWrap').offsetTop, 200) |
|
|
|
|
}, |
|
|
|
|
// 答题卡筛选 |
|
|
|
|
filterStatus (e) { |
|
|
|
|
this.sheetStatus = this.sheetStatus === e ? '' : e |
|
|
|
@ -446,7 +479,7 @@ samp { |
|
|
|
|
font-family: 'PingFang SC', 'Helvetica Neue', Helvetica, 'microsoft yahei', arial, STHeiTi, sans-serif; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.report { |
|
|
|
|
/deep/.report { |
|
|
|
|
display: flex; |
|
|
|
|
|
|
|
|
|
.r-title { |
|
|
|
@ -550,7 +583,7 @@ samp { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/deep/ .table th { |
|
|
|
|
.table th { |
|
|
|
|
background-color: #e5dfff !important; |
|
|
|
|
|
|
|
|
|
.cell { |
|
|
|
@ -603,6 +636,11 @@ samp { |
|
|
|
|
margin: 7px 9px; |
|
|
|
|
font-size: 13px; |
|
|
|
|
text-align: center; |
|
|
|
|
cursor: pointer; |
|
|
|
|
|
|
|
|
|
&:hover { |
|
|
|
|
opacity: .9; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.serial { |
|
|
|
@ -723,6 +761,7 @@ samp { |
|
|
|
|
padding: 10px; |
|
|
|
|
background-color: #fff; |
|
|
|
|
overflow: auto; |
|
|
|
|
outline: none; |
|
|
|
|
|
|
|
|
|
&>li { |
|
|
|
|
margin-bottom: 15px; |
|
|
|
@ -873,24 +912,26 @@ samp { |
|
|
|
|
.opt { |
|
|
|
|
display: flex; |
|
|
|
|
flex-wrap: wrap; |
|
|
|
|
align-items: baseline; |
|
|
|
|
align-items: flex-start; |
|
|
|
|
padding-left: 10px; |
|
|
|
|
margin-bottom: 5px; |
|
|
|
|
font-size: 14px; |
|
|
|
|
color: #707070; |
|
|
|
|
line-height: 1.6; |
|
|
|
|
|
|
|
|
|
.el-radio, |
|
|
|
|
.el-checkbox { |
|
|
|
|
margin-right: 15px; |
|
|
|
|
&>.icon { |
|
|
|
|
margin-right: 12px; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-radio__label { |
|
|
|
|
display: none; |
|
|
|
|
.not-ans { |
|
|
|
|
width: 18px; |
|
|
|
|
height: 18px; |
|
|
|
|
border: 1px solid #ccc; |
|
|
|
|
border-radius: 50%; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.text { |
|
|
|
|
max-width: calc(100% - 48px); |
|
|
|
|
max-width: calc(100% - 55px); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|