bench: 扩到 230 张 1-6 年级样本;口算卡支持三步连算;补算式级人工金标
This commit is contained in:
+11
-1
@@ -1716,7 +1716,17 @@ def import_scan_picks(conn, gid: str, cid: str, subject: str, draft_id: str,
|
||||
if len(chosen) > 20:
|
||||
raise ApiError(400, "TOO_MANY", "一次最多入库 20 道")
|
||||
|
||||
questions = [scanflow.recognize_block(src, b) for b in chosen]
|
||||
# 口算卡(一块里十几道)先展开成多道,再往库里写
|
||||
questions = []
|
||||
for b in chosen:
|
||||
r = scanflow.recognize_block(src, b)
|
||||
subs = r.get("subs") or []
|
||||
if subs:
|
||||
questions.extend({"stem": x.get("stem") or "", "judge_type": "calc",
|
||||
"options": None, "answer": x.get("answer"),
|
||||
"page_answer": None, "source": r.get("source")} for x in subs)
|
||||
else:
|
||||
questions.append(r)
|
||||
|
||||
pid = new_id("p")
|
||||
folder = UPLOAD_DIR / cid
|
||||
|
||||
Reference in New Issue
Block a user