Skip to main content

Module enrolment_checks

Module enrolment_checks 

Source
Expand description

Moving one row’s enrolment check schedule: starting it, restarting it for a visit or a check request, scheduling the next check once one answers, batching slow checks, waking rows off a roster and shifting them past a module pause. The ladders are super::enrolment_check_schedule.

Structs§

EnrolmentCheckAnswer
An answered check of a row waiting for an enrolment, logged with the write its answer makes.
EnrolmentCheckStart
The schedule a row starts when it first waits for an enrolment, decided by the preconditions recompute.
RosterEnrolee
One student the roster lists on a module, with every enrolment id it lists them under.
ScheduleFacts 🔒

Enums§

CheckRequestOutcome
What a check request did to the row.

Functions§

add_seen_enrolment_ids 🔒
Adds the enrolment ids a check saw to the row’s seen set, which also marks it checked for wake_for_roster_listing.
is_check_request_limited
Whether a check request would be refused as too soon right now, which is when the buttons that make one are hidden.
is_too_new_for_student_check_request
Whether a row is too new for its student to ask for a check, which hides their buttons and turns a request away as too soon. A teacher’s request has no such wait.
is_within 🔒
lock_schedule 🔒
pull_forward_batched_checks
Brings the slow checks due within BATCH_PULL_FORWARD forward to now when another slow check in scope is released and not yet claimed: they cost nothing extra in the request that goes out for it. A row tried within TRANSIENT_FAILURE_RETRY keeps waiting out its failed lookup.
record_enrolment_check
Logs what a check found and remembers the enrolments it saw for the roster wake-ups, given the row as the answer’s write left it. A lookup that failed in transit was no check and leaves no trace.
record_starts
Writes the schedules rows start with, and ends the checks of the earlier attempts each new row replaces for its student and module.
record_visit
A visit to the registration page while it showed the enrolment instructions. Moves a completed row onto the visited ladder; restarts a visited row at most once a day, and a stopped row of any group. Returns whether the schedule restarted.
request_check
A student or teacher asking for a check, or Done being pressed: restarts the row on the check-requested ladder with its immediate check.
schedule_next_check
Schedules the next check of a row an answer just parked in no_usable_enrolment: the first rung after now, or stopped once the ladder has run out. A row with no schedule yet, such as one import sent back, starts one now.
shift_past_pause
Moves the schedules of a module’s rows past a pause of paused_for, so the pause spends none of their ladder. A batched row stays on a batch boundary. Stopped rows are left as they are.
wake_for_roster_listing
Wakes this module’s rows waiting for an enrolment when the roster lists their student under an enrolment id the row has not seen, stopped rows included, and returns how many it touched.
write_schedule 🔒
Writes a (re)started or advanced schedule. next_attempt_at is only moved for a row parked in no_usable_enrolment, and only ever earlier unless replaces_next_attempt: a row in a resolve state has a check on its way already, and one a roster just woke must stay woken.