feat(vocab): add vocab distractor pool functionality
All checks were successful
Deploy to production / deploy (push) Successful in 3m9s
All checks were successful
Deploy to production / deploy (push) Successful in 3m9s
- Implemented a new endpoint to retrieve a pool of distractors for vocabulary exercises based on prior lessons. - Updated the VocabController and VocabRouter to include the new getVocabDistractorPool method. - Enhanced VocabService to classify questions and gather distractors from previous lessons. - Modified VocabLessonView to fetch and utilize the distractor pool for multiple-choice exercises, improving the learning experience.
This commit is contained in:
33
backend/sql/update-bisaya-babay-multiple-choice.sql
Normal file
33
backend/sql/update-bisaya-babay-multiple-choice.sql
Normal file
@@ -0,0 +1,33 @@
|
||||
-- Bisaya-Kurs: Übung „Abschiedsform erkennen“ (Was bedeutet „Babay“?)
|
||||
-- Statt einer kombinierten Option „Tschüss / Auf Wiedersehen“: zwei gültige Antworten
|
||||
-- (correctAnswer [0, 1]), passend zu backend/services/vocabService.js (multiple_choice).
|
||||
--
|
||||
-- Nach dem Einspielen: Frontend deployen, falls der Vokabeltrainer aus Übungen
|
||||
-- mehrere korrekte MC-Indizes verarbeiten soll (VocabLessonView importantVocab).
|
||||
|
||||
UPDATE community.vocab_grammar_exercise AS e
|
||||
SET
|
||||
question_data = jsonb_build_object(
|
||||
'type', 'multiple_choice',
|
||||
'question', 'Was bedeutet "Babay"?',
|
||||
'options', jsonb_build_array(
|
||||
'Tschüss',
|
||||
'Auf Wiedersehen',
|
||||
'Wie geht es dir?',
|
||||
'Guten Tag'
|
||||
)
|
||||
),
|
||||
answer_data = jsonb_build_object(
|
||||
'type', 'multiple_choice',
|
||||
'correctAnswer', jsonb_build_array(0, 1)
|
||||
),
|
||||
explanation = '"Babay" ist eine einfache Verabschiedung — vergleichbar mit „Tschüss“ oder „Auf Wiedersehen“.'
|
||||
WHERE e.exercise_type_id = 2
|
||||
AND e.title = 'Abschiedsform erkennen'
|
||||
AND (
|
||||
e.question_data->>'question' = 'Was bedeutet "Babay"?'
|
||||
OR (e.question_data->'options'->>0) = 'Tschüss / Auf Wiedersehen'
|
||||
);
|
||||
|
||||
-- Erwartet: mindestens eine Zeile pro betroffener Übung (pro Kurs/Lektion).
|
||||
-- SELECT COUNT(*) vorher/nachher bei Bedarf prüfen.
|
||||
Reference in New Issue
Block a user