grammar status: new(未学)/learning(犯错)/known; overview + chips + prompts updated
This commit is contained in:
+4
-3
@@ -178,13 +178,14 @@ def overview(conn: sqlite3.Connection) -> dict:
|
||||
return c
|
||||
|
||||
g = conn.execute(
|
||||
"SELECT SUM(status='learning') l, SUM(status='known') k, COUNT(*) t FROM grammar_fixes"
|
||||
).fetchone()
|
||||
"SELECT SUM(status='new') n, SUM(status='learning') l, SUM(status='known') k,"
|
||||
" COUNT(*) t FROM grammar_fixes").fetchone()
|
||||
return {
|
||||
"word": counts("kind='word'"),
|
||||
"phrase": counts("kind='phrase'"),
|
||||
"expression": counts("kind='expression'"),
|
||||
"grammar": {"learning": g["l"] or 0, "known": g["k"] or 0, "total": g["t"] or 0},
|
||||
"grammar": {"new": g["n"] or 0, "learning": g["l"] or 0,
|
||||
"known": g["k"] or 0, "total": g["t"] or 0},
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user