Skip to main content

Module global_stats

Module global_stats 

Source
Expand description

Cross-course counts for /stats and /domain-stats.

Every “registered” number here comes from a registered_completions CTE spelling out the same set: a completion is registered if a third-party registrar recorded it in course_module_completion_registered_to_study_registries, or if a credit_registrations attempt of ours reached registered, duplicate or not_improved. Every other credit registration state leaves the credit’s fate unknown to us and must not be counted either way.

UNION, not UNION ALL, is what keeps the counts honest: one completion routinely has a row in both ledgers, because our pipeline mirrors its successes into the legacy one, and several rows in either — one per registrar there, one per attempt here after a regrade. Deduplicating on the completion is also why a superseded attempt cannot inflate a count, and why a completion whose successor attempt is still in flight keeps the credit its first attempt already earned.

Structs§

CourseCompletionStats
DomainCompletionStats
GlobalCourseModuleStatEntry
GlobalStatEntry

Functions§

get_completion_stats_by_email_domain
Produces a summary of course completions grouped by user’s email domain.
get_course_completion_stats_for_email_domain
Gets course completion statistics for a specific email domain.
get_course_module_stats_by_completions_registered_to_study_registry
get_number_of_people_completed_a_course
get_number_of_people_done_at_least_one_exercise
get_number_of_people_registered_completion_to_study_registry
get_number_of_people_started_course