|
@@ -90,17 +90,32 @@ export default defineComponent({
|
|
|
// 问题列表
|
|
|
const temp = data.examinationQuestionAdds || []
|
|
|
temp.forEach((item: any) => {
|
|
|
- item.userAnswer = formatTeacherAnswer(item.rightAnswers || [])
|
|
|
+ const rightAnswers = item.rightAnswers || []
|
|
|
+ const answers = item.answers || []
|
|
|
+ answers.forEach((answer: any) => {
|
|
|
+ const child = rightAnswers.find(
|
|
|
+ (right: any) =>
|
|
|
+ right.examinationQuestionAnswerId === answer.examinationQuestionAnswerId
|
|
|
+ )
|
|
|
+ if (child) {
|
|
|
+ answer.selectRate = child.selectRate
|
|
|
+ }
|
|
|
+ })
|
|
|
+ item.answers = answers
|
|
|
+
|
|
|
+ item.userAnswer = formatTeacherAnswer(rightAnswers)
|
|
|
item.showAnalysis = true
|
|
|
item.showRate = true
|
|
|
item.analysis = {
|
|
|
message: item.answerAnalysis,
|
|
|
+ showScore: false,
|
|
|
topic: false // 是否显示结果
|
|
|
}
|
|
|
})
|
|
|
// 问题列表
|
|
|
state.questionList = temp
|
|
|
// 正确答案
|
|
|
+ console.log(state.questionList, 'state.questionList')
|
|
|
} catch {
|
|
|
//
|
|
|
}
|