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", {})