Index

public.peer_review_queue_entries

Description

Table for queueing up for peer reviews. Once user has given enough peer reviews, they will get added to this queue where additional peer reviews given will increase their own priority of receiving peer reviews.

Columns

Name Type Default Nullable Children Parents Comment
course_instance_id uuid false public.course_instances The course instance that the user is on. User can queue for the same exercise on multiple different course instances.
created_at timestamp with time zone now() false Timestamp when the record was created. In this table this is the moment when the user has given enough peer reviews
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
exercise_id uuid false public.exercises The exercise that is being peer reviewed.
id uuid uuid_generate_v4() false A unique, stable identifier for the record.
peer_review_priority integer 0 false How fast this user should receive peer reviews. Usually based on the amount of peer reviews given.
received_enough_peer_reviews boolean false false Whether or not this queue entry has already received enough peer reviews. Simply a boolean for performance reasons.
receiving_peer_reviews_exercise_slide_submission_id uuid false public.exercise_slide_submissions The users submission that should receive peer reviews.
removed_from_queue_for_unusual_reason boolean false false If true, the answer won’t be given to others to be peer reviewed. This will not be set to true when user receives enough reviews and concludes the peer review process. This will be set to true for example when teacher grades the answer manually and peer reviews are no longer true or when an anwer would be removed from the peer review queue due to it being spam.
updated_at timestamp with time zone now() false Timestamp when the record was last updated. The field is updated automatically by the set_timestamp trigger.
user_id uuid false public.users The user who is in queue.

Constraints

Name Type Definition
peer_review_queue_entries_course_instance_id_fkey FOREIGN KEY FOREIGN KEY (course_instance_id) REFERENCES course_instances(id)
peer_review_queue_entries_exercise_id_fkey FOREIGN KEY FOREIGN KEY (exercise_id) REFERENCES exercises(id)
peer_review_queue_entries_pkey PRIMARY KEY PRIMARY KEY (id)
peer_review_queue_entries_receiving_peer_reviews_exercise__fkey FOREIGN KEY FOREIGN KEY (receiving_peer_reviews_exercise_slide_submission_id) REFERENCES exercise_slide_submissions(id)
peer_review_queue_entries_user_id_fkey FOREIGN KEY FOREIGN KEY (user_id) REFERENCES users(id)
peer_review_queue_entry_user_exercise_and_course_instance_uniqu UNIQUE UNIQUE NULLS NOT DISTINCT (user_id, exercise_id, course_instance_id, deleted_at)

Indexes

Name Definition
peer_review_priority CREATE INDEX peer_review_priority ON public.peer_review_queue_entries USING btree (peer_review_priority)
peer_review_queue_entries_pkey CREATE UNIQUE INDEX peer_review_queue_entries_pkey ON public.peer_review_queue_entries USING btree (id)
peer_review_queue_entry_user_exercise_and_course_instance_uniqu CREATE UNIQUE INDEX peer_review_queue_entry_user_exercise_and_course_instance_uniqu ON public.peer_review_queue_entries USING btree (user_id, exercise_id, course_instance_id, deleted_at) NULLS NOT DISTINCT

Triggers

Name Definition
set_timestamp CREATE TRIGGER set_timestamp BEFORE UPDATE ON public.peer_review_queue_entries FOR EACH ROW EXECUTE FUNCTION trigger_set_timestamp()

Relations

er

Generated by tbls