Skip to main content

set_grade_for_testing

Function set_grade_for_testing 

Source
pub async fn set_grade_for_testing(
    conn: &mut PgConnection,
    id: Uuid,
    grade: Option<i32>,
    passed: Option<bool>,
) -> ModelResult<()>
Expand description

Rewrites a completion’s grade in place, so a test can regrade one.

Exists only for test setup, behind the mock study registry’s control surface: a teacher regrade goes through the manual completion flow, which writes a new completion row rather than editing this one, and there is no product path that edits a completion’s grade.