Moves the typing app's lesson plan and progress from client-side YAML/localStorage into the backend, and adds a reward system that ties passing a lesson to unlocking part of the music library. Lock state is always recomputed live from curriculum x progress x the live library, never persisted separately. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
35 lines
1.1 KiB
Python
35 lines
1.1 KiB
Python
"""The typing game: curriculum, progress and reward-unlock resolution.
|
|
|
|
See ``curriculum.py`` (the lesson plan, loaded from a YAML file named by
|
|
``general.tippen.curriculum_file``), ``progress.py`` (a JSON sidecar recording what has
|
|
been played and passed), ``rewards.py`` (turning a lesson's ``unlocks:`` into which
|
|
library tracks/episodes are still locked) and ``runtime.py`` (wiring the three
|
|
together at startup).
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from musicmouse.tippen.curriculum import Curriculum, CurriculumError, Lesson, World, load_curriculum
|
|
from musicmouse.tippen.progress import RecordOutcome, RunResult, Stroke, TypingProgress, record_run
|
|
from musicmouse.tippen.rewards import AlbumLock, LockState, ResolvedReward, compute_lock_state
|
|
from musicmouse.tippen.runtime import TippenRuntime, build_tippen_runtime
|
|
|
|
__all__ = [
|
|
"AlbumLock",
|
|
"Curriculum",
|
|
"CurriculumError",
|
|
"Lesson",
|
|
"LockState",
|
|
"RecordOutcome",
|
|
"ResolvedReward",
|
|
"RunResult",
|
|
"Stroke",
|
|
"TippenRuntime",
|
|
"TypingProgress",
|
|
"World",
|
|
"build_tippen_runtime",
|
|
"compute_lock_state",
|
|
"load_curriculum",
|
|
"record_run",
|
|
]
|