pub async fn upsert_peer_review_priority(
conn: &mut PgConnection,
user_id: Uuid,
exercise_id: Uuid,
course_instance_id: Uuid,
peer_review_priority: i32,
receiving_peer_reviews_exercise_slide_submission_id: Uuid,
received_enough_peer_reviews: bool,
) -> ModelResult<PeerReviewQueueEntry>
Expand description
Inserts or updates the queue entry indexed by user_id
, exercise_id
and course_instance_id
.
The value for receiving_peer_reviews_exercise_slide_submission_id
never changes after the initial
insertion. This is to make sure that all received peer reviews are made for the same exercise slide
submission. The same applies to received_enough_peer_reviews
to avoid the scenario where it might
be set from true
back to false
.