Mehrsprachige Bedienung und versionierte Aufgabenvarianten einführen
Übersetzungskataloge, getrennte Sprachpräferenzen und einen versionierten Aufgabenpilot ergänzen. Historische Aufgaben und Bewertungen bleiben erhalten; äquivalente Ansichten teilen Nachweise. Lokal mit Race-Tests und PostgreSQL, Vet, Web-Build, Bank-Audits und Browser-Fixtures geprüft. Dieser Stand dient als Ausgangspunkt für die anschließend beauftragte Zusammenführung zur Muttersprache.
This commit is contained in:
@@ -89,7 +89,7 @@ func (s *AdaptiveStore) Task(ctx context.Context, user, language, id string) (do
|
||||
t.BriefID = brief.String
|
||||
t.ExamID = exam.String
|
||||
if t.Source == "curated" && t.ExamID == "" {
|
||||
t.Review = presentations > 1
|
||||
t.Review = t.Review || presentations > 1
|
||||
}
|
||||
return t, nil
|
||||
}
|
||||
@@ -141,6 +141,7 @@ func fingerprint(t domain.AdaptiveTask) string {
|
||||
return hex.EncodeToString(h[:])
|
||||
}
|
||||
func (s *AdaptiveStore) SaveTask(ctx context.Context, j domain.CourseJob, t domain.AdaptiveTask) (domain.AdaptiveTask, error) {
|
||||
t.InstructionLanguage = j.InstructionLanguage
|
||||
t.ID = NewID("a2")
|
||||
if t.Source != "ai" {
|
||||
t.Source = "flowise"
|
||||
@@ -266,11 +267,15 @@ func (s *AdaptiveStore) Snapshot(ctx context.Context, user, language, uiLanguage
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
if err = s.localizeModuleLabels(ctx, language, uiLanguage, out.Modules); err != nil {
|
||||
return out, err
|
||||
}
|
||||
|
||||
err = s.db.QueryRowContext(ctx, `SELECT COALESCE((SELECT facts_version FROM course_v2_versions WHERE user_id=$1 AND language=$2 AND version=$3),0)`, user, language, domain.CourseVersion).Scan(&out.FactsVersion)
|
||||
if err != nil {
|
||||
return out, err
|
||||
}
|
||||
rows, err := s.db.QueryContext(ctx, `SELECT t.module_id,t.skill,count(*),count(DISTINCT t.id),avg((a.evaluation->>'score')::float8),(array_agg(a.id ORDER BY a.created_at DESC,a.id DESC))[1]
|
||||
rows, err := s.db.QueryContext(ctx, `SELECT t.module_id,t.skill,count(*),count(DISTINCT COALESCE(NULLIF(t.data->>'evidence_task_id',''),t.id)),avg((a.evaluation->>'score')::float8),(array_agg(a.id ORDER BY a.created_at DESC,a.id DESC))[1]
|
||||
FROM course_v2_attempts a JOIN course_v2_tasks t ON t.id=a.task_id WHERE a.user_id=$1 AND t.language=$2 AND t.version=$3 AND a.status='graded' AND NOT a.demo AND (a.exam_id IS NULL OR EXISTS(SELECT 1 FROM course_v2_exams e WHERE e.id=a.exam_id AND e.status='completed')) GROUP BY t.module_id,t.skill`, user, language, domain.CourseVersion)
|
||||
if err != nil {
|
||||
return out, err
|
||||
@@ -422,7 +427,7 @@ func (s *AdaptiveStore) Submit(ctx context.Context, user, request string, t doma
|
||||
return domain.AdaptiveAttempt{}, err
|
||||
}
|
||||
if actualID == id {
|
||||
if err = recordPronunciation(ctx, tx, user, "course", actualID, "course:"+t.ID, t.TargetLanguage, t.ExamID, actualTime, *speech); err != nil {
|
||||
if err = recordPronunciation(ctx, tx, user, "course", actualID, "course:"+valueOr(t.EvidenceTaskID, t.ID), t.TargetLanguage, t.ExamID, actualTime, *speech); err != nil {
|
||||
return domain.AdaptiveAttempt{}, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user