|
|
@ -30,7 +30,8 @@ |
|
|
|
<template v-for="(ques, j) in item.userAnswerList"> |
|
|
|
<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, item)"> |
|
|
|
@click="scrollToQues(ques, item)"> |
|
|
|
<p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{ j + 1 }}</p> |
|
|
|
<p :class="['serial', { answered: ques.answered, partAnswer: ques.partAnswer }]">{{ |
|
|
|
|
|
|
|
ques.serialNumber }}</p> |
|
|
|
<p class="score">{{ ques.originUserScore }}</p> |
|
|
|
<p class="score">{{ ques.originUserScore }}</p> |
|
|
|
</li> |
|
|
|
</li> |
|
|
|
</template> |
|
|
|
</template> |
|
|
@ -56,7 +57,7 @@ |
|
|
|
<div v-for="(ques, j) in item.userAnswerList" :key="j" class="item" :id="'ques' + ques.id"> |
|
|
|
<div v-for="(ques, j) in item.userAnswerList" :key="j" class="item" :id="'ques' + ques.id"> |
|
|
|
<div class="stem-wrap"> |
|
|
|
<div class="stem-wrap"> |
|
|
|
<div class="labels"> |
|
|
|
<div class="labels"> |
|
|
|
<span class="label">{{ j + 1 }} / {{ item.questionNum }}</span> |
|
|
|
<span class="label">{{ ques.serialNumber }} / {{ item.questionNum }}</span> |
|
|
|
<span class="label">{{ item.questionTypeName }}</span> |
|
|
|
<span class="label">{{ item.questionTypeName }}</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-tag class="m-r-5" :type="ques.difficultTheme">{{ ques.difficult }}</el-tag> |
|
|
|
<el-tag class="m-r-5" :type="ques.difficultTheme">{{ ques.difficult }}</el-tag> |
|
|
@ -103,7 +104,7 @@ |
|
|
|
<div v-else>暂无解析</div> |
|
|
|
<div v-else>暂无解析</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<div :class="['ques-info', { essay: item.questionType === 'essay' }]"> |
|
|
|
<div :class="['ques-info', { essay: item.questionType === 'essay' && ques.reviewScore === '' }]"> |
|
|
|
<template v-if="item.questionType === 'essay'"> |
|
|
|
<template v-if="item.questionType === 'essay'"> |
|
|
|
<div class="line"> |
|
|
|
<div class="line"> |
|
|
|
<span class="line-label">参考答案:</span> |
|
|
|
<span class="line-label">参考答案:</span> |
|
|
@ -273,10 +274,11 @@ export default { |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
this.getData() |
|
|
|
this.switchRecord(0, 1) |
|
|
|
|
|
|
|
this.getData(1) |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
|
async getData () { |
|
|
|
async getData (init) { |
|
|
|
this.loading = true |
|
|
|
this.loading = true |
|
|
|
try { |
|
|
|
try { |
|
|
|
const { userAnswers: outline, report } = await this.$get(`${this.api.reviewTheDetailsReport}?reportId=${this.reportId}&status=${this.curReview}`) |
|
|
|
const { userAnswers: outline, report } = await this.$get(`${this.api.reviewTheDetailsReport}?reportId=${this.reportId}&status=${this.curReview}`) |
|
|
@ -351,8 +353,8 @@ export default { |
|
|
|
n.isCorrect = n.userScore && n.questionScore === n.userScore ? 1 : (rightLen ? 3 : 2) |
|
|
|
n.isCorrect = n.userScore && n.questionScore === n.userScore ? 1 : (rightLen ? 3 : 2) |
|
|
|
} else if (type === 'essay') { // 简答题 |
|
|
|
} else if (type === 'essay') { // 简答题 |
|
|
|
if (!n.userScore) n.userScore = '' |
|
|
|
if (!n.userScore) n.userScore = '' |
|
|
|
if (!n.reviewScore) n.reviewScore = '' |
|
|
|
if (isNaN(n.reviewScore)) n.reviewScore = '' |
|
|
|
n.isCorrect = 4 // 简答题显示待判分 |
|
|
|
this.handleEssayScore(n) |
|
|
|
} |
|
|
|
} |
|
|
|
n.originUserScore = n.reviewScore |
|
|
|
n.originUserScore = n.reviewScore |
|
|
|
n.newComments = n.comments || '' |
|
|
|
n.newComments = n.comments || '' |
|
|
@ -360,7 +362,12 @@ export default { |
|
|
|
paper.push(e) |
|
|
|
paper.push(e) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
// 初始化的时候,如果没有待评阅的试题,则查询已评阅 |
|
|
|
|
|
|
|
if (!paper.length && init) { |
|
|
|
|
|
|
|
this.curReview = 1 |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
this.paper = paper |
|
|
|
this.paper = paper |
|
|
|
|
|
|
|
|
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
@ -368,13 +375,17 @@ export default { |
|
|
|
this.loading = false |
|
|
|
this.loading = false |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 判断简答题的对错 |
|
|
|
|
|
|
|
handleEssayScore (n) { |
|
|
|
|
|
|
|
n.isCorrect = n.reviewScore === '' ? 4 : (n.reviewScore === n.questionScore ? 1 : n.reviewScore ? 3 : 2) // 简答题没有reviewScore则显示待判分, 有则判断是否跟题目分数相同,完全相同是正确,小于则部分正确,0则错误 |
|
|
|
|
|
|
|
}, |
|
|
|
scrollToSmooth (position, duration) { |
|
|
|
scrollToSmooth (position, duration) { |
|
|
|
let startTime = Date.now() |
|
|
|
let startTime = Date.now() |
|
|
|
|
|
|
|
|
|
|
|
function scroll () { |
|
|
|
function scroll () { |
|
|
|
let now = Date.now() |
|
|
|
let now = Date.now() |
|
|
|
let progress = Math.min(1, (now - startTime) / duration) |
|
|
|
let progress = Math.min(1, (now - startTime) / duration) |
|
|
|
document.querySelector('#right').scrollTo(0, position * progress) |
|
|
|
document.querySelector('#quesWrap').scrollTo(0, position * progress) |
|
|
|
|
|
|
|
|
|
|
|
if (progress < 1) { |
|
|
|
if (progress < 1) { |
|
|
|
window.requestAnimationFrame(scroll) |
|
|
|
window.requestAnimationFrame(scroll) |
|
|
@ -388,7 +399,7 @@ export default { |
|
|
|
item.shrink = false |
|
|
|
item.shrink = false |
|
|
|
const el = document.querySelector('#ques' + e.id) |
|
|
|
const el = document.querySelector('#ques' + e.id) |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$nextTick(() => { |
|
|
|
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#right').offsetTop, 200) |
|
|
|
el && this.scrollToSmooth(el.offsetTop - document.querySelector('#quesWrap').offsetTop, 200) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 左侧评阅切换 |
|
|
|
// 左侧评阅切换 |
|
|
@ -427,6 +438,7 @@ export default { |
|
|
|
reviewScore: ques.reviewScore, |
|
|
|
reviewScore: ques.reviewScore, |
|
|
|
}]) |
|
|
|
}]) |
|
|
|
ques.originUserScore = ques.reviewScore |
|
|
|
ques.originUserScore = ques.reviewScore |
|
|
|
|
|
|
|
this.handleEssayScore(ques) |
|
|
|
Util.successMsg('保存成功') |
|
|
|
Util.successMsg('保存成功') |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 填空题的小空对错点击回调 |
|
|
|
// 填空题的小空对错点击回调 |
|
|
@ -466,21 +478,53 @@ export default { |
|
|
|
Util.successMsg('删除成功') |
|
|
|
Util.successMsg('删除成功') |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 判断是否需要弹框提示保存分数 |
|
|
|
|
|
|
|
async handleLeave (cb) { |
|
|
|
|
|
|
|
const { paper } = this |
|
|
|
|
|
|
|
let invalid = 0 |
|
|
|
|
|
|
|
for (const e of paper) { |
|
|
|
|
|
|
|
if (e.userAnswerList.some(n => n.originUserScore !== n.reviewScore)) { |
|
|
|
|
|
|
|
invalid = 1 |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (invalid) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
await this.$confirm('还有未保存的分数,是否保存并继续?', '提示', { |
|
|
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
|
|
type: 'warning', |
|
|
|
|
|
|
|
closeOnClickModal: false, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
await this.saveAll() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cb() |
|
|
|
|
|
|
|
} catch (e) { } |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
cb() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 下一个、上一个 |
|
|
|
// 下一个、上一个 |
|
|
|
async switchRecord (isNext) { |
|
|
|
async switchRecord (isNext, init) { |
|
|
|
const res = await this.$post(this.api.getTheLabReportIdUpAndDown, { |
|
|
|
this.handleLeave(async () => { |
|
|
|
competitionId: this.competitionId, |
|
|
|
const res = await this.$post(this.api.getTheLabReportIdUpAndDown, { |
|
|
|
stageId: this.stageId, |
|
|
|
competitionId: this.competitionId, |
|
|
|
currentReportId: this.reportId |
|
|
|
stageId: this.stageId, |
|
|
|
|
|
|
|
currentReportId: this.reportId |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
this.showNext = !init && !isNext && res.previousReportId ? true : (init ? !!res.nextReportId : !!res.nextNextReportId) |
|
|
|
|
|
|
|
this.showPrev = !init && isNext && res.nextReportId ? true : (init ? !!res.previousReportId : !!res.previousPreviousReportId) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!init) { |
|
|
|
|
|
|
|
const id = res[isNext ? 'nextReportId' : 'previousReportId'] |
|
|
|
|
|
|
|
if (id) { |
|
|
|
|
|
|
|
this.reportId = id |
|
|
|
|
|
|
|
this.$router.push(`/theoryReview?id=${id}&u=${this.showUserInfo}&m=${this.hasManualScoreType}&c=${this.competitionId}&s=${this.stageId}`) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
const id = res[isNext ? 'nextReportId' : 'previousReportId'] |
|
|
|
|
|
|
|
this.showNext = !!res.nextReportId |
|
|
|
|
|
|
|
this.showPrev = !!res.previousReportId |
|
|
|
|
|
|
|
if (id) { |
|
|
|
|
|
|
|
this.reportId = id |
|
|
|
|
|
|
|
this.$router.push(`/theoryReview?id=${id}&u=${this.showUserInfo}&c=${this.competitionId}&s=${this.stageId}`) |
|
|
|
|
|
|
|
this.getData() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
// 一键保存分数 |
|
|
|
// 一键保存分数 |
|
|
|
async saveAll () { |
|
|
|
async saveAll () { |
|
|
@ -495,6 +539,8 @@ export default { |
|
|
|
assignmentDetailId: n.assignmentDetailId, |
|
|
|
assignmentDetailId: n.assignmentDetailId, |
|
|
|
reviewScore: n.reviewScore, |
|
|
|
reviewScore: n.reviewScore, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
n.originUserScore = n.reviewScore |
|
|
|
|
|
|
|
this.handleEssayScore(n) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (params.length) await this.$post(this.api.reviewPaper, params) |
|
|
|
if (params.length) await this.$post(this.api.reviewPaper, params) |
|
|
@ -504,7 +550,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
close () { |
|
|
|
close () { |
|
|
|
window.close() |
|
|
|
this.handleLeave(window.close) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
@ -833,7 +879,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.stem { |
|
|
|
.stem { |
|
|
|
max-width: calc(100% - 207px); |
|
|
|
max-width: calc(100% - 216px); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.ques-info { |
|
|
|
.ques-info { |
|
|
@ -853,6 +899,7 @@ export default { |
|
|
|
color: #fff; |
|
|
|
color: #fff; |
|
|
|
background-color: #fe9f0a; |
|
|
|
background-color: #fe9f0a; |
|
|
|
transform: rotate(45deg); |
|
|
|
transform: rotate(45deg); |
|
|
|
|
|
|
|
opacity: .7; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|