Skip to main content

apply_enrolment_answer

Function apply_enrolment_answer 

Source
async fn apply_enrolment_answer(
    conn: &mut PgConnection,
    lookup: &AnsweredLookup<'_>,
    check: Option<EnrolmentCheckAnswer<'_>>,
    audit: &ExchangeAudit,
) -> CreditRegistrationResult<Applied>
Expand description

Writes an answered lookup: settles the row as duplicate when a credit it would not beat is already held, fails it when there is nothing to register against, and otherwise freezes the payload and queues the row for import.

What Sisu itself holds is weighed first: if the attainment exists the credit does, so sending the student off to re-enrol would be wrong as well as unnecessary.