|
@@ -38,7 +38,11 @@ function answerQuestion(studentAnswer: "true" | "false") {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
-const optionWithNames = { true: "正确", false: "错误" };
|
|
|
|
|
|
+const optionWithNames: Record<string, string> = {
|
|
|
|
+ true: "正确",
|
|
|
|
+ false: "错误",
|
|
|
|
+ "": "",
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -46,7 +50,7 @@ const optionWithNames = { true: "正确", false: "错误" };
|
|
<question-body :questionBody="examQuestion.body" />
|
|
<question-body :questionBody="examQuestion.body" />
|
|
<div class="ops">
|
|
<div class="ops">
|
|
<div class="stu-answer">
|
|
<div class="stu-answer">
|
|
- {{ optionWithNames[examQuestion.studentAnswer] }}
|
|
|
|
|
|
+ {{ optionWithNames[examQuestion.studentAnswer ?? ""] }}
|
|
</div>
|
|
</div>
|
|
<div class="score">({{ examQuestion.questionScore }}分)</div>
|
|
<div class="score">({{ examQuestion.questionScore }}分)</div>
|
|
</div>
|
|
</div>
|
|
@@ -91,7 +95,7 @@ const optionWithNames = { true: "正确", false: "错误" };
|
|
<div v-if="isShowAnswer" class="tw-mt-2">
|
|
<div v-if="isShowAnswer" class="tw-mt-2">
|
|
正确答案:
|
|
正确答案:
|
|
<div>
|
|
<div>
|
|
- {{ optionWithNames[examQuestion.rightAnswer] }}
|
|
|
|
|
|
+ {{ optionWithNames[examQuestion.rightAnswer + ""] }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|