Index

public.exercise_task_submissions

Description

A returned exercise task. The system is oblivious to the structure of the submission. Does not contain anything related to points or grading.

Columns

Name Type Default Nullable Children Parents Comment
created_at timestamp with time zone now() false Timestamp when the record was created
data_json jsonb true The content of the submission. We do not know what is the structure of this field as it depends on the exercise service.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
exercise_slide_id uuid false public.exercise_slides public.exercise_slide_submissions public.exercise_tasks The exercise slide where this task submissions belongs to. Used to make sure that both the task and slide submissions belongs to the same slide.
exercise_slide_submission_id uuid false public.exercise_slide_submissions exercise_slide_submission that this task submission is a part of.
exercise_task_grading_id uuid true public.exercise_task_gradings A submission can have many gradings. This points to the latest grading for this submission where we are determining the given score for this submission. If the system grades the submission again and wishes to update the score, it will update this id to point to the new grading.
exercise_task_id uuid false public.exercise_tasks Exercise task that was attempted in this submission.
id uuid uuid_generate_v4() false public.exercise_task_gradings public.exercise_task_regrading_submissions A unique, stable identifier for the record.
metadata jsonb true Additional data attached to the submission
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.

Constraints

Name Type Definition
exercise_slide_submission_fk FOREIGN KEY FOREIGN KEY (exercise_slide_submission_id, exercise_slide_id) REFERENCES exercise_slide_submissions(id, exercise_slide_id)
exercise_task_fk FOREIGN KEY FOREIGN KEY (exercise_task_id, exercise_slide_id) REFERENCES exercise_tasks(id, exercise_slide_id)
exercise_task_submissions_exercise_slide_id_fkey FOREIGN KEY FOREIGN KEY (exercise_slide_id) REFERENCES exercise_slides(id)
exercise_task_submissions_exercise_slide_submission_id_fkey FOREIGN KEY FOREIGN KEY (exercise_slide_submission_id) REFERENCES exercise_slide_submissions(id)
submissions_exercise_item_id_fkey FOREIGN KEY FOREIGN KEY (exercise_task_id) REFERENCES exercise_tasks(id)
submissions_grading_id_fkey FOREIGN KEY FOREIGN KEY (exercise_task_grading_id) REFERENCES exercise_task_gradings(id)
submissions_pkey PRIMARY KEY PRIMARY KEY (id)

Indexes

Name Definition
exercise_task_submissions_exercise_slide_submission_id_idx CREATE INDEX exercise_task_submissions_exercise_slide_submission_id_idx ON public.exercise_task_submissions USING btree (exercise_slide_submission_id)
submissions_pkey CREATE UNIQUE INDEX submissions_pkey ON public.exercise_task_submissions USING btree (id)

Triggers

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

Relations

er

Generated by tbls