From ccf6af6a4a35c773838b36116b02cf5a1fac06e6 Mon Sep 17 00:00:00 2001 From: yuliang_guo Date: Wed, 28 Jan 2026 14:32:36 +0800 Subject: [PATCH] =?UTF-8?q?style(exam):=20=E4=BC=98=E5=8C=96=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E9=A2=98=E6=AD=A3=E7=A1=AE=E7=AD=94=E6=A1=88=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B8=BA=E6=8D=A2=E8=A1=8C=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/exam/practice.vue | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/exam/practice.vue b/frontend/src/views/exam/practice.vue index c984ae5..cb39519 100644 --- a/frontend/src/views/exam/practice.vue +++ b/frontend/src/views/exam/practice.vue @@ -1182,9 +1182,12 @@ const renderMarkdown = (content: string): string => { */ const formatCorrectAnswer = (question: any) => { if (question.type === 'single' || question.type === 'multiple') { - // 如果有correctAnswer字段(来自Dify的原始correct),直接使用 + // 如果有correctAnswer字段(来自Dify的原始correct) if (question.correctAnswer) { - return question.correctAnswer + // 多选题格式优化:将 "A:xxx,B:xxx" 改为换行显示 + // 匹配 ",A:" 或 ",B:" 等格式,在逗号后的选项字母前换行 + const formatted = question.correctAnswer.replace(/,([A-Za-z][::])/g, '\n$1') + return formatted } // 否则从options中提取 return question.options