Skip to main content

Module course_modules

Module course_modules 

Source

Structs§

AutomaticCompletionRequirements
CourseAuditingModuleUpdate
CourseModule
Like CourseModulesSchema, but the automatic-completion columns are collapsed into completion_policy.
CourseModuleCreditRegistrationConfig
Per-module credit-registration configuration: the rollout switch and the module’s own fields merged with its course_module_suotar_configurations row. Every field of that row is optional here because a module with no configuration row is a valid, unconfigured module.
CourseModulesSchema 🔒
The subset of course_modules columns CourseModule is built from; the credit-registration ones are read through CourseModuleCreditRegistrationConfig, hence no SELECT * here.
ModifiedModule
ModuleSizeCounts
How many chapters and exercises a course module contains. Used for deciding whether the module is small enough to be exempt from the minimum cheater threshold.
ModuleUpdates
NewCourseModule
NewModule

Enums§

CompletionPolicy

Functions§

any_credit_registration_enabled
The gate for admin actions that are not tied to one course (e.g. resolving or manually linking a student number), where get_credit_registration_enabled_ids_for_course has no course to check against.
credit_registration_configs 🔒
Shared by every getter below, so the 13-column join lives in one place. enabled_only isn’t a “this id or any” filter like the other two: the by-id and by-course lookups want every module, opted in or not, while the all-modules listing wants only the opted-in ones.
delete
ensure_belong_to_course 🔒
Errors with InvalidRequest unless every module and chapter id is a live row of course_id.
get_all_modules
get_all_suotar_enabled
Every module opted in to credit registration via Suotar, paused ones included.
get_all_uh_course_codes_for_open_university
get_by_course_id
get_by_course_id_as_map
Gets course modules for the given course as a map, indexed by the id field.
get_by_course_id_only_with_open_chapters
get_by_course_ids
Batched get_by_course_id: modules for many courses in one query, to group in memory instead of one query per course.
get_by_exercise_id
Gets course module where the given exercise belongs to. This will result in an error in the case of an exam exercise.
get_by_id
get_by_ids
get_chapter_and_exercise_counts
get_course_module_id_by_chapter
get_credit_registration_config
get_credit_registration_configs_by_course_id
Every module of one course with its Suotar configuration, opted in or not: the module editor has to show an unconfigured module’s empty fields.
get_credit_registration_course_ids_for_enrolled_user
Every course the user is enrolled on that has at least one module opted in to credit registration, so the profile page can list a course the student was never asked about.
get_credit_registration_enabled_ids_for_course
Ids of the course’s modules opted in to credit registration; the flag is not on the CourseModule DTO.
get_default_by_course_id
get_ids_by_course_slug_or_uh_course_code
Gets all course modules with a matching uh_course_code or course slug.
get_ids_registering_eligible_new_completions_via_suotar
Ids of the courses’ modules whose new completions go through credit registration via Suotar when the student holds a linked student number.
insert
rename
set_register_eligible_new_completions_via_suotar
Sets register_eligible_new_completions_via_suotar, which production sets by hand only. Errors if the module is not opted in to credit registration via Suotar.
update
update_automatic_completion_status
update_certification_enabled
update_enable_registering_completion_to_uh_open_university
update_modules
Applies the module editor’s changes to course_id in one transaction.
update_uh_course_code
update_with_order_number
validate_completion_registration_link
Errors with InvalidRequest unless link is empty or an absolute https:// URL. Students get the link as an href, so no other scheme may be stored.
would_change_credit_registration_via_suotar
Whether applying updates to course_id would flip enable_credit_registration_via_suotar on any module.