From c446bb6fd33590b67f7a4b3755c18177d6b63075 Mon Sep 17 00:00:00 2001 From: cat_shark <1716967236@qq.com> Date: Fri, 22 May 2026 13:14:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=9A=E5=8F=AF=E9=80=89?= =?UTF-8?q?=E7=AD=94=E6=A1=88=E6=97=B6=E7=9A=84=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ef_course_autopilot.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ef_course_autopilot.py b/ef_course_autopilot.py index 38d90d1..6ee353d 100755 --- a/ef_course_autopilot.py +++ b/ef_course_autopilot.py @@ -162,7 +162,14 @@ def build_response_gapfill(task: TaskInfo) -> dict: """gapfill: 填空题 — 优先使用expectedResponse中的正确答案""" expected = task.expected_response.get("contents", {}).get("gapfill", {}) if expected: - return {"gapfill": expected} + result = {} + for gid, gdata in expected.items(): + user_input = gdata.get("userInput", "") + # 处理 "friendlier | more friendly" 多答案格式,取第一个 + if " | " in user_input: + user_input = user_input.split(" | ")[0].strip() + result[gid] = {"id": gid, "userInput": user_input} + return {"gapfill": result} # 回退:从task.detail获取gap列表, 填入空字符串 gf = task.task_detail.get("gapfill", {})