Skip to content
30 changes: 30 additions & 0 deletions src/ol_dbt/models/reporting/_reporting__models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1370,3 +1370,33 @@ models:
- name: user_latest_row_desc
description: integer, row number indicating the latest row for each user based
on application and course run dates

- name: instructor_module_problems_report

@rachellougee rachellougee Jun 18, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add some tests in this new model? At minimum: not_null on user_email, courserun_readable_id, and problem_name. A unique combined key to prevent fan-out.

description: A report showing learner problem data for later roll-up at the instructor
level.
columns:
- name: user_email
description: string, email address of the user
- name: full_name
description: string, full name of the user
- name: courserun_readable_id
description: string, unique identifier for the course run formatted as course-v1:{org}+{course
code}+{run_tag}
- name: section_title
description: string, title of the chapter (section) block within the course
- name: subsection_title
description: string, title of the sequential (subsection) block within the course
- name: problem_name
description: string, name of the problem
- name: attempt
description: int, attempt number for the user's submission
- name: success
description: string, correctness of the attempt (e.g. 'correct' or 'incorrect')
- name: grade
description: number, grade received for this attempt
- name: platform
description: string, platform code (e.g. mitxonline, mitxpro, edxorg, residential)
- name: course_title
description: string, title of the course
- name: organization_name
description: string, name of the organization
88 changes: 88 additions & 0 deletions src/ol_dbt/models/reporting/instructor_module_problems_report.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
with enrollment as (
select * from {{ ref('tfact_enrollment') }}
)

, user as (
select * from {{ ref('dim_user') }}
)

, course_run as (
select * from {{ ref('dim_course_run') }}
where is_current = true
)
Comment thread
Copilot marked this conversation as resolved.

, problem as (
select * from {{ ref('dim_problem') }}
)

, problem_events as (
select * from {{ ref('tfact_problem_events') }}
)

, course_content as (
select * from {{ ref('dim_course_content') }}
)

, course as (
select * from {{ ref('dim_course') }}
where is_current = true
)
Comment thread
Copilot marked this conversation as resolved.

, organization_courserun as (
select * from {{ ref('bridge_organization_courserun') }}
)

, organization as (
select * from {{ ref('dim_organization') }}
)

select
user.email as user_email
, user.full_name
, course_run.courserun_readable_id
, section.block_title as section_title
, subsection.block_title as subsection_title
, problem.problem_name
, problem_events.attempt
, problem_events.success
, problem_events.grade
, enrollment.platform
, course.course_title
, organization.organization_name
from enrollment
inner join user
on enrollment.user_fk = user.user_pk
inner join course_run
on enrollment.courserun_fk = course_run.courserun_pk
inner join problem
on
course_run.courserun_readable_id = problem.courserun_readable_id
and course_run.platform = problem.platform
left join problem_events

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This left join produced a lot of empty rows where attempt, success, and grade are all null have no actionable value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they want to see when learners don't complete problems- however I agree it's too many records I'm checking with the requestor- waiting for a reply

on
problem.problem_block_pk = problem_events.problem_block_fk
and problem.platform = problem_events.platform
and problem.courserun_readable_id = problem_events.courserun_readable_id
and user.user_pk = problem_events.user_fk
Comment thread
Copilot marked this conversation as resolved.
left join course_content as content
on
problem.content_block_fk = content.content_block_pk
and content.is_latest = true
left join course_content as section
on
content.chapter_block_id = section.block_id
and content.platform = section.platform
and content.courserun_readable_id = section.courserun_readable_id
and section.is_latest = true
Comment thread
Copilot marked this conversation as resolved.
left join course_content as subsection
on
content.sequential_block_id = subsection.block_id
and content.platform = subsection.platform
and content.courserun_readable_id = subsection.courserun_readable_id
and subsection.is_latest = true
Comment thread
Copilot marked this conversation as resolved.
left join course
on course_run.course_fk = course.course_pk
left join organization_courserun
on course_run.courserun_pk = organization_courserun.courserun_fk
left join organization
on organization_courserun.organization_fk = organization.organization_pk