|
@@ -12,6 +12,12 @@
|
|
|
</div>
|
|
|
<div class="reset">
|
|
|
<i-button type="warning" size="large" @click="() => answerQuestion(null)">重置答案</i-button>
|
|
|
+ <span v-if="question.rightAnswer">
|
|
|
+ <i-button type="info" size="large" @click="showAnswer">显示答案</i-button>
|
|
|
+ </span>
|
|
|
+ <div v-if="question.rightAnswer && isShowAnswer">
|
|
|
+ 正确答案:<div>{{rightAnswerTransform}}</div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -28,7 +34,8 @@ export default {
|
|
|
return {
|
|
|
questionBody: this.question.body,
|
|
|
optionName,
|
|
|
- studentAnswer: this.examQuestion.studentAnswer || ""
|
|
|
+ studentAnswer: this.examQuestion.studentAnswer || "",
|
|
|
+ isShowAnswer: false
|
|
|
};
|
|
|
},
|
|
|
props: {
|
|
@@ -99,6 +106,9 @@ export default {
|
|
|
studentAnswer: realAnswer
|
|
|
});
|
|
|
}
|
|
|
+ },
|
|
|
+ showAnswer() {
|
|
|
+ this.isShowAnswer = !this.isShowAnswer;
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
@@ -129,6 +139,15 @@ export default {
|
|
|
.map(v => v.name)
|
|
|
.join("")
|
|
|
);
|
|
|
+ },
|
|
|
+ rightAnswerTransform() {
|
|
|
+ return (
|
|
|
+ this.question.rightAnswer &&
|
|
|
+ this.newQuestionOptions
|
|
|
+ .filter(v => this.question.rightAnswer.includes(v.oldIndex))
|
|
|
+ .map(v => v.name)
|
|
|
+ .join("")
|
|
|
+ );
|
|
|
}
|
|
|
},
|
|
|
components: {
|