Initial commit: secondary school grade archive system.
Add FastAPI/React app with Docker deployment, Ubuntu one-click install, and docs for junior/senior high score tracking and mistake bank. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from app.models.user import SchoolLevel
|
||||
|
||||
SCHOOL_LEVEL_LABELS: dict[SchoolLevel, str] = {
|
||||
SchoolLevel.junior_high: "初中",
|
||||
SchoolLevel.senior_high: "高中",
|
||||
}
|
||||
|
||||
|
||||
def school_level_label(level: SchoolLevel | str | None) -> str:
|
||||
if level is None:
|
||||
return "初中"
|
||||
if isinstance(level, str):
|
||||
try:
|
||||
level = SchoolLevel(level)
|
||||
except ValueError:
|
||||
return "初中"
|
||||
return SCHOOL_LEVEL_LABELS.get(level, "初中")
|
||||
Reference in New Issue
Block a user