fix
This commit is contained in:
@@ -286,8 +286,11 @@
|
||||
<XCircleIcon v-else :size="24" />
|
||||
<div>
|
||||
<h4 class="font-bold text-base sm:text-lg">{{ isCorrect ? '답을 맞췄어요!' : '이런 틀렸군요ㅠㅜ' }}</h4>
|
||||
<div v-if="!isCorrect" class="text-xs sm:text-sm">
|
||||
정답: <span class="font-bold underline" v-html="currentQuestion.correctAnswerStr"></span>
|
||||
<div v-if="choices.length === 0 && !isOXQuestion" class="text-xs sm:text-sm mt-1">
|
||||
정답: <span class="font-bold underline" v-html="formatCorrectAnswer(currentQuestion.correctAnswerStr)"></span>
|
||||
</div>
|
||||
<div v-else-if="!isCorrect" class="text-xs sm:text-sm">
|
||||
정답: <span class="font-bold underline" v-html="formatCorrectAnswer(currentQuestion.correctAnswerStr)"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -556,8 +559,7 @@ function skipToExplanations() {
|
||||
userDescriptiveAnswer.value = ''
|
||||
descriptiveGradingResult.value = null
|
||||
selectedChoiceIndex.value = -1
|
||||
isCorrect.value = true
|
||||
score.value++
|
||||
isCorrect.value = false
|
||||
showFeedback.value = true
|
||||
}
|
||||
|
||||
@@ -947,12 +949,20 @@ function submitOXAnswer(val: string) {
|
||||
showFeedback.value = true
|
||||
}
|
||||
|
||||
function formatCorrectAnswer(ans: string): string {
|
||||
if (!ans) return ''
|
||||
return ans.split(';;').join(', ')
|
||||
}
|
||||
|
||||
function submitTextAnswer() {
|
||||
if (showFeedback.value || !userTextAnswer.value.trim()) return
|
||||
|
||||
const user = userTextAnswer.value.trim().toLowerCase()
|
||||
const correct = currentQuestion.value.correctAnswerStr.toLowerCase()
|
||||
isCorrect.value = user === correct
|
||||
const userClean = userTextAnswer.value.trim().replace(/\s+/g, '').toLowerCase()
|
||||
const correctAnswers = (currentQuestion.value.correctAnswerStr || '')
|
||||
.split(';;')
|
||||
.map(ans => ans.trim().replace(/\s+/g, '').toLowerCase())
|
||||
|
||||
isCorrect.value = correctAnswers.includes(userClean)
|
||||
if (isCorrect.value) score.value++
|
||||
|
||||
showFeedback.value = true
|
||||
|
||||
Reference in New Issue
Block a user