if not enough error practice, fill in with morph match practice

This commit is contained in:
ggurdin 2026-01-20 11:43:34 -05:00
parent 8fb41cdc7a
commit 112354f7ae
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -44,6 +44,27 @@ class AnalyticsPracticeSessionRepo {
} else {
final errorTargets = await _fetchErrors();
targets.addAll(errorTargets);
if (targets.length < AnalyticsPracticeConstants.practiceGroupSize) {
final morphs = await _fetchMorphs();
final remainingCount =
AnalyticsPracticeConstants.practiceGroupSize - targets.length;
final morphEntries = morphs.entries.take(remainingCount);
for (final entry in morphEntries) {
targets.add(
AnalyticsActivityTarget(
target: PracticeTarget(
tokens: [entry.key],
activityType: types[targets.length],
morphFeature: entry.value,
),
),
);
}
targets.shuffle();
}
}
final session = AnalyticsPracticeSessionModel(