Muttersprache koppeln und russischen A1-Kurs ergänzen
GUI und neue Erklärungen verwenden gemeinsam native_language. Deutsch und Russisch sind die beiden Muttersprachen; Englisch bleibt die Lernsprache. Kompatibilitätsfelder werden atomar gekoppelt, widersprüchliche Eingaben abgewiesen und bestehende Profile sowie eingefrorene Inhalte erhalten. Ergänzt vollständige russische GUI-Kataloge und 840 geprüfte Aufgabenansichten in sieben Modulen einschließlich A1-Test, mit getrennten Sprachrollen für Ausgangs- und Lernmaterial. Äquivalente Ansichten teilen ihre Nachweisidentität. Stabile API-Fehlercodes, neue deterministische Hilfen und Trainingsbegründungen berücksichtigen die Muttersprache. Dokumentiert das Sprachmodell in AGENTS.md. Validierung: Go-Race-Suite mit eigener lokaler PostgreSQL-Testdatenbank, go vet, Web-Build, Offline-Bank-/Variantenaudit, Diff-Prüfung sowie lokale Browser-Smokes für Sprachen, Kurs, Administration, Aussprache und Aufnahme. Keine Live-Anbieter, Produktionsprofile, Deployment-Schritte oder historischen Neubewertungen.
This commit is contained in:
@@ -11,6 +11,7 @@ import (
|
||||
"speech-learning-api/internal/config"
|
||||
"speech-learning-api/internal/domain"
|
||||
"speech-learning-api/internal/store"
|
||||
"strings"
|
||||
"sync"
|
||||
"testing"
|
||||
)
|
||||
@@ -163,9 +164,14 @@ func TestBankPostgresSelectionAndOptionalEvaluation(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestBankPostgresExamSubmissionAndLaterGrades(t *testing.T) {
|
||||
for _, native := range []string{"de-DE", "ru-RU"} {
|
||||
t.Run(native, func(t *testing.T) { testBankExamNative(t, native) })
|
||||
}
|
||||
}
|
||||
func testBankExamNative(t *testing.T, native string) {
|
||||
db, profiles := adaptiveTestDB(t)
|
||||
ctx := context.Background()
|
||||
user, err := profiles.CreateUser(ctx, store.NewID("exam-bank")+"@example.test", "hash", "de-DE")
|
||||
user, err := profiles.CreateUser(ctx, store.NewID("exam-bank")+"@example.test", "hash", native)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -195,8 +201,15 @@ func TestBankPostgresExamSubmissionAndLaterGrades(t *testing.T) {
|
||||
if err != nil || len(exam.Tasks) != 12 {
|
||||
t.Fatal(err, exam)
|
||||
}
|
||||
if err = engine.Repo.SetInstructionLanguage(ctx, user.ID, "en-US", "de-DE"); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// Task presentations and the final static summary retain the exam language.
|
||||
ungraded := []domain.AdaptiveAttempt{}
|
||||
for n, pub := range exam.Tasks {
|
||||
if pub.InstructionLanguage != native {
|
||||
t.Fatal("exam language not frozen", pub.InstructionLanguage, native)
|
||||
}
|
||||
if pub.AnswerKey != nil || pub.AudioText != "" {
|
||||
t.Fatal("exam key leaked")
|
||||
}
|
||||
@@ -277,7 +290,7 @@ func TestBankPostgresExamSubmissionAndLaterGrades(t *testing.T) {
|
||||
if message.Task != "evaluate_course_attempt" {
|
||||
t.Error("unexpected model action", message.Task)
|
||||
}
|
||||
json.NewEncoder(w).Encode(aiCompletion(domain.CourseEvaluation{Score: 100, Verdict: "correct", Feedback: "Richtig.", Issues: []string{}}, true))
|
||||
json.NewEncoder(w).Encode(aiCompletion(domain.CourseEvaluation{Score: 100, Verdict: "correct", Feedback: map[string]string{"de-DE": "Richtig.", "ru-RU": "Верно."}[native], Issues: []string{}}, true))
|
||||
}))
|
||||
defer server.Close()
|
||||
agent.Keys["mistral"] = "fixture-secret"
|
||||
@@ -311,6 +324,9 @@ func TestBankPostgresExamSubmissionAndLaterGrades(t *testing.T) {
|
||||
if err != nil || exam.Status != "completed" || exam.Score == nil || *exam.Score != 100 || exam.SummaryStatus != "ready" {
|
||||
t.Fatal("later grading failed", err, exam)
|
||||
}
|
||||
if native == "ru-RU" && !strings.HasPrefix(exam.Summary, "Внутренняя") {
|
||||
t.Fatal("wrong summary language", exam.Summary)
|
||||
}
|
||||
// Repair a crash after score completion without invoking a summarizing model.
|
||||
if _, err = db.Exec(`UPDATE course_v2_exams SET result=jsonb_set(result,'{summary_status}','"pending"') WHERE id=$1`, exam.ID); err != nil {
|
||||
t.Fatal(err)
|
||||
|
||||
Reference in New Issue
Block a user