Index

public.peer_or_self_review_questions

Description

Question that is a part of a peer review.

Columns

Name Type Default Nullable Children Parents Comment
answer_required boolean true false Whether or not this question needs to be answered to submit the review.
created_at timestamp with time zone now() false Timestamp when the record was created.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
id uuid uuid_generate_v4() false public.peer_or_self_review_question_submissions A unique, stable identifier for the record.
order_number integer false The order in which this question should appear.
peer_or_self_review_config_id uuid false public.peer_or_self_review_configs Peer review that the record is a part of
question varchar(1000) false The concrete question that is presented to the user.
question_type peer_review_question_type false The type of question, for example an essay or a scale.
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.
weight real 0 false The weight of the question in the peer review. The weight is used to calculate the points the student receives from the peer review. The points are calculated by multiplying the weight of the question with the points the student gave to the answer. The points are then summed up and divided by the sum of the weights of all questions in the peer review. The result is rounded to the nearest integer.

Constraints

Name Type Definition
peer_review_question_order_number_uniqueness UNIQUE UNIQUE NULLS NOT DISTINCT (peer_or_self_review_config_id, order_number, deleted_at)
peer_review_questions_peer_review_id_fkey FOREIGN KEY FOREIGN KEY (peer_or_self_review_config_id) REFERENCES peer_or_self_review_configs(id)
peer_review_questions_pkey PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
peer_review_question_order_number_uniqueness CREATE UNIQUE INDEX peer_review_question_order_number_uniqueness ON public.peer_or_self_review_questions USING btree (peer_or_self_review_config_id, order_number, deleted_at) NULLS NOT DISTINCT
peer_review_questions_pkey CREATE UNIQUE INDEX peer_review_questions_pkey ON public.peer_or_self_review_questions USING btree (id)

Triggers

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

Relations

er

Generated by tbls