Identische Grundlagenwiederholungen im Lernweg gezielt reduzieren

Der thematische Lernweg berücksichtigt bisher gut gelöste Aufgaben nun bei
neuen Schritten. Kürzlich positive Grundlagen führen bevorzugt zu unbekannten,
redaktionell freigegebenen Grammatikbeispielen desselben Satzmusters. Ohne neues
Beispiel können aktuelle oder unabhängig gestützte positive Ergebnisse weitere
identische Grundlagenwiederholungen reduzieren. Ältere, neuere schwache und
unbenotete Ergebnisse werden vorsichtig behandelt; Wortbedeutungen bleiben getrennt.

Berücksichtigte frühere Übung wird separat vom manuellen Überspringen gezählt,
ohne neue Antworten, Noten oder Beherrschungsnachweise zu erzeugen. Gewählte
Transferbeispiele bleiben stabil. Lernwegposition, historische Aufgaben und
Bewertungen sowie Prüfungen bleiben erhalten; unvollständige Prüfungen und
Demoantworten liefern keine positiven Auswahlbelege. Frühere Bewertungen werden
bei einer erneut empfohlenen Aufgabe ausdrücklich eingeklappt gekennzeichnet.

Validierung: Go-Race-Suite mit eigener lokaler PostgreSQL-Testdatenbank, go vet,
Web-Build, Bank-/Varianten-/Sequenzaudit sowie lokale Browser-Smokes für Sprachen,
Kurs und vorherige Bewertungen. Geprüft sind unter anderem Nutzertrennung,
Zeitabstände, neue Fehler, unbenotete Antworten und stabile Transferbeispiele
beim Sprachwechsel. Keine zusätzlichen Modellaufrufe oder Produktionsänderungen.
This commit is contained in:
Eugenius Naumenko
2026-11-11 19:13:08 +00:00
parent 7499491ae8
commit 8d618b7fe6
22 changed files with 1277 additions and 130 deletions
+19 -15
View File
@@ -9,21 +9,25 @@ type LearningSequence struct {
Steps []LearningSequenceStep `json:"steps"`
}
type LearningSequenceStep struct {
Phase string `json:"phase"`
BankEntryID string `json:"bank_entry_id"`
Alternatives []string `json:"alternatives,omitempty"`
Phase string `json:"phase"`
BankEntryID string `json:"bank_entry_id"`
}
type SequenceRecommendation struct {
Review bool `json:"review"`
NeedsAnswer bool `json:"needs_answer"`
Revision string `json:"revision"`
SequenceID string `json:"sequence_id,omitempty"`
Title string `json:"title,omitempty"`
Phase string `json:"phase,omitempty"`
Step int `json:"step"`
Steps int `json:"steps"`
Topic int `json:"topic"`
Topics int `json:"topics"`
TaskID string `json:"task_id,omitempty"`
Complete bool `json:"complete"`
SkippedSteps int `json:"skipped_steps"`
SelectionRevision string `json:"selection_revision"`
PracticeReason string `json:"practice_reason,omitempty"`
ReusedSteps int `json:"reused_steps"`
Review bool `json:"review"`
NeedsAnswer bool `json:"needs_answer"`
Revision string `json:"revision"`
SequenceID string `json:"sequence_id,omitempty"`
Title string `json:"title,omitempty"`
Phase string `json:"phase,omitempty"`
Step int `json:"step"`
Steps int `json:"steps"`
Topic int `json:"topic"`
Topics int `json:"topics"`
TaskID string `json:"task_id,omitempty"`
Complete bool `json:"complete"`
SkippedSteps int `json:"skipped_steps"`
}
@@ -0,0 +1,185 @@
package services
import (
"context"
"encoding/json"
"speech-learning-api/internal/domain"
"speech-learning-api/internal/store"
"testing"
"time"
)
func TestLearningPathAdaptsOnlyFromOwnedGradedEvidence(t *testing.T) {
for _, scenario := range []string{"fresh-vocabulary", "spaced-vocabulary", "old-vocabulary", "ungraded", "demo", "other-user", "same-day", "grammar-transfer", "newer-mistake"} {
t.Run(scenario, func(t *testing.T) {
db, profiles := adaptiveTestDB(t)
ctx := context.Background()
now := time.Now().UTC()
user, err := profiles.CreateUser(ctx, store.NewID("adapt")+"@example.test", "hash", "ru-RU")
if err != nil {
t.Fatal(err)
}
if _, err = profiles.CreateLearnerProfile(ctx, user.ID, "en-US", "A1", 17); err != nil {
t.Fatal(err)
}
engine := NewCourseEngine(store.NewAdaptiveStore(db), profiles, nil, nil)
engine.Mode = "bank"
entries, err := store.BundledBank()
if err != nil {
t.Fatal(err)
}
bank := map[string]domain.BankEntry{}
for _, e := range entries {
bank[e.ID] = e
}
baseID := "a1bank_en_v1_introductions_vocabulary_02"
if scenario == "grammar-transfer" || scenario == "newer-mistake" {
baseID = "a1bank_en_v1_introductions_grammar_01"
}
owner := user.ID
if scenario == "other-user" {
other, err := profiles.CreateUser(ctx, store.NewID("unrelated")+"@example.test", "hash", "de-DE")
if err != nil {
t.Fatal(err)
}
owner = other.ID
}
entry := bank[baseID]
historical := entry.Task
historical.ID = store.NewID("history")
historical.Source = "curated"
historical.CanonicalTaskID = entry.ID
historical.InstructionLanguage = "de-DE"
raw, _ := json.Marshal(historical)
if _, err = db.ExecContext(ctx, `INSERT INTO course_v2_tasks(id,module_id,language,version,owner_id,source,skill,kind,data,fingerprint,bank_entry_id) VALUES($1,$2,'en-US',$3,$4,'curated',$5,$6,$7,$8,$9)`, historical.ID, historical.ModuleID, domain.CourseVersion, owner, historical.Skill, historical.Kind, raw, "bank:"+baseID, baseID); err != nil {
t.Fatal(err)
}
insert := func(status string, score float64, age time.Duration, demo bool) {
t.Helper()
var evaluation any
if status == "graded" {
verdict := "correct"
if score < 100 {
verdict = "incorrect"
}
b, _ := json.Marshal(domain.CourseEvaluation{Score: score, Verdict: verdict, Feedback: "fixture", Issues: []string{}})
evaluation = b
}
if _, err = db.ExecContext(ctx, `INSERT INTO course_v2_attempts(id,user_id,task_id,request_id,answer,status,evaluation,demo,created_at) VALUES($1,$2,$3,$4,'fixture',$5,$6,$7,$8)`, store.NewID("answer"), owner, historical.ID, store.NewID("request"), status, evaluation, demo, now.Add(-age)); err != nil {
t.Fatal(err)
}
}
switch scenario {
case "spaced-vocabulary":
insert("graded", 100, 48*time.Hour, false)
insert("graded", 100, time.Hour, false)
case "old-vocabulary":
insert("graded", 100, 8*24*time.Hour, false)
case "ungraded":
insert("graded", 100, time.Hour, false)
insert("ungraded", 0, time.Minute, false)
case "demo":
insert("graded", 100, time.Minute, true)
case "same-day":
insert("graded", 100, 3*time.Hour, false)
insert("graded", 100, 2*time.Hour, false)
insert("graded", 100, time.Hour, false)
case "newer-mistake":
insert("graded", 100, time.Hour, false)
insert("graded", 0, time.Minute, false)
default:
insert("graded", 100, 10*time.Minute, false)
}
run := func(skip string) (domain.AdaptiveTask, domain.CourseJob) {
t.Helper()
job, err := engine.Repo.Enqueue(ctx, user.ID, "en-US", "next", "a1_introductions_v1", "", skip, store.NewID("next"))
if err != nil {
t.Fatal(err)
}
job, err = engine.Repo.Claim(ctx)
if err != nil {
t.Fatal(err)
}
task, err := engine.Process(ctx, job)
if err != nil {
t.Fatal(err)
}
if err = engine.Repo.Finish(ctx, job, task, ""); err != nil {
t.Fatal(err)
}
saved, err := engine.Repo.Job(ctx, user.ID, "en-US", job.ID)
if err != nil {
t.Fatal(err)
}
return *task, saved
}
task, job := run("")
if task.Skill != "listening" {
t.Fatal("context was skipped")
}
task, job = run(task.ID)
if scenario == "fresh-vocabulary" || scenario == "spaced-vocabulary" {
if task.CanonicalTaskID == baseID || job.Recommendation.ReusedSteps != 1 || job.Recommendation.SkippedSteps != 1 {
t.Fatal("good prior evidence not reused separately from skipping", job)
}
} else if scenario != "grammar-transfer" && scenario != "newer-mistake" {
if task.CanonicalTaskID != baseID || job.Recommendation.ReusedSteps != 0 {
t.Fatal("unreliable evidence reduced practice", job)
}
}
if scenario == "grammar-transfer" || scenario == "newer-mistake" {
for n := 0; n < 20 && job.Recommendation.Phase != "grammar"; n++ {
task, job = run(task.ID)
}
if job.Recommendation.Phase != "grammar" {
t.Fatal("grammar not reached")
}
if scenario == "grammar-transfer" {
if task.CanonicalTaskID == baseID || job.Recommendation.PracticeReason != "transfer" || bank[task.CanonicalTaskID].Goal != entry.Goal {
t.Fatal("missing approved new example", task, job)
}
chosen := task.CanonicalTaskID
task, job = run("")
if task.CanonicalTaskID != chosen {
t.Fatal("new request swapped unanswered transfer example")
}
beforeStep := job.Recommendation.Step
if _, err = profiles.UpdatePreferences(ctx, user.ID, "de-DE", "", "", 0); err != nil {
t.Fatal(err)
}
task, job = run("")
if task.CanonicalTaskID != chosen || task.InstructionLanguage != "de-DE" || job.Recommendation.Step != beforeStep {
t.Fatal("native change reset transfer/path")
}
} else if task.CanonicalTaskID != baseID || job.Recommendation.PracticeReason != "refresh" {
t.Fatal("newer mistake ignored")
}
}
var frozen []byte
if err = db.QueryRowContext(ctx, `SELECT data FROM course_v2_tasks WHERE id=$1`, historical.ID).Scan(&frozen); err != nil {
t.Fatal(err)
}
var stored domain.AdaptiveTask
if err = json.Unmarshal(frozen, &stored); err != nil || stored.Prompt != historical.Prompt {
t.Fatal("historical content changed", err)
}
var graded int
if err = db.QueryRowContext(ctx, `SELECT count(*) FROM course_v2_attempts WHERE user_id=$1 AND status='graded'`, user.ID).Scan(&graded); err != nil {
t.Fatal(err)
}
expected := 1
if scenario == "spaced-vocabulary" || scenario == "newer-mistake" {
expected = 2
}
if scenario == "same-day" {
expected = 3
}
if scenario == "other-user" {
expected = 0
}
if graded != expected {
t.Fatal("navigation fabricated a graded attempt", graded, expected)
}
})
}
}
@@ -0,0 +1,136 @@
package store
import (
"context"
"database/sql"
"time"
"speech-learning-api/internal/domain"
)
const foundationFreshness = 7 * 24 * time.Hour
const foundationCooldown = 30 * time.Minute
type foundationAttempt struct {
BankID string
Goal string
Status string
Score float64
At time.Time
}
type foundationHistory struct {
Attempts map[string][]foundationAttempt
Assigned map[string]bool
}
// Only real, graded evidence can reduce practice. Pending/ungraded latest
// answers remain in the history so older good scores cannot silently overrule them.
func readFoundationHistory(ctx context.Context, tx *sql.Tx, j domain.CourseJob, now time.Time) (foundationHistory, error) {
history := foundationHistory{Attempts: map[string][]foundationAttempt{}, Assigned: map[string]bool{}}
rows, err := tx.QueryContext(ctx, `SELECT b.id,b.goal,a.status,COALESCE((a.evaluation->>'score')::float8,-1),a.created_at FROM course_v2_attempts a JOIN course_v2_tasks t ON t.id=a.task_id JOIN course_v2_bank b ON b.id=COALESCE(NULLIF(t.data->>'canonical_task_id',''),t.bank_entry_id) LEFT JOIN course_v2_exams e ON e.id=a.exam_id WHERE a.user_id=$1 AND t.owner_id=$1 AND t.language=$2 AND t.version=$3 AND b.module_id=$4 AND NOT a.demo AND (a.exam_id IS NULL OR (e.status='completed' AND e.user_id=$1 AND e.language=$2 AND e.version=$3)) AND a.created_at >= $5 AND a.created_at <= $6 ORDER BY a.created_at DESC,a.id DESC LIMIT 2000`, j.UserID, j.Language, domain.CourseVersion, j.ModuleID, now.Add(-30*24*time.Hour), now)
if err != nil {
return history, err
}
for rows.Next() {
var attempt foundationAttempt
if err = rows.Scan(&attempt.BankID, &attempt.Goal, &attempt.Status, &attempt.Score, &attempt.At); err != nil {
rows.Close()
return history, err
}
history.Attempts[attempt.BankID] = append(history.Attempts[attempt.BankID], attempt)
}
err = rows.Err()
rows.Close()
if err != nil {
return history, err
}
// Even an unfinished exam assignment is not a new transfer example. Its hidden
// grades are excluded above and must never influence this recommendation.
rows, err = tx.QueryContext(ctx, `SELECT DISTINCT COALESCE(NULLIF(data->>'canonical_task_id',''),bank_entry_id) FROM course_v2_tasks WHERE owner_id=$1 AND language=$2 AND version=$3 AND module_id=$4 AND COALESCE(NULLIF(data->>'canonical_task_id',''),bank_entry_id) IS NOT NULL`, j.UserID, j.Language, domain.CourseVersion, j.ModuleID)
if err != nil {
return history, err
}
defer rows.Close()
for rows.Next() {
var id string
if err = rows.Scan(&id); err != nil {
return history, err
}
history.Assigned[id] = true
}
return history, rows.Err()
}
func (h foundationHistory) recentGood(id string, now time.Time) bool {
attempts := h.Attempts[id]
if len(attempts) == 0 {
return false
}
last := attempts[0]
return last.Status == "graded" && last.Score >= 85 && !last.At.After(now) && now.Sub(last.At) <= foundationFreshness
}
func (h foundationHistory) reusable(step domain.LearningSequenceStep, now time.Time) bool {
if !h.recentGood(step.BankEntryID, now) {
return false
}
attempts := h.Attempts[step.BankEntryID]
latest := attempts[0]
// Avoid immediate massed repetition of the exact same item. This is a short
// cooldown, not a declaration of mastery or another successful attempt.
if now.Sub(latest.At) <= foundationCooldown {
return true
}
// Repeated clicks/locale variants on the same day do not establish density.
for _, attempt := range attempts[1:] {
if attempt.Status != "graded" || attempt.Score < 85 {
break
}
if latest.At.Sub(attempt.At) >= 24*time.Hour {
return true
}
}
// Only editorially approved sentence-pattern alternatives support transfer;
// a different word meaning/preposition with the same broad goal does not.
if step.Phase == "grammar" {
good := 1
for _, id := range step.Alternatives {
if h.recentGood(id, now) {
good++
}
}
return good >= 3
}
return false
}
// Returns an actual candidate or reuses earlier evidence for this scaffold step.
// Listening, reading and all production stages always keep their thematic task.
func chooseFoundation(step domain.LearningSequenceStep, candidates []bankCandidate, history foundationHistory, now time.Time) (index int, reuse bool, reason string) {
index = -1
byID := map[string]int{}
for n, c := range candidates {
byID[c.bankEntryID] = n
}
original, ok := byID[step.BankEntryID]
if !ok {
return -1, false, ""
}
if step.Phase != "grammar" && step.Phase != "vocabulary" {
return original, false, "foundation"
}
if !history.recentGood(step.BankEntryID, now) {
reason = "foundation"
if len(history.Attempts[step.BankEntryID]) > 0 {
reason = "refresh"
}
return original, false, reason
}
for _, id := range step.Alternatives {
if n, available := byID[id]; available && !history.Assigned[id] {
return n, false, "transfer"
}
}
if history.reusable(step, now) {
return original, true, "recent_practice"
}
return original, false, "refresh"
}
@@ -0,0 +1,115 @@
package store
import (
"speech-learning-api/internal/domain"
"testing"
"time"
)
func TestFoundationRepetitionPolicy(t *testing.T) {
now := time.Date(2026, 11, 11, 12, 0, 0, 0, time.UTC)
step := domain.LearningSequenceStep{Phase: "grammar", BankEntryID: "base", Alternatives: []string{"other", "third"}}
candidates := []bankCandidate{{bankEntryID: "base"}, {bankEntryID: "other"}, {bankEntryID: "third"}}
attempt := func(id, status string, score float64, age time.Duration) foundationAttempt {
return foundationAttempt{BankID: id, Status: status, Score: score, At: now.Add(-age)}
}
history := func(attempts ...foundationAttempt) foundationHistory {
h := foundationHistory{Attempts: map[string][]foundationAttempt{}, Assigned: map[string]bool{}}
for _, a := range attempts {
h.Attempts[a.BankID] = append(h.Attempts[a.BankID], a)
h.Assigned[a.BankID] = true
}
return h
}
t.Run("new pattern starts with its own foundation", func(t *testing.T) {
h := history(attempt("other", "graded", 100, time.Minute))
n, reuse, _ := chooseFoundation(step, candidates, h, now)
if n != 0 || reuse {
t.Fatal(n, reuse)
}
})
t.Run("a new approved example checks transfer", func(t *testing.T) {
h := history(attempt("base", "graded", 100, time.Hour))
n, reuse, reason := chooseFoundation(step, candidates, h, now)
if n != 1 || reuse || reason != "transfer" {
t.Fatal(n, reuse, reason)
}
})
t.Run("assigned exam or locale variant is not new", func(t *testing.T) {
h := history(attempt("base", "graded", 100, time.Hour))
h.Assigned["other"] = true
n, _, _ := chooseFoundation(step, candidates, h, now)
if n != 2 {
t.Fatal(n)
}
})
t.Run("a newer mistake defeats older good scores", func(t *testing.T) {
h := history(attempt("base", "graded", 0, time.Minute), attempt("base", "graded", 100, 48*time.Hour))
n, reuse, _ := chooseFoundation(step, candidates, h, now)
if n != 0 || reuse {
t.Fatal(n, reuse)
}
})
t.Run("ungraded is not successful evidence", func(t *testing.T) {
h := history(attempt("base", "ungraded", 100, time.Minute), attempt("base", "graded", 100, time.Hour))
n, reuse, _ := chooseFoundation(step, candidates, h, now)
if n != 0 || reuse {
t.Fatal(n, reuse)
}
})
t.Run("old practice is refreshed", func(t *testing.T) {
h := history(attempt("base", "graded", 100, 8*24*time.Hour))
n, reuse, reason := chooseFoundation(step, candidates, h, now)
if n != 0 || reuse || reason != "refresh" {
t.Fatal(n, reuse, reason)
}
})
t.Run("immediate duplicate may be omitted without a mastery claim", func(t *testing.T) {
h := history(attempt("base", "graded", 100, 10*time.Minute))
h.Assigned["other"] = true
h.Assigned["third"] = true
_, reuse, reason := chooseFoundation(step, candidates, h, now)
if !reuse || reason != "recent_practice" {
t.Fatal(reuse, reason)
}
})
t.Run("same-day repetitions cannot manufacture evidence density", func(t *testing.T) {
h := history(attempt("base", "graded", 100, time.Hour), attempt("base", "graded", 100, 2*time.Hour), attempt("base", "graded", 100, 3*time.Hour))
h.Assigned["other"] = true
h.Assigned["third"] = true
if h.reusable(step, now) {
t.Fatal("repetition count treated as independent evidence")
}
})
t.Run("spaced positives reduce repetitions", func(t *testing.T) {
h := history(attempt("base", "graded", 100, time.Hour), attempt("base", "graded", 100, 48*time.Hour))
if !h.reusable(step, now) {
t.Fatal("spaced practice ignored")
}
})
t.Run("different pattern examples support fewer repetitions", func(t *testing.T) {
h := history(attempt("base", "graded", 100, time.Hour), attempt("other", "graded", 100, 2*time.Hour), attempt("third", "graded", 100, 3*time.Hour))
if !h.reusable(step, now) {
t.Fatal("transfer evidence ignored")
}
})
t.Run("unrelated words never replace a meaning", func(t *testing.T) {
word := domain.LearningSequenceStep{Phase: "vocabulary", BankEntryID: "base"}
h := history(attempt("other", "graded", 100, time.Hour))
n, reuse, _ := chooseFoundation(word, candidates, h, now)
if n != 0 || reuse {
t.Fatal(n, reuse)
}
})
for _, phase := range []string{"listen", "read", "repeat", "write", "compose", "speak"} {
t.Run("thematic context preserved/"+phase, func(t *testing.T) {
s := step
s.Phase = phase
h := history(attempt("base", "graded", 100, time.Minute))
n, reuse, _ := chooseFoundation(s, candidates, h, now)
if n != 0 || reuse {
t.Fatal("production/context was bypassed")
}
})
}
}
+72 -18
View File
@@ -10,6 +10,7 @@ import (
"errors"
"fmt"
"sync"
"time"
"speech-learning-api/internal/domain"
)
@@ -29,12 +30,15 @@ CREATE TABLE IF NOT EXISTS course_v2_sequence_progress (
reviewed BOOLEAN NOT NULL DEFAULT false,
PRIMARY KEY(user_id,language,version,module_id,revision));
ALTER TABLE course_v2_sequence_progress ADD COLUMN IF NOT EXISTS reviewed BOOLEAN NOT NULL DEFAULT false;
ALTER TABLE course_v2_sequence_progress ADD COLUMN IF NOT EXISTS reused_steps INT NOT NULL DEFAULT 0 CHECK(reused_steps>=0);
ALTER TABLE course_v2_sequence_progress ADD COLUMN IF NOT EXISTS practice_reason TEXT NOT NULL DEFAULT '';
`
type sequencePack struct {
Revision string `json:"revision"`
Review string `json:"editorial_review_sha256"`
Sequences []domain.LearningSequence `json:"sequences"`
SelectionRevision string `json:"selection_revision"`
Revision string `json:"revision"`
Review string `json:"editorial_review_sha256"`
Sequences []domain.LearningSequence `json:"sequences"`
}
var sequencesOnce sync.Once
@@ -67,7 +71,7 @@ func bundledSequences() (sequencePack, error) {
return sequencesPack, sequencesError
}
func validateSequences(pack sequencePack, base []domain.BankEntry) error {
if pack.Revision == "" || len(pack.Review) != 64 || len(pack.Sequences) == 0 {
if pack.Revision == "" || pack.SelectionRevision == "" || len(pack.Review) != 64 || len(pack.Sequences) == 0 {
return errors.New("missing sequence review")
}
entries := map[string]domain.BankEntry{}
@@ -93,6 +97,14 @@ func validateSequences(pack sequencePack, base []domain.BankEntry) error {
if next >= len(phases) || step.Phase != phases[next] || !ok || entry.Task.ModuleID != seq.ModuleID || entry.Task.Kind != kinds[next] || entry.Task.Skill != skills[next] {
return fmt.Errorf("invalid sequence step: %s/%s", seq.ID, step.BankEntryID)
}
alternatives := map[string]bool{step.BankEntryID: true}
for _, id := range step.Alternatives {
alternate, ok := entries[id]
if step.Phase != "grammar" || !ok || alternatives[id] || alternate.Goal != entry.Goal || alternate.Task.ModuleID != seq.ModuleID || alternate.Task.Skill != "grammar" || alternate.Task.Kind != "choice" {
return fmt.Errorf("invalid transfer alternative: %s/%s", seq.ID, id)
}
alternatives[id] = true
}
phase = next
}
if phase != len(phases)-1 {
@@ -136,7 +148,7 @@ func sequencePositions(pack sequencePack, module string) []sequencePosition {
return out
}
func recommendationAt(pack sequencePack, positions []sequencePosition, cursor, skipped int, task, native string) *domain.SequenceRecommendation {
r := &domain.SequenceRecommendation{Revision: pack.Revision, Complete: cursor >= len(positions), SkippedSteps: skipped}
r := &domain.SequenceRecommendation{SelectionRevision: pack.SelectionRevision, Revision: pack.Revision, Complete: cursor >= len(positions), SkippedSteps: skipped}
if r.Complete {
return r
}
@@ -168,13 +180,17 @@ func (s *AdaptiveStore) SequenceRecommendation(ctx context.Context, user, langua
}
var cursor, skipped int
var reviewed bool
var reused int
var reason string
var task string
err = s.db.QueryRowContext(ctx, `SELECT cursor,skipped_steps,COALESCE(active_task_id,''),reviewed FROM course_v2_sequence_progress WHERE user_id=$1 AND language=$2 AND version=$3 AND module_id=$4 AND revision=$5`, user, language, domain.CourseVersion, module, pack.Revision).Scan(&cursor, &skipped, &task, &reviewed)
err = s.db.QueryRowContext(ctx, `SELECT cursor,skipped_steps,COALESCE(active_task_id,''),reviewed,reused_steps,practice_reason FROM course_v2_sequence_progress WHERE user_id=$1 AND language=$2 AND version=$3 AND module_id=$4 AND revision=$5`, user, language, domain.CourseVersion, module, pack.Revision).Scan(&cursor, &skipped, &task, &reviewed, &reused, &reason)
if err != nil && !errors.Is(err, sql.ErrNoRows) {
return nil, err
}
r := recommendationAt(pack, positions, cursor, skipped, task, native)
r.Review = reviewed
r.ReusedSteps = reused
r.PracticeReason = reason
if task != "" && !r.Complete {
answered, err := sequenceAnswered(ctx, s.db, domain.CourseJob{UserID: user, Language: language, ModuleID: module}, pack.Revision)
if err != nil {
@@ -186,6 +202,8 @@ func (s *AdaptiveStore) SequenceRecommendation(ctx context.Context, user, langua
}
type sequenceSelection struct {
Reused int
Reason string
Reset bool
Reviewed bool
Cursor int
@@ -214,9 +232,11 @@ func selectSequence(ctx context.Context, tx *sql.Tx, j domain.CourseJob, candida
}
var cursor, skipped int
var reviewed bool
var reused int
var reason string
reset := false
var active string
err = tx.QueryRowContext(ctx, `SELECT cursor,skipped_steps,COALESCE(active_task_id,''),reviewed FROM course_v2_sequence_progress WHERE user_id=$1 AND language=$2 AND version=$3 AND module_id=$4 AND revision=$5 FOR UPDATE`, j.UserID, j.Language, domain.CourseVersion, j.ModuleID, pack.Revision).Scan(&cursor, &skipped, &active, &reviewed)
err = tx.QueryRowContext(ctx, `SELECT cursor,skipped_steps,COALESCE(active_task_id,''),reviewed,reused_steps,practice_reason FROM course_v2_sequence_progress WHERE user_id=$1 AND language=$2 AND version=$3 AND module_id=$4 AND revision=$5 FOR UPDATE`, j.UserID, j.Language, domain.CourseVersion, j.ModuleID, pack.Revision).Scan(&cursor, &skipped, &active, &reviewed, &reused, &reason)
if err != nil {
return nil, 0, err
}
@@ -252,19 +272,53 @@ func selectSequence(ctx context.Context, tx *sql.Tx, j domain.CourseJob, candida
active = ""
}
}
r := recommendationAt(pack, positions, cursor, skipped, active, j.InstructionLanguage)
r.Review = reviewed
selection := &sequenceSelection{Cursor: cursor, Skipped: skipped, Recommendation: r, Reviewed: reviewed, Reset: reset}
if r.Complete {
return selection, 0, nil
}
for n, candidate := range candidates {
if candidate.bankEntryID == positions[cursor].Step.BankEntryID {
return selection, n, nil
index := 0
if cursor < len(positions) && active != "" {
// Keep a chosen transfer example stable across reload, locale changes,
// retries and fresh Next requests; evidence updates never replace it mid-step.
var bankID string
if err = tx.QueryRowContext(ctx, `SELECT bank_entry_id FROM course_v2_tasks WHERE id=$1 AND owner_id=$2 AND language=$3 AND version=$4 AND exam_id IS NULL`, active, j.UserID, j.Language, domain.CourseVersion).Scan(&bankID); err != nil {
return nil, 0, err
}
index = -1
for n, candidate := range candidates {
if candidate.bankEntryID == bankID {
index = n
break
}
}
if index < 0 {
return nil, 0, ErrCourseVariantUnavailable
}
} else if cursor < len(positions) {
now := time.Now().UTC()
history, err := readFoundationHistory(ctx, tx, j, now)
if err != nil {
return nil, 0, err
}
for cursor < len(positions) {
var reuse bool
index, reuse, reason = chooseFoundation(positions[cursor].Step, candidates, history, now)
if index < 0 {
return nil, 0, ErrCourseVariantUnavailable
}
if !reuse {
break
}
cursor++
reused++
reset = true
reviewed = false
}
}
return nil, 0, ErrCourseVariantUnavailable
r := recommendationAt(pack, positions, cursor, skipped, active, j.InstructionLanguage)
r.Review = reviewed
r.ReusedSteps = reused
r.PracticeReason = reason
selection := &sequenceSelection{Cursor: cursor, Skipped: skipped, Recommendation: r, Reviewed: reviewed, Reset: reset, Reused: reused, Reason: reason}
return selection, index, nil
}
func saveSequenceSelection(ctx context.Context, tx *sql.Tx, j domain.CourseJob, selection *sequenceSelection, taskID string) error {
if selection == nil {
return nil
@@ -275,7 +329,7 @@ func saveSequenceSelection(ctx context.Context, tx *sql.Tx, j domain.CourseJob,
}
r.TaskID = taskID
r.NeedsAnswer = taskID != ""
_, err := tx.ExecContext(ctx, `UPDATE course_v2_sequence_progress SET cursor=$6,skipped_steps=$7,presented_at=CASE WHEN $9 OR active_task_id IS DISTINCT FROM NULLIF($8,'') THEN now() ELSE presented_at END,active_task_id=NULLIF($8,''),reviewed=$10 WHERE user_id=$1 AND language=$2 AND version=$3 AND module_id=$4 AND revision=$5`, j.UserID, j.Language, domain.CourseVersion, j.ModuleID, r.Revision, selection.Cursor, selection.Skipped, taskID, selection.Reset, selection.Reviewed)
_, err := tx.ExecContext(ctx, `UPDATE course_v2_sequence_progress SET cursor=$6,skipped_steps=$7,presented_at=CASE WHEN $9 OR active_task_id IS DISTINCT FROM NULLIF($8,'') THEN now() ELSE presented_at END,active_task_id=NULLIF($8,''),reviewed=$10,reused_steps=$11,practice_reason=$12 WHERE user_id=$1 AND language=$2 AND version=$3 AND module_id=$4 AND revision=$5`, j.UserID, j.Language, domain.CourseVersion, j.ModuleID, r.Revision, selection.Cursor, selection.Skipped, taskID, selection.Reset, selection.Reviewed, selection.Reused, selection.Reason)
return err
}
@@ -48,6 +48,18 @@ func TestReviewedSequencesProtectPreparation(t *testing.T) {
t.Fatal("missing Russian topic accepted")
}
})
t.Run("transfer stays in the reviewed grammar pattern", func(t *testing.T) {
copy := copyPack()
for i := range copy.Sequences[0].Steps {
if copy.Sequences[0].Steps[i].Phase == "grammar" {
copy.Sequences[0].Steps[i].Alternatives = []string{"a1bank_en_v1_introductions_vocabulary_01"}
break
}
}
if validateSequences(copy, base) == nil {
t.Fatal("unrelated transfer accepted")
}
})
for _, module := range []string{"introductions", "family", "numbers_time", "daily_life", "food_shopping", "home_city"} {
positions := sequencePositions(pack, "a1_"+module+"_v1")
if len(positions) == 0 || positions[0].Step.Phase != "listen" {
@@ -1,3 +1,3 @@
{
"sha256": "808b5b14d40eeee0d4cd47f584532e71c6bbb1a9c090d0166fd055861213efa8"
"sha256": "dcba655de48bc8839d26b5f4d858f33a208cae7bd4731c30956aad0567214ae5"
}
+459 -77
View File
@@ -1,6 +1,7 @@
{
"revision": "thematic-A1-v1",
"editorial_review_sha256": "324686f3d9d33eac46063cca2530feae3cf4f8337d9b4f73a700b38bd70f5727",
"selection_revision": "adaptive-repetition-v1",
"editorial_review_sha256": "edeff4514292866d97f8cd59cc539844de952dd1ee1516be38b47e3eb2c58418",
"sequences": [
{
"id": "introductions_scene_13",
@@ -40,15 +41,36 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01",
"alternatives": [
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_05"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_05",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_06"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_06",
"alternatives": [
"a1bank_en_v1_introductions_grammar_13",
"a1bank_en_v1_introductions_grammar_14",
"a1bank_en_v1_introductions_grammar_19"
]
},
{
"phase": "write",
@@ -102,11 +124,17 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_11"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_11",
"alternatives": [
"a1bank_en_v1_introductions_grammar_18"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_12"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_12",
"alternatives": [
"a1bank_en_v1_introductions_grammar_08"
]
},
{
"phase": "write",
@@ -156,7 +184,15 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01",
"alternatives": [
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
@@ -210,11 +246,24 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_03"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_03",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_13"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_13",
"alternatives": [
"a1bank_en_v1_introductions_grammar_06",
"a1bank_en_v1_introductions_grammar_14",
"a1bank_en_v1_introductions_grammar_19"
]
},
{
"phase": "write",
@@ -268,11 +317,24 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_04"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_04",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_14"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_14",
"alternatives": [
"a1bank_en_v1_introductions_grammar_06",
"a1bank_en_v1_introductions_grammar_13",
"a1bank_en_v1_introductions_grammar_19"
]
},
{
"phase": "write",
@@ -330,11 +392,27 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_09"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_09",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_10"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_10",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09"
]
},
{
"phase": "write",
@@ -388,11 +466,27 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_09"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_09",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_10"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_10",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09"
]
},
{
"phase": "write",
@@ -446,11 +540,24 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01",
"alternatives": [
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_06"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_06",
"alternatives": [
"a1bank_en_v1_introductions_grammar_13",
"a1bank_en_v1_introductions_grammar_14",
"a1bank_en_v1_introductions_grammar_19"
]
},
{
"phase": "write",
@@ -508,11 +615,27 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_01",
"alternatives": [
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_05",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_05"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_05",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "write",
@@ -570,11 +693,24 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_05"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_05",
"alternatives": [
"a1bank_en_v1_introductions_grammar_01",
"a1bank_en_v1_introductions_grammar_02",
"a1bank_en_v1_introductions_grammar_03",
"a1bank_en_v1_introductions_grammar_04",
"a1bank_en_v1_introductions_grammar_09",
"a1bank_en_v1_introductions_grammar_10"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_introductions_grammar_06"
"bank_entry_id": "a1bank_en_v1_introductions_grammar_06",
"alternatives": [
"a1bank_en_v1_introductions_grammar_13",
"a1bank_en_v1_introductions_grammar_14",
"a1bank_en_v1_introductions_grammar_19"
]
},
{
"phase": "write",
@@ -628,11 +764,22 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_09"
"bank_entry_id": "a1bank_en_v1_family_grammar_09",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_02",
"a1bank_en_v1_family_grammar_03",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_14"
"bank_entry_id": "a1bank_en_v1_family_grammar_14",
"alternatives": [
"a1bank_en_v1_family_grammar_08",
"a1bank_en_v1_family_grammar_15"
]
},
{
"phase": "write",
@@ -686,11 +833,22 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_01"
"bank_entry_id": "a1bank_en_v1_family_grammar_01",
"alternatives": [
"a1bank_en_v1_family_grammar_02",
"a1bank_en_v1_family_grammar_03",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_09",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_15"
"bank_entry_id": "a1bank_en_v1_family_grammar_15",
"alternatives": [
"a1bank_en_v1_family_grammar_08",
"a1bank_en_v1_family_grammar_14"
]
},
{
"phase": "write",
@@ -736,11 +894,22 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_02"
"bank_entry_id": "a1bank_en_v1_family_grammar_02",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_03",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_09",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_08"
"bank_entry_id": "a1bank_en_v1_family_grammar_08",
"alternatives": [
"a1bank_en_v1_family_grammar_14",
"a1bank_en_v1_family_grammar_15"
]
},
{
"phase": "write",
@@ -782,7 +951,14 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_03"
"bank_entry_id": "a1bank_en_v1_family_grammar_03",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_02",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_09",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
@@ -832,11 +1008,25 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_03"
"bank_entry_id": "a1bank_en_v1_family_grammar_03",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_02",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_09",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_16"
"bank_entry_id": "a1bank_en_v1_family_grammar_16",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_02",
"a1bank_en_v1_family_grammar_03",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_09"
]
},
{
"phase": "write",
@@ -878,11 +1068,22 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_02"
"bank_entry_id": "a1bank_en_v1_family_grammar_02",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_03",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_09",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_14"
"bank_entry_id": "a1bank_en_v1_family_grammar_14",
"alternatives": [
"a1bank_en_v1_family_grammar_08",
"a1bank_en_v1_family_grammar_15"
]
},
{
"phase": "write",
@@ -924,11 +1125,19 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_04"
"bank_entry_id": "a1bank_en_v1_family_grammar_04",
"alternatives": [
"a1bank_en_v1_family_grammar_05",
"a1bank_en_v1_family_grammar_13"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_14"
"bank_entry_id": "a1bank_en_v1_family_grammar_14",
"alternatives": [
"a1bank_en_v1_family_grammar_08",
"a1bank_en_v1_family_grammar_15"
]
},
{
"phase": "write",
@@ -970,11 +1179,22 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_03"
"bank_entry_id": "a1bank_en_v1_family_grammar_03",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_02",
"a1bank_en_v1_family_grammar_06",
"a1bank_en_v1_family_grammar_09",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_05"
"bank_entry_id": "a1bank_en_v1_family_grammar_05",
"alternatives": [
"a1bank_en_v1_family_grammar_04",
"a1bank_en_v1_family_grammar_13"
]
},
{
"phase": "write",
@@ -1028,7 +1248,11 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_13"
"bank_entry_id": "a1bank_en_v1_family_grammar_13",
"alternatives": [
"a1bank_en_v1_family_grammar_04",
"a1bank_en_v1_family_grammar_05"
]
},
{
"phase": "write",
@@ -1082,7 +1306,14 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_family_grammar_06"
"bank_entry_id": "a1bank_en_v1_family_grammar_06",
"alternatives": [
"a1bank_en_v1_family_grammar_01",
"a1bank_en_v1_family_grammar_02",
"a1bank_en_v1_family_grammar_03",
"a1bank_en_v1_family_grammar_09",
"a1bank_en_v1_family_grammar_16"
]
},
{
"phase": "grammar",
@@ -1140,11 +1371,17 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_04"
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_04",
"alternatives": [
"a1bank_en_v1_numbers_time_grammar_13"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_12"
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_12",
"alternatives": [
"a1bank_en_v1_numbers_time_grammar_03"
]
},
{
"phase": "grammar",
@@ -1298,7 +1535,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_04"
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_04",
"alternatives": [
"a1bank_en_v1_numbers_time_grammar_13"
]
},
{
"phase": "grammar",
@@ -1356,7 +1596,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_03"
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_03",
"alternatives": [
"a1bank_en_v1_numbers_time_grammar_12"
]
},
{
"phase": "grammar",
@@ -1522,7 +1765,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_12"
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_12",
"alternatives": [
"a1bank_en_v1_numbers_time_grammar_03"
]
},
{
"phase": "grammar",
@@ -1584,7 +1830,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_03"
"bank_entry_id": "a1bank_en_v1_numbers_time_grammar_03",
"alternatives": [
"a1bank_en_v1_numbers_time_grammar_12"
]
},
{
"phase": "write",
@@ -1692,11 +1941,25 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_02"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_02",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_03",
"a1bank_en_v1_daily_life_grammar_11",
"a1bank_en_v1_daily_life_grammar_15",
"a1bank_en_v1_daily_life_grammar_16",
"a1bank_en_v1_daily_life_grammar_20"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_03"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_03",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_02",
"a1bank_en_v1_daily_life_grammar_11",
"a1bank_en_v1_daily_life_grammar_15",
"a1bank_en_v1_daily_life_grammar_16",
"a1bank_en_v1_daily_life_grammar_20"
]
},
{
"phase": "write",
@@ -1750,7 +2013,11 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_01"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_01",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_04",
"a1bank_en_v1_daily_life_grammar_05"
]
},
{
"phase": "grammar",
@@ -1804,11 +2071,19 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_04"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_04",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_01",
"a1bank_en_v1_daily_life_grammar_05"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_05"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_05",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_01",
"a1bank_en_v1_daily_life_grammar_04"
]
},
{
"phase": "write",
@@ -1854,7 +2129,14 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_03"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_03",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_02",
"a1bank_en_v1_daily_life_grammar_11",
"a1bank_en_v1_daily_life_grammar_15",
"a1bank_en_v1_daily_life_grammar_16",
"a1bank_en_v1_daily_life_grammar_20"
]
},
{
"phase": "grammar",
@@ -1904,7 +2186,14 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_02"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_02",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_03",
"a1bank_en_v1_daily_life_grammar_11",
"a1bank_en_v1_daily_life_grammar_15",
"a1bank_en_v1_daily_life_grammar_16",
"a1bank_en_v1_daily_life_grammar_20"
]
},
{
"phase": "grammar",
@@ -1958,7 +2247,11 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_04"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_04",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_01",
"a1bank_en_v1_daily_life_grammar_05"
]
},
{
"phase": "grammar",
@@ -2012,11 +2305,17 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_06"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_06",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_09"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_09"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_09",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_06"
]
},
{
"phase": "write",
@@ -2070,11 +2369,21 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_02"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_02",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_03",
"a1bank_en_v1_daily_life_grammar_11",
"a1bank_en_v1_daily_life_grammar_15",
"a1bank_en_v1_daily_life_grammar_16",
"a1bank_en_v1_daily_life_grammar_20"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_09"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_09",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_06"
]
},
{
"phase": "write",
@@ -2128,11 +2437,19 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_04"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_04",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_01",
"a1bank_en_v1_daily_life_grammar_05"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_05"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_05",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_01",
"a1bank_en_v1_daily_life_grammar_04"
]
},
{
"phase": "write",
@@ -2186,11 +2503,25 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_11"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_11",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_02",
"a1bank_en_v1_daily_life_grammar_03",
"a1bank_en_v1_daily_life_grammar_15",
"a1bank_en_v1_daily_life_grammar_16",
"a1bank_en_v1_daily_life_grammar_20"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_15"
"bank_entry_id": "a1bank_en_v1_daily_life_grammar_15",
"alternatives": [
"a1bank_en_v1_daily_life_grammar_02",
"a1bank_en_v1_daily_life_grammar_03",
"a1bank_en_v1_daily_life_grammar_11",
"a1bank_en_v1_daily_life_grammar_16",
"a1bank_en_v1_daily_life_grammar_20"
]
},
{
"phase": "write",
@@ -2306,7 +2637,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_05"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_05",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_06"
]
},
{
"phase": "grammar",
@@ -2426,11 +2760,17 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_05"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_05",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_06"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_06"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_06",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_05"
]
},
{
"phase": "write",
@@ -2484,11 +2824,17 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_08"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_08",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_09"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_09"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_09",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_08"
]
},
{
"phase": "write",
@@ -2538,7 +2884,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_02"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_02",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_01"
]
},
{
"phase": "grammar",
@@ -2596,7 +2945,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_06"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_06",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_05"
]
},
{
"phase": "grammar",
@@ -2650,7 +3002,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_04"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_04",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_20"
]
},
{
"phase": "grammar",
@@ -2704,7 +3059,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_05"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_05",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_06"
]
},
{
"phase": "grammar",
@@ -2758,11 +3116,17 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_09"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_09",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_08"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_20"
"bank_entry_id": "a1bank_en_v1_food_shopping_grammar_20",
"alternatives": [
"a1bank_en_v1_food_shopping_grammar_04"
]
},
{
"phase": "write",
@@ -2916,7 +3280,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_home_city_grammar_02"
"bank_entry_id": "a1bank_en_v1_home_city_grammar_02",
"alternatives": [
"a1bank_en_v1_home_city_grammar_01"
]
},
{
"phase": "grammar",
@@ -3082,7 +3449,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01"
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01",
"alternatives": [
"a1bank_en_v1_home_city_grammar_02"
]
},
{
"phase": "grammar",
@@ -3194,7 +3564,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01"
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01",
"alternatives": [
"a1bank_en_v1_home_city_grammar_02"
]
},
{
"phase": "grammar",
@@ -3248,7 +3621,10 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01"
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01",
"alternatives": [
"a1bank_en_v1_home_city_grammar_02"
]
},
{
"phase": "grammar",
@@ -3298,11 +3674,17 @@
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01"
"bank_entry_id": "a1bank_en_v1_home_city_grammar_01",
"alternatives": [
"a1bank_en_v1_home_city_grammar_02"
]
},
{
"phase": "grammar",
"bank_entry_id": "a1bank_en_v1_home_city_grammar_02"
"bank_entry_id": "a1bank_en_v1_home_city_grammar_02",
"alternatives": [
"a1bank_en_v1_home_city_grammar_01"
]
},
{
"phase": "grammar",