Index

public.course_modules

Description

A module is a collection of chapters which can be used to categorise the chapters of a course.

Columns

Name Type Default Nullable Children Parents Comment
automatic_completion_number_of_exercises_attempted_treshold integer true The number of exercises that need to be attempted (submitted at least once): for by_requirements to get a completion, for by_exam to take the exam. NULL for the other completion methods.
automatic_completion_number_of_points_treshold integer true The number of points that need to be gained: for by_requirements to get a completion, for by_exam to take the exam. NULL for the other completion methods.
certification_enabled boolean false false
completion_method course_module_completion_method ‘not_decided’::course_module_completion_method false How students get a completion. by_requirements completes them automatically once they reach the thresholds; by_exam once they reach the pass mark of an ended exam linked to the course, the thresholds then being the condition for taking the exam; teacher_adds and not_decided never complete anyone automatically.
completion_registration_link_override varchar(255) true If not null, use this link rather than the default one when registering course completions.
copied_from uuid true public.course_modules The original course modules record of a copy.
course_id uuid false public.chapters public.courses A module belongs to a course.
created_at timestamp with time zone now() false Timestamp when the record was created.
credit_registration_route course_module_credit_registration_route ‘platform’::course_module_credit_registration_route false How completions turn into credits: platform registers them in Sisu; external means the teacher registers the credits outside this platform (e.g. straight from Examinarium); certificate_only registers nothing. Only platform completions are ever registered by this platform, course code or not.
deleted_at timestamp with time zone true Timestamp when the record was deleted. If null, the record is not deleted.
ects_credits real true The amount of ECTS credits that the student can earn by completing this course module.
exam_location_description text true Where the exam is held, as the teacher describes it, when exam_requirement is elsewhere.
exam_requirement course_module_exam_requirement ‘none’::course_module_exam_requirement false Whether passing the module requires an exam and where it is held: on this platform (an exam linked to the course), in Examinarium, or elsewhere. The platform knows nothing about Examinarium or other outside exams.
id uuid uuid_generate_v4() false public.certificate_configuration_to_requirements public.chapters public.cheater_thresholds public.code_giveaways public.course_module_completion_registered_to_study_registries public.course_module_completions public.course_module_suotar_configurations public.course_modules public.credit_registration_enrolment_check_outcomes public.credit_registrations public.suspected_cheaters A unique, stable identifier for the record.
name varchar(255) true The name of the module. Null in this field will mean that the module is the default for that course.
order_number integer false Defines the order in which the modules are shown. The index 0 is reserved for the default module of the course.
uh_course_code varchar(255) true University of Helsinki’s recognized identifier for the course. E.g. BSCS1001 (Introduction to Programming)
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.

Viewpoints

Name Definition
Credit registration How a completed course module becomes a credit in the University of Helsinki study registry. Enrolment on the course is itself the student’s consent to register the credit; once a student number is proven to be theirs, one ledger row per completion is pushed to Sisu through Suotar and polled until the registry confirms the attainment.

Constraints

Name Type Definition Comment
course_module_completion_method_fits_exam CHECK CHECK (
CASE completion_method
WHEN ‘by_requirements’::course_module_completion_method THEN (exam_requirement = ‘none’::course_module_exam_requirement)
WHEN ‘by_exam’::course_module_completion_method THEN (exam_requirement = ‘platform’::course_module_exam_requirement)
ELSE true
END)
course_module_completion_requirements_validity CHECK CHECK (
CASE completion_method
WHEN ‘by_requirements’::course_module_completion_method THEN (COALESCE(automatic_completion_number_of_exercises_attempted_treshold, automatic_completion_number_of_points_treshold) IS NOT NULL)
WHEN ‘by_exam’::course_module_completion_method THEN true
ELSE ((automatic_completion_number_of_exercises_attempted_treshold IS NULL) AND (automatic_completion_number_of_points_treshold IS NULL))
END)
course_module_exam_location_described CHECK CHECK (((exam_requirement <> ‘elsewhere’::course_module_exam_requirement) OR (COALESCE(TRIM(BOTH FROM exam_location_description), ’‘::text) <>’’::text)))
course_modules_certification_enabled_not_null n NOT NULL certification_enabled
course_modules_completion_method_not_null n NOT NULL completion_method
course_modules_copied_from_fkey FOREIGN KEY FOREIGN KEY (copied_from) REFERENCES course_modules(id)
course_modules_course_id_fkey FOREIGN KEY FOREIGN KEY (course_id) REFERENCES courses(id)
course_modules_course_id_not_null n NOT NULL course_id
course_modules_created_at_not_null n NOT NULL created_at
course_modules_credit_registration_route_not_null n NOT NULL credit_registration_route
course_modules_exam_requirement_not_null n NOT NULL exam_requirement
course_modules_id_not_null n NOT NULL id
course_modules_order_number_not_null n NOT NULL order_number
course_modules_order_number_uniqueness UNIQUE UNIQUE NULLS NOT DISTINCT (course_id, order_number, deleted_at) DEFERRABLE Deferrable so that publishing an agent changeset and saving the module editor can swap module order numbers within one transaction.
course_modules_pkey PRIMARY KEY PRIMARY KEY (id)
course_modules_updated_at_not_null n NOT NULL updated_at
default_course_module_is_first_in_order CHECK CHECK (((name IS NULL) = (order_number = 0)))
uh_course_code_not_empty_string CHECK CHECK ((TRIM(BOTH FROM uh_course_code) <> ’’::text))

Indexes

Name Definition
course_modules_courses_key CREATE UNIQUE INDEX course_modules_courses_key ON public.course_modules USING btree (id, course_id)
course_modules_order_number_uniqueness CREATE UNIQUE INDEX course_modules_order_number_uniqueness ON public.course_modules USING btree (course_id, order_number, deleted_at) NULLS NOT DISTINCT
course_modules_pkey CREATE UNIQUE INDEX course_modules_pkey ON public.course_modules USING btree (id)

Triggers

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

Relations

er

Generated by tbls