Skip to main content

snapshot_and_fail_completions

Function snapshot_and_fail_completions 

Source
pub async fn snapshot_and_fail_completions(
    conn: &mut PgConnection,
    course_id: Uuid,
    user_id: Uuid,
) -> ModelResult<()>
Expand description

Snapshots the current passed/grade of all of a user’s completions in a course and then fails them (passed = false, grade = 0) as the consequence of a confirmed cheating suspicion. The snapshots let the failure be undone exactly if the suspicion is later dismissed (see restore_and_clear_for_user_course). A completion that already has an active snapshot is left as-is, so confirming an already-confirmed student does not overwrite the original values.