feat: learning paths in studysets, synced, with progress and tags
Server: five synced tables, only additions (migration
20261002211346701-learning-paths):
- `learning_path`: its studyset, a fractional position, and its own
content in the payload {title, secondaryTitle, description}, the last
writer winning, as a studyset's;
- `learning_path_step`: its path, a position, and its kind ('info',
'singleChoice', 'multipleChoice', 'dragAndDrop', 'fillInTheBlank'),
fixed once created;
- `learning_path_step_revision`: a step's content as append-only
revisions, as a card's: {title, body, exercise, rightFeedback,
wrongFeedback, sources};
- `learning_path_answer`: an append-only log (right, wrong, continued,
reset), as reviews are, so answers from two devices never conflict;
- `learning_path_tag`: one row per assignment, as `card_tag`.
App, `feature/learning_path`: the five exercises and their JSON, grading
that marks only the learner's own wrong picks, progress worked out from
the log (a step is done once answered right since its last fresh start),
`LearningPathRepository` (steps saved on what they started from, merged
per field) and `PathProgressRepository` (answers, resets with Undo, the
times steps were done). Paths share the person's tags; deleting a path
or a step can be undone for a moment, and a studyset's deletion takes
its paths. Tests: models, codecs, repositories, tags, the device
migration guard, and sync tests against the server (four).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
43834ef42b
commit
91f6376b93
1 changed files with 34455 additions and 26 deletions
|
|
@ -18,6 +18,11 @@ import 'package:halkyon_learn_flutter/src/feature/auth/data/auth_repository.dart
|
|||
import 'package:halkyon_learn_flutter/src/feature/card/data/card_gateway.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/card/data/card_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/geo_map/data/geo_map_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/data/learning_path_deletions.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/data/learning_path_gateway.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/data/learning_path_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/data/path_answer_gateway.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/learning_path/data/path_progress_repository.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/note/data/note_deletions.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/note/data/note_gateway.dart';
|
||||
import 'package:halkyon_learn_flutter/src/feature/note/data/note_repository.dart';
|
||||
|
|
@ -37,7 +42,9 @@ import 'fake_asset_server_gateway.dart';
|
|||
import 'fake_auth_gateway.dart';
|
||||
import 'fake_card_gateway.dart';
|
||||
import 'fake_file_picker.dart';
|
||||
import 'fake_learning_path_gateway.dart';
|
||||
import 'fake_note_gateway.dart';
|
||||
import 'fake_path_answer_gateway.dart';
|
||||
import 'fake_review_gateway.dart';
|
||||
import 'fake_settings_gateway.dart';
|
||||
import 'fake_sound_player.dart';
|
||||
|
|
@ -49,14 +56,16 @@ import 'memory_asset_file_cache.dart';
|
|||
/// database; each test passes in only the fakes it looks at.
|
||||
///
|
||||
/// Every person gets [studysetGateway], [cardGateway], [noteGateway],
|
||||
/// [tagGateway], [settingsGateway] and the asset fakes (or fresh fakes of
|
||||
/// their own),
|
||||
/// [pathGateway], [answerGateway], [tagGateway], [settingsGateway] and the
|
||||
/// asset fakes (or fresh fakes of their own),
|
||||
/// unless [openPerson] replaces how a person's dependencies are opened.
|
||||
Dependencies testDependencies({
|
||||
AuthGateway? authGateway,
|
||||
StudysetGateway? studysetGateway,
|
||||
CardGateway? cardGateway,
|
||||
NoteGateway? noteGateway,
|
||||
LearningPathGateway? pathGateway,
|
||||
PathAnswerGateway? answerGateway,
|
||||
ReviewGateway? reviewGateway,
|
||||
TagGateway? tagGateway,
|
||||
GeoMapRepository? maps,
|
||||
|
|
@ -83,17 +92,26 @@ Dependencies testDependencies({
|
|||
);
|
||||
final cards = CardRepository(cardGateway ?? FakeCardGateway());
|
||||
final notes = NoteRepository(noteGateway ?? FakeNoteGateway());
|
||||
final paths = LearningPathRepository(
|
||||
pathGateway ?? FakeLearningPathGateway(),
|
||||
);
|
||||
final pathProgress = PathProgressRepository(
|
||||
answerGateway ?? FakePathAnswerGateway(),
|
||||
);
|
||||
final tags = TagRepository(
|
||||
tagGateway ?? FakeTagGateway(),
|
||||
cardChanges: cards.changes,
|
||||
noteChanges: notes.changes,
|
||||
pathChanges: paths.changes,
|
||||
);
|
||||
final settings = SettingsRepository(
|
||||
settingsGateway ?? FakeSettingsGateway(),
|
||||
);
|
||||
final reviews = ReviewRepository(reviewGateway ?? FakeReviewGateway());
|
||||
final deletions = StudysetDeletions(studysets, cards, notes);
|
||||
final deletions = StudysetDeletions(studysets, cards, notes, paths);
|
||||
final noteDeletions = NoteDeletions(notes);
|
||||
final pathDeletions = LearningPathDeletions(paths);
|
||||
final stepDeletions = StepDeletions(paths);
|
||||
final assets = AssetRepository(
|
||||
assetGateway ?? FakeAssetGateway(),
|
||||
assetServer ?? FakeAssetServerGateway(),
|
||||
|
|
@ -103,21 +121,29 @@ Dependencies testDependencies({
|
|||
studysets: studysets,
|
||||
cards: cards,
|
||||
notes: notes,
|
||||
paths: paths,
|
||||
pathProgress: pathProgress,
|
||||
reviews: reviews,
|
||||
tags: tags,
|
||||
settings: settings,
|
||||
assets: assets,
|
||||
deletions: deletions,
|
||||
noteDeletions: noteDeletions,
|
||||
pathDeletions: pathDeletions,
|
||||
stepDeletions: stepDeletions,
|
||||
onDispose: () async {
|
||||
await deletions.dispose();
|
||||
await noteDeletions.dispose();
|
||||
await pathDeletions.dispose();
|
||||
await stepDeletions.dispose();
|
||||
await studysets.dispose();
|
||||
await tags.dispose();
|
||||
await settings.dispose();
|
||||
await reviews.dispose();
|
||||
await cards.dispose();
|
||||
await notes.dispose();
|
||||
await paths.dispose();
|
||||
await pathProgress.dispose();
|
||||
await assets.dispose();
|
||||
},
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue