- Added detailed logging in VocabService for lesson retrieval, including lesson ID, title, and exercise count. - Improved conditional rendering in VocabLessonView to handle cases where grammar exercises may not be present, enhancing user experience. - Updated logging in VocabLessonView to provide insights into loaded lessons and exercises, aiding in debugging and monitoring.
34 lines
855 B
Bash
Executable File
34 lines
855 B
Bash
Executable File
#!/bin/bash
|
|
# Script zum Prüfen, ob Übungen für eine Lektion vorhanden sind
|
|
# Verwendung: ./check-lesson-exercises.sh [lesson_id]
|
|
|
|
LESSON_ID="${1:-1}"
|
|
|
|
echo "🔍 Prüfe Übungen für Lektion ID: $LESSON_ID"
|
|
echo ""
|
|
|
|
psql -U yourpart -d yp3 << EOF
|
|
-- Prüfe Lektion
|
|
SELECT
|
|
l.id,
|
|
l.title,
|
|
l.course_id,
|
|
COUNT(e.id) as exercise_count
|
|
FROM community.vocab_course_lesson l
|
|
LEFT JOIN community.vocab_grammar_exercise e ON e.lesson_id = l.id
|
|
WHERE l.id = $LESSON_ID
|
|
GROUP BY l.id, l.title, l.course_id;
|
|
|
|
-- Zeige alle Übungen für diese Lektion
|
|
SELECT
|
|
e.id,
|
|
e.exercise_number,
|
|
e.title,
|
|
e.exercise_type_id,
|
|
et.name as exercise_type_name
|
|
FROM community.vocab_grammar_exercise e
|
|
LEFT JOIN community.vocab_grammar_exercise_type et ON et.id = e.exercise_type_id
|
|
WHERE e.lesson_id = $LESSON_ID
|
|
ORDER BY e.exercise_number;
|
|
EOF
|