讲不清就退一层:迷你先修图(39 知识点/60 边)+讲一遍弹窗(216 测试 + 41/22/21/29 冒烟)
This commit is contained in:
+11
-1
@@ -23,7 +23,7 @@ from pathlib import Path
|
||||
from urllib.parse import parse_qs, urlparse
|
||||
|
||||
from . import db as dbm
|
||||
from . import qr
|
||||
from . import kp_graph, qr
|
||||
from . import scanflow, services as svc
|
||||
from .services import ApiError
|
||||
|
||||
@@ -388,6 +388,16 @@ def post_explain(ctx: Ctx, mid: str, **kw):
|
||||
str(ctx.body.get("text") or ""))
|
||||
|
||||
|
||||
@route("GET", r"/api/kp-graph/(?P<kp>[^/]+)", auth="none")
|
||||
def kp_detail(ctx: Ctx, kp: str, **kw):
|
||||
"""知识点 + 前置 + 退一层建议(工作台「学情分析」与「讲一遍」用)。"""
|
||||
t = kp_graph.topic(kp)
|
||||
if not t:
|
||||
raise ApiError(404, "NO_KP", "没有这个知识点")
|
||||
return {"topic": t, "parents": kp_graph.parents(kp),
|
||||
"chain": kp_graph.chain(kp), "retreat": kp_graph.retreat(kp)}
|
||||
|
||||
|
||||
@route("GET", "/api/report/weekly", auth="parent")
|
||||
def weekly(ctx: Ctx, **kw):
|
||||
return svc.weekly_report(ctx.conn, ctx.gid, ctx.q("child_id"),
|
||||
|
||||
Reference in New Issue
Block a user