pub async fn user_can_take_exam(
    conn: &mut PgConnection,
    exam_id: Uuid,
    user_id: Uuid
) -> ModelResult<bool>
Expand description

Checks whether the student can partake in an exam.

The result of this process depends on the configuration for the exam. If the exam is not linked to any course, the user will always be able to take it by default. Otherwise the student progress in their current selected instances is compared against any of the linked courses, and checked whether any pass the exercise completion tresholds. Finally, if none of the courses have automatic completion configuration, the exam is once again allowed to be taken by default.