From 32f109a443d2bb2cc04121f9f9b9f97b56a6a316 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 29 Jun 2026 11:46:37 +0000 Subject: [PATCH] fix --- frontend/src/views/QuizView.vue | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/frontend/src/views/QuizView.vue b/frontend/src/views/QuizView.vue index a1b374b..79681c6 100644 --- a/frontend/src/views/QuizView.vue +++ b/frontend/src/views/QuizView.vue @@ -286,8 +286,11 @@

{{ isCorrect ? '답을 맞췄어요!' : '이런 틀렸군요ㅠㅜ' }}

-
- 정답: +
+ 정답: +
+
+ 정답:
@@ -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