Skip to main content

set_try_limit

Function set_try_limit 

Source
pub async fn set_try_limit(
    conn: &mut PgConnection,
    id: Uuid,
    limit_number_of_tries: bool,
    max_tries_per_slide: Option<i32>,
) -> ModelResult<()>
Expand description

Sets how many tries an exercise allows per slide.

max_tries_per_slide is enforced only while limit_number_of_tries is set; otherwise it just remembers what the teacher last typed, so clearing the flag does not discard the number.