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.
71 lines
1.8 KiB
Go
71 lines
1.8 KiB
Go
package store
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
|
|
"speech-learning-api/internal/domain"
|
|
)
|
|
|
|
func TestReviewedVariantsRejectChangedIdentityAndLeakedMedia(t *testing.T) {
|
|
base, err := BundledBank()
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
variants, err := BundledVariants(base)
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if len(variants) != 840 {
|
|
t.Fatal("unexpected Russian count", len(variants))
|
|
}
|
|
copyVariants := func() []domain.BankVariant {
|
|
raw, _ := json.Marshal(variants)
|
|
var out []domain.BankVariant
|
|
if err := json.Unmarshal(raw, &out); err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
return out
|
|
}
|
|
t.Run("changed requirement is not a translation", func(t *testing.T) {
|
|
v := copyVariants()
|
|
v[0].CanonicalTaskID = v[0].ID
|
|
v[0].Task.CanonicalTaskID = v[0].ID
|
|
if ValidateVariants(base, v) == nil {
|
|
t.Fatal("adaptation with shared identity accepted")
|
|
}
|
|
})
|
|
t.Run("ambiguous options", func(t *testing.T) {
|
|
v := copyVariants()
|
|
v[0].Task.Options[1].Label = v[0].Task.Options[0].Label
|
|
if ValidateVariants(base, v) == nil {
|
|
t.Fatal("ambiguous options accepted")
|
|
}
|
|
})
|
|
t.Run("private listening content", func(t *testing.T) {
|
|
v := copyVariants()
|
|
for i := range v {
|
|
if v[i].Task.Skill == "listening" {
|
|
v[i].Task.Stimulus = &domain.TaskStimulus{Role: "target", Language: "en-US", Text: v[i].Task.AudioText}
|
|
break
|
|
}
|
|
}
|
|
if ValidateVariants(base, v) == nil {
|
|
t.Fatal("public listening transcript accepted")
|
|
}
|
|
})
|
|
t.Run("identity translation", func(t *testing.T) {
|
|
v := copyVariants()
|
|
v[0].Task.Stimulus.Role = "source"
|
|
if ValidateVariants(base, v) == nil {
|
|
t.Fatal("source and target identity translation accepted")
|
|
}
|
|
})
|
|
for _, v := range variants {
|
|
public := v.Task.Public(false)
|
|
if public.AnswerKey != nil || public.AudioText != "" || public.EvidenceTaskID != "" {
|
|
t.Fatal("private fields exposed", v.ID)
|
|
}
|
|
}
|
|
}
|