update
This commit is contained in:
@@ -18,12 +18,20 @@ from paths import bausteine_path, guide_content_path
|
||||
from textkit import _norm_titel
|
||||
|
||||
MAX_OFFENE_GUIDES = 3
|
||||
VORSTUFE = {"Guide": "MiniGuide", "ProGuide": "Guide", "FullGuide": "Guide"}
|
||||
# Welches Niveau die Vorstufe erreichen muss, um das Format freizuschalten.
|
||||
# ProGuide hängt parallel zu FullGuide an „Guide absolviert" — kein Pflicht-Gate vor FullGuide.
|
||||
FREISCHALT_LEVEL = {"Guide": "absolviert", "ProGuide": "absolviert", "FullGuide": "verstanden"}
|
||||
# Lineare Progression: jedes Format schaltet das nächste frei, sobald ALLE Bausteine
|
||||
# der Vorstufe das geforderte Niveau (Score-Meilenstein 10/20/30) erreicht haben.
|
||||
VORSTUFE = {"Guide": "MiniGuide", "ProGuide": "Guide", "FullGuide": "ProGuide"}
|
||||
# absolviert=6 · verstanden=12 · gemeistert=18 (siehe lernen.NOETIG/MASTERY/MEISTERN).
|
||||
FREISCHALT_LEVEL = {"Guide": "absolviert", "ProGuide": "verstanden", "FullGuide": "gemeistert"}
|
||||
FORMATE = ("MiniGuide", "Guide", "ProGuide", "FullGuide")
|
||||
|
||||
# Geforderter Score je Freischalt-Niveau — nur für die Sperr-Meldung.
|
||||
_LEVEL_WORT = {
|
||||
"absolviert": "absolvieren (alle Bausteine auf 6)",
|
||||
"verstanden": "verstehen (alle Bausteine auf 12)",
|
||||
"gemeistert": "meistern (alle Bausteine auf 18)",
|
||||
}
|
||||
|
||||
|
||||
async def lade_lernstand() -> tuple[list[dict], dict[str, set[str]], dict[str, dict[str, set[str]]]]:
|
||||
"""Guides + Kapitel-Fortschritt + Bausteine je Meilenstein.
|
||||
@@ -127,10 +135,9 @@ def guide_lock(topic: str, fmt: str, guides: list[dict], progress: dict[str, set
|
||||
if fmt != "OnePager" and not content.exists() and not guide_slot_dateien(content):
|
||||
vorstufe = VORSTUFE.get(fmt)
|
||||
if vorstufe:
|
||||
stufe = FREISCHALT_LEVEL[fmt] # "absolviert" (alle 3) oder "verstanden" (alle 10)
|
||||
stufe = FREISCHALT_LEVEL[fmt] # absolviert=10 · verstanden=20 · gemeistert=30
|
||||
if not ist_level(topic, vorstufe, guides, progress, levels[stufe]):
|
||||
wort = "verstehen (alle Bausteine auf 10)" if stufe == "verstanden" else "absolvieren (alle Bausteine prüfen)"
|
||||
return f"Erst den {vorstufe} dieses Themas {wort}"
|
||||
return f"Erst den {vorstufe} dieses Themas {_LEVEL_WORT[stufe]}"
|
||||
stat = formate_stats(guides, progress, levels).get(fmt, {"erstellt": 0, "absolviert": 0})
|
||||
offen = stat["erstellt"] - stat["absolviert"]
|
||||
if offen >= MAX_OFFENE_GUIDES:
|
||||
|
||||
Reference in New Issue
Block a user