Skip to main content

Module materialize

Module materialize 

Source
Expand description

Creating ledger rows for completions that are allowed to be registered. It catches up as well as keeps up: any completion carrying the push-path flag and still missing a row gets one, stopping at pending, because historical completions belong to students nobody ever asked. Turning a module on reaches none made before it: register_credits_via_suotar is set at creation or by hand.

Structs§

UnmaterialisedCompletion
A completion that should have a ledger row and has none.

Constants§

GRADE_IMPROVEMENT_LIMIT
How many re-attempts one iteration may start. Bounded apart from MATERIALIZE_LIMIT because each of these costs a round trip to the study registry for a credit the student already has.
MATERIALIZE_LIMIT
How many rows one iteration may create, and so the rate at which a catch-up drains.

Functions§

ensure_registration_rows_for_eligible_completions
Creates a pending row and its created event for every registrable completion that has none; returns the count.
get_unmaterialised_eligible_completions
Completions ensure_registration_rows_for_eligible_completions should have picked up at least min_age_secs ago and did not.
start_re_attempts_for_improved_grades
Starts a new attempt at ready_to_submit for every accepted attempt whose completion has since been graded higher; returns how many were started.