if not enough error practice, fill in with morph match practice
This commit is contained in:
parent
8fb41cdc7a
commit
112354f7ae
1 changed files with 21 additions and 0 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue