Add language assistant settings and related features: Introduce new routes and controller methods for managing language assistant settings, including retrieval and saving of LLM configurations. Update navigation structure to include language assistant options. Enhance vocab course model to support additional learning attributes such as learning goals and core patterns. Update SQL scripts to reflect new database schema changes for vocab courses. Improve localization for language assistant settings in German and English.
This commit is contained in:
24
backend/sql/add_language_assistant_user_params.sql
Normal file
24
backend/sql/add_language_assistant_user_params.sql
Normal file
@@ -0,0 +1,24 @@
|
||||
-- Sprachassistent / LLM: Einstellungen über type.settings + type.user_param + community.user_param
|
||||
-- (keine Spalten mehr an community.user).
|
||||
--
|
||||
-- Falls du vorher add_user_llm_columns.sql ausgeführt hast: Spalten an user wieder entfernen.
|
||||
ALTER TABLE community."user" DROP COLUMN IF EXISTS llm_api_key_encrypted;
|
||||
ALTER TABLE community."user" DROP COLUMN IF EXISTS llm_settings;
|
||||
|
||||
-- Gruppe „languageAssistant“
|
||||
INSERT INTO type.settings (name)
|
||||
SELECT 'languageAssistant'
|
||||
WHERE NOT EXISTS (SELECT 1 FROM type.settings WHERE name = 'languageAssistant');
|
||||
|
||||
-- Param-Typen (description eindeutig)
|
||||
INSERT INTO type.user_param (description, datatype, settings_id, order_id, immutable, min_age, gender, unit)
|
||||
SELECT 'llm_settings', 'string', s.id, 900, false, NULL, NULL, NULL
|
||||
FROM type.settings s
|
||||
WHERE s.name = 'languageAssistant'
|
||||
AND NOT EXISTS (SELECT 1 FROM type.user_param p WHERE p.description = 'llm_settings');
|
||||
|
||||
INSERT INTO type.user_param (description, datatype, settings_id, order_id, immutable, min_age, gender, unit)
|
||||
SELECT 'llm_api_key', 'string', s.id, 901, false, NULL, NULL, NULL
|
||||
FROM type.settings s
|
||||
WHERE s.name = 'languageAssistant'
|
||||
AND NOT EXISTS (SELECT 1 FROM type.user_param p WHERE p.description = 'llm_api_key');
|
||||
14
backend/sql/add_vocab_lesson_didactics.sql
Normal file
14
backend/sql/add_vocab_lesson_didactics.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
ALTER TABLE community.vocab_course_lesson
|
||||
ADD COLUMN IF NOT EXISTS learning_goals JSONB,
|
||||
ADD COLUMN IF NOT EXISTS core_patterns JSONB,
|
||||
ADD COLUMN IF NOT EXISTS grammar_focus JSONB,
|
||||
ADD COLUMN IF NOT EXISTS speaking_prompts JSONB,
|
||||
ADD COLUMN IF NOT EXISTS practical_tasks JSONB;
|
||||
|
||||
INSERT INTO community.vocab_grammar_exercise_type (name, description) VALUES
|
||||
('dialog_completion', 'Dialogergänzung'),
|
||||
('situational_response', 'Situative Antwort'),
|
||||
('pattern_drill', 'Muster-Drill'),
|
||||
('reading_aloud', 'Lautlese-Übung'),
|
||||
('speaking_from_memory', 'Freies Sprechen')
|
||||
ON CONFLICT (name) DO NOTHING;
|
||||
@@ -44,6 +44,11 @@ CREATE TABLE IF NOT EXISTS community.vocab_course_lesson (
|
||||
lesson_type TEXT DEFAULT 'vocab',
|
||||
audio_url TEXT,
|
||||
cultural_notes TEXT,
|
||||
learning_goals JSONB,
|
||||
core_patterns JSONB,
|
||||
grammar_focus JSONB,
|
||||
speaking_prompts JSONB,
|
||||
practical_tasks JSONB,
|
||||
target_minutes INTEGER,
|
||||
target_score_percent INTEGER DEFAULT 80,
|
||||
requires_review BOOLEAN DEFAULT false,
|
||||
@@ -219,7 +224,12 @@ INSERT INTO community.vocab_grammar_exercise_type (name, description) VALUES
|
||||
('sentence_building', 'Satzbau-Übung'),
|
||||
('transformation', 'Satzumformung'),
|
||||
('conjugation', 'Konjugations-Übung'),
|
||||
('declension', 'Deklinations-Übung')
|
||||
('declension', 'Deklinations-Übung'),
|
||||
('dialog_completion', 'Dialogergänzung'),
|
||||
('situational_response', 'Situative Antwort'),
|
||||
('pattern_drill', 'Muster-Drill'),
|
||||
('reading_aloud', 'Lautlese-Übung'),
|
||||
('speaking_from_memory', 'Freies Sprechen')
|
||||
ON CONFLICT (name) DO NOTHING;
|
||||
|
||||
-- ============================================
|
||||
@@ -230,6 +240,16 @@ COMMENT ON COLUMN community.vocab_course_lesson.lesson_type IS
|
||||
'Type: vocab, grammar, conversation, culture, review';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.target_minutes IS
|
||||
'Zielzeit in Minuten für diese Lektion';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.learning_goals IS
|
||||
'Lernziele der Lektion als JSON-Array';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.core_patterns IS
|
||||
'Kernmuster und Beispielsätze als JSON-Array';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.grammar_focus IS
|
||||
'Grammatik-Impulse als JSON-Array von Objekten';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.speaking_prompts IS
|
||||
'Sprechaufträge als JSON-Array von Objekten';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.practical_tasks IS
|
||||
'Praxisaufgaben als JSON-Array von Objekten';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.target_score_percent IS
|
||||
'Mindestpunktzahl in Prozent zum Abschluss (z.B. 80)';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.requires_review IS
|
||||
|
||||
@@ -19,6 +19,11 @@ ADD COLUMN IF NOT EXISTS day_number INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS lesson_type TEXT DEFAULT 'vocab',
|
||||
ADD COLUMN IF NOT EXISTS audio_url TEXT,
|
||||
ADD COLUMN IF NOT EXISTS cultural_notes TEXT,
|
||||
ADD COLUMN IF NOT EXISTS learning_goals JSONB,
|
||||
ADD COLUMN IF NOT EXISTS core_patterns JSONB,
|
||||
ADD COLUMN IF NOT EXISTS grammar_focus JSONB,
|
||||
ADD COLUMN IF NOT EXISTS speaking_prompts JSONB,
|
||||
ADD COLUMN IF NOT EXISTS practical_tasks JSONB,
|
||||
ADD COLUMN IF NOT EXISTS target_minutes INTEGER,
|
||||
ADD COLUMN IF NOT EXISTS target_score_percent INTEGER DEFAULT 80,
|
||||
ADD COLUMN IF NOT EXISTS requires_review BOOLEAN DEFAULT false;
|
||||
@@ -111,7 +116,12 @@ INSERT INTO community.vocab_grammar_exercise_type (name, description) VALUES
|
||||
('sentence_building', 'Satzbau-Übung'),
|
||||
('transformation', 'Satzumformung'),
|
||||
('conjugation', 'Konjugations-Übung'),
|
||||
('declension', 'Deklinations-Übung')
|
||||
('declension', 'Deklinations-Übung'),
|
||||
('dialog_completion', 'Dialogergänzung'),
|
||||
('situational_response', 'Situative Antwort'),
|
||||
('pattern_drill', 'Muster-Drill'),
|
||||
('reading_aloud', 'Lautlese-Übung'),
|
||||
('speaking_from_memory', 'Freies Sprechen')
|
||||
ON CONFLICT (name) DO NOTHING;
|
||||
|
||||
-- ============================================
|
||||
@@ -121,6 +131,16 @@ COMMENT ON COLUMN community.vocab_course_lesson.lesson_type IS
|
||||
'Type: vocab, grammar, conversation, culture, review';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.target_minutes IS
|
||||
'Zielzeit in Minuten für diese Lektion';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.learning_goals IS
|
||||
'Lernziele der Lektion als JSON-Array';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.core_patterns IS
|
||||
'Kernmuster und Beispielsätze als JSON-Array';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.grammar_focus IS
|
||||
'Grammatik-Impulse als JSON-Array von Objekten';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.speaking_prompts IS
|
||||
'Sprechaufträge als JSON-Array von Objekten';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.practical_tasks IS
|
||||
'Praxisaufgaben als JSON-Array von Objekten';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.target_score_percent IS
|
||||
'Mindestpunktzahl in Prozent zum Abschluss (z.B. 80)';
|
||||
COMMENT ON COLUMN community.vocab_course_lesson.requires_review IS
|
||||
|
||||
Reference in New Issue
Block a user