W6:变式自校验(verify)+严档(原题做对先换一道,变式做对才算)(267 测试)
This commit is contained in:
+8
-1
@@ -382,7 +382,8 @@ def _child_id(ctx: Ctx) -> str:
|
||||
def post_attempt(ctx: Ctx, mid: str, **kw):
|
||||
return svc.attempt(ctx.conn, ctx.gid, _child_id(ctx), mid,
|
||||
str(ctx.body.get("answer") or ""),
|
||||
ctx.body.get("cost_ms"))
|
||||
ctx.body.get("cost_ms"),
|
||||
is_variant=bool(ctx.body.get("variant")))
|
||||
|
||||
|
||||
@route("POST", r"/api/mistakes/(?P<mid>[^/]+)/self-judge", auth="child_ok")
|
||||
@@ -415,6 +416,12 @@ def post_explain(ctx: Ctx, mid: str, **kw):
|
||||
audio_ext=ctx.body.get("audio_ext") or None)
|
||||
|
||||
|
||||
@route("POST", r"/api/children/(?P<cid>[^/]+)/settings", auth="parent")
|
||||
def post_settings(ctx: Ctx, cid: str, **kw):
|
||||
"""严档开关:打开后第二次要做对一道没见过的变式。"""
|
||||
return svc.set_settings(ctx.conn, ctx.gid, cid, ctx.body.get("strict_variant"))
|
||||
|
||||
|
||||
@route("POST", r"/api/mistakes/(?P<mid>[^/]+)/stuck", auth="child_ok")
|
||||
def post_stuck(ctx: Ctx, mid: str, **kw):
|
||||
"""讲清失败后记「卡在哪」:read / plan / calc / check。"""
|
||||
|
||||
Reference in New Issue
Block a user