diff --git a/src/modules/exams/components/exam-rich-form.tsx b/src/modules/exams/components/exam-rich-form.tsx index a4937f0..be058a3 100644 --- a/src/modules/exams/components/exam-rich-form.tsx +++ b/src/modules/exams/components/exam-rich-form.tsx @@ -180,6 +180,24 @@ export function ExamRichForm() { ? editorDocToStructure(editorDoc, values.title) : null + // 调试:查看复合题的子题解析结果 + if (previewStructure && typeof window !== "undefined") { + const composites = previewStructure.questions.filter((q) => q.type === "composite") + if (composites.length > 0) { + // eslint-disable-next-line no-console + console.log("[ExamPreview] composites:", composites.map((q) => ({ + id: q.id, + textLength: q.content.text.length, + textPreview: q.content.text.slice(0, 80), + subQuestionCount: q.content.subQuestions?.length ?? 0, + subQuestions: q.content.subQuestions?.map((s) => ({ + text: s.text.slice(0, 50), + score: s.score, + })), + }))) + } + } + return (