feat(assessment): grade choice answers with distractors from error models

This commit is contained in:
shira committed 2026-10-11 03:12:24 +03:00
1 parent efa41d5967
commit f1147b1885
22 files changed
+1346 -47

No files matched your search

@@ -621,6 +621,19 @@ func seedAssessmentAttemptHTTPBank(ctx context.Context, t *testing.T, pool *pgxp
// seedAssessmentAttemptHTTPBankWithSignals seeds the attempt fixture bank under
// a product policy that carries the given signal thresholds, or none.
func seedAssessmentAttemptHTTPBankWithSignals(ctx context.Context, t *testing.T, pool *pgxpool.Pool, signals *domain.AssessmentSignalPolicy) {
t.Helper()
seedAssessmentAttemptHTTPBankFrom(ctx, t, pool, signals, loadDemoBundleFile(t))
}
// seedAssessmentAttemptHTTPBankFrom seeds the attempt fixture bank from the
// families of the given bundle, which every fixture category repeats in turn.
func seedAssessmentAttemptHTTPBankFrom(
ctx context.Context,
t *testing.T,
pool *pgxpool.Pool,
signals *domain.AssessmentSignalPolicy,
sourceBundle assessment.Bundle,
) {
t.Helper()
transactor := postgresadapter.NewTransactor(pool)
bank := assessment.NewBank(transactor)
@@ -628,7 +641,7 @@ func seedAssessmentAttemptHTTPBankWithSignals(ctx context.Context, t *testing.T,
publisher := policy.NewPublisher(postgresadapter.NewPolicyStore(pool).Policies(), time.Now)
fixture := assessmentFixture{
ctx: ctx, pool: pool, store: store, transactor: transactor,
bank: bank, publisher: publisher, demoBundle: loadDemoBundleFile(t),
bank: bank, publisher: publisher, demoBundle: sourceBundle,
}
productPolicy := integrationPolicy(11)
productPolicy.Assessment.MaxAttemptsPerWindow = 1