update
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
"""Lernschulden-Regeln: Progression und Deckel für offene Guides — die EINZIGE Quelle.
|
||||
|
||||
Regeln (nur Neu-Erstellungen; Themen, Bausteine, OnePager unbegrenzt):
|
||||
- JE Format (MiniGuide/Guide/FullGuide) höchstens 3 erstellte, nicht absolvierte Guides
|
||||
- Progression pro Thema: Guide erst nach absolviertem MiniGuide, FullGuide erst nach absolviertem Guide
|
||||
- Absolviert (Mini/Guide/FullGuide): ALLE Bausteine (Section-Titel) des neuesten
|
||||
fertigen Guides haben eine bestandene Prüfung (baustein_progress). Das
|
||||
Kapitel-Häkchen ist nur noch eine Lese-Markierung. OnePager: Kapitel-Häkchen.
|
||||
Regeln (nur Neu-Erstellungen; Themen, Bausteine, Roadmap unbegrenzt):
|
||||
- Format „Guide": höchstens 3 erstellte, nicht absolvierte Guides
|
||||
- Keine Progression/Vorstufe mehr (nur ein Guide-Format).
|
||||
- Absolviert: ALLE Bausteine (Section-Titel) des neuesten fertigen Guides haben
|
||||
eine bestandene Prüfung. Roadmap ist read-only (kein Fortschritt, keine Prüfung).
|
||||
Alle Funktionen arbeiten auf einmal geladenen Daten (lade_lernstand) — keine
|
||||
Query-Schleifen mehr pro Guide.
|
||||
"""
|
||||
@@ -19,7 +18,7 @@ from textkit import _norm_titel
|
||||
|
||||
MAX_OFFENE_GUIDES = 3
|
||||
# Nur noch EIN Format „Guide" (alle relevanten Bausteine, Prüfung 0–30). Keine Progression,
|
||||
# keine Vorstufe → der Guide ist immer freischaltbar. „Rest"/OnePager separat.
|
||||
# keine Vorstufe → der Guide ist immer freischaltbar. „Rest"/Roadmap separat.
|
||||
VORSTUFE: dict[str, str] = {}
|
||||
FREISCHALT_LEVEL: dict[str, str] = {}
|
||||
FORMATE = ("Guide",)
|
||||
@@ -85,10 +84,7 @@ def _neueste_done(guides: list[dict], fmt: str) -> dict[str, dict]:
|
||||
|
||||
|
||||
def _guide_alle(g: dict, progress: dict[str, set[str]], levelset: dict[str, set[str]]) -> bool:
|
||||
"""Sind ALLE Bausteine (bzw. OnePager-Kapitel) des Guides auf dem geforderten Niveau?"""
|
||||
if g["format"] == "OnePager":
|
||||
titles = _kapitel_titel(g["topic"], g["format"])
|
||||
return bool(titles) and titles <= progress.get(g["id"], set())
|
||||
"""Sind ALLE Bausteine des Guides auf dem geforderten Niveau?"""
|
||||
sections = _section_titel(g["topic"], g["format"])
|
||||
return bool(sections) and sections <= levelset.get(g["topic"], set())
|
||||
|
||||
@@ -125,13 +121,13 @@ def guide_lock(topic: str, fmt: str, guides: list[dict], progress: dict[str, set
|
||||
Exakt die Regeln aus POST /guides: Bausteine nötig, kein Duplikat-Start,
|
||||
Lernschulden nur für echte Neu-Erstellungen (Resume/Regenerieren frei).
|
||||
"""
|
||||
if fmt != "OnePager" and not bausteine_path(topic).exists():
|
||||
if not bausteine_path(topic).exists():
|
||||
return "Erst Bausteine erstellen"
|
||||
for g in guides:
|
||||
if g["topic"] == topic and g["format"] == fmt and g["status"] in ("queued", "generating"):
|
||||
return "Generierung läuft bereits"
|
||||
content = guide_content_path(topic, fmt)
|
||||
if fmt != "OnePager" and not content.exists() and not guide_slot_dateien(content):
|
||||
if not content.exists() and not guide_slot_dateien(content):
|
||||
vorstufe = VORSTUFE.get(fmt)
|
||||
if vorstufe:
|
||||
stufe = FREISCHALT_LEVEL[fmt] # absolviert=10 · verstanden=20 · gemeistert=30
|
||||
|
||||
Reference in New Issue
Block a user