Index

public.exercise_task_gradings

Description

Stores the result of grading done by an exercise service. Either created when a user submits an answer or when we’re regrading answers. Feedback is stored either in textual form (feedback_text) or in a general form (feedback_json).

Columns

Name Type Default Nullable Children Parents Comment
course_id uuid true public.courses The course of this grading. Exists to make certain SQL queries easier. The same information can be obtained though grading.submission.course_instance.course_id.
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.
exam_id uuid true public.exams The exam the grading is associated with.
exercise_id uuid false public.exercises Exercise this grading is related to. Here to make certain SQL queries easier. The same information can be obtained though gradings.exercise_task.exercise_id.
exercise_task_id uuid false public.exercise_tasks
exercise_task_submission_id uuid false public.exercise_task_submissions The submission being graded.
feedback_json jsonb true Feedback from grading in a general form. We do not know the structure of this and it is up to the frontend to decide how it is rendered. Alternatively this can be omitted and feedback_text can be set.
feedback_text text true Feedback from grading in a textual form. We know how to render this to the student, but while simplifying the rendering, this limits the sophistication of the feedback we can display. For more fancy feedback this is left null and feedback_json is used instead.
grading_completed_at timestamp with time zone true When we got the grading result from the exercise service.
grading_priority integer 100 false If there is a queue with the gradings, gradings with lower value will be processed first.
grading_progress grading_progress ‘not-ready’::grading_progress false How the grading progress is progressing. See https://rage.github.io/secret-project-331/headless_lms_actix/models/exercises/enum.GradingProgress.html.
grading_started_at timestamp with time zone true When the grading request was sent to the exercise service.
id uuid uuid_generate_v4() false public.exercise_task_regrading_submissions public.exercise_task_submissions A unique, stable identifier for the record.
score_given real true How many points were given in this grading. This has been scaled to the max points of the exercise.
unscaled_score_given real true How many points the exercise service wanted to give from this exercise. This has not been adjusted to the max score that was specified in the exercise.
unscaled_score_maximum integer true Score maximum we got from the exercise service when doing the grading. This has not been adjusted to the max score specified in the exercise.
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 Comment
course_or_exam_id_set CHECK CHECK (((course_id IS NULL) <> (exam_id IS NULL))) A grading must be associated with either a course or an exam.
gradings_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
gradings_exam_id_fkey FOREIGN KEY FOREIGN KEY (exam_id) REFERENCES exams(id)
gradings_exercise_id_fkey FOREIGN KEY FOREIGN KEY (exercise_id) REFERENCES exercises(id)
gradings_exercise_item_id_fkey FOREIGN KEY FOREIGN KEY (exercise_task_id) REFERENCES exercise_tasks(id)
gradings_pkey PRIMARY KEY PRIMARY KEY (id)
gradings_submission_id_fkey FOREIGN KEY FOREIGN KEY (exercise_task_submission_id) REFERENCES exercise_task_submissions(id)

Indexes

Name Definition
exercise_task_gradings_exercise_task_submission_id_idx CREATE INDEX exercise_task_gradings_exercise_task_submission_id_idx ON public.exercise_task_gradings USING btree (exercise_task_submission_id)
gradings_pkey CREATE UNIQUE INDEX gradings_pkey ON public.exercise_task_gradings USING btree (id)

Triggers

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

Relations

er

Generated by tbls