Enhance VocabLessonView and VocabService for grammar exercise handling

- Added logic to initialize grammar exercises directly from lesson data or load them separately if not included.
- Introduced a new method to initialize answer arrays for gap fill exercises, improving user interaction and response tracking.
- Updated comments for clarity on the exercise loading process and initialization logic.
This commit is contained in:
Torsten Schulz (local)
2026-01-19 15:33:15 +01:00
parent 4bb75de3f0
commit 4e5ddc8027
3 changed files with 79 additions and 13 deletions

View File

@@ -853,6 +853,19 @@ export default class VocabService {
{
model: VocabCourse,
as: 'course'
},
{
model: VocabGrammarExercise,
as: 'grammarExercises',
include: [
{
model: VocabGrammarExerciseType,
as: 'exerciseType'
}
],
required: false,
separate: true,
order: [['exerciseNumber', 'ASC']]
}
]
});