feat(vocab): enhance vocabService and VocabLessonView for improved exercise handling
All checks were successful
Deploy to production / deploy (push) Successful in 2m58s

- Updated VocabService to include validation for synthetic exercise IDs and added methods for generating multiple-choice exercises based on chapter lexemes.
- Implemented a seeded shuffle function to randomize distractor options in multiple-choice questions, ensuring varied user experiences.
- Modified VocabLessonView to adjust target calculations for lesson goals and unlock attempts, increasing the maximum limits for better flexibility in user progress tracking.
This commit is contained in:
Torsten Schulz (local)
2026-04-02 14:23:21 +02:00
parent 3d2ccd620a
commit 77e6f8d3e8
2 changed files with 283 additions and 18 deletions

View File

@@ -979,7 +979,7 @@ export default {
const durationBonus = Math.max(0, Math.round((this.lesson?.targetMinutes || 0) / 5) - 1);
const baseTarget = Math.ceil((Math.max(vocabCount, 4) * 1.35) + (exerciseCount * 0.35) + durationBonus);
const weightedTarget = Math.ceil(baseTarget * this.lessonComplexityWeight);
return Math.min(24, Math.max(6, weightedTarget));
return Math.max(6, Math.min(120, weightedTarget));
},
trainerReviewBlendStart() {
return Math.max(3, Math.ceil(this.trainerNewFocusTarget * 0.4));
@@ -989,7 +989,7 @@ export default {
},
trainerExerciseUnlockAttempts() {
const unlockTarget = this.trainerNewFocusTarget + Math.ceil((this.effectiveExercises?.length || 0) * 0.25);
return Math.min(28, Math.max(6, unlockTarget));
return Math.max(6, Math.min(140, unlockTarget));
},
currentReviewShare() {
if (!this.hasPreviousVocab) {