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