Function headless_lms_models::library::peer_or_self_reviewing::try_to_select_exercise_slide_submission_for_peer_review
source · pub async fn try_to_select_exercise_slide_submission_for_peer_review(
conn: &mut PgConnection,
exercise: &Exercise,
reviewer_user_exercise_state: &UserExerciseState,
fetch_service_info: impl Fn(Url) -> BoxFuture<'static, ModelResult<ExerciseServiceInfoApi>>
) -> ModelResult<CourseMaterialPeerOrSelfReviewData>
Expand description
Tries to select a submission for user to peer review.
The selection process prioritizes peer review queue when selecting a submission for peer review.
In the event where the queue is empty - in practice only when a course has just started - a random
submission is selected instead. This function will only return None
if no other user has made
submissions for the specified exercise.