Skip to content

Commit

Permalink
feat: include current day in instructor dashboard
Browse files Browse the repository at this point in the history
This addresses #246. The query for `fact_enrollments_by_day` is also
updated to extend current enrollment status to tomorrow so that the
current days' enrollment status is included, which in turn makes the
enrollment status available for the chart.
  • Loading branch information
SoryRawyer committed Aug 3, 2023
1 parent 3caa313 commit 19b7b47
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
- _file_name: Instructor_dashboard_9.yaml
_roles:
_roles:
- {{ SUPERSET_ROLES_MAPPING.instructor }}
css: ""
dashboard_title: Instructor dashboard
Expand Down Expand Up @@ -27,9 +27,13 @@
enableEmptyFilter: false
defaultDataMask:
extraFormData:
time_range: Last month
time_range:
'DATEADD(DATETIME("now"), -1, month) : DATEADD(DATETIME("now"),
1, day)'
filterState:
value: Last month
value:
'DATEADD(DATETIME("now"), -1, month) : DATEADD(DATETIME("now"), 1,
day)'
description: ""
filterType: filter_time
id: NATIVE_FILTER-zxfszG4xH
Expand Down Expand Up @@ -174,7 +178,6 @@
- 45
- 46
- 47
- 52
controlValues:
defaultToFirstItem: false
enableEmptyFilter: false
Expand All @@ -196,7 +199,6 @@
- TAB-NR4UTAs9K
tabsInScope:
- TAB-NR4UTAs9K
- TAB-7PGDduCA7
targets:
- column:
name: problem_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ with enrollments_ranked as (
enrollment_status,
enrollment_mode,
emission_time as window_start_at,
lagInFrame(emission_time, 1, now()) over (partition by org, course_name, run_name, actor_id order by emission_time desc) as window_end_at
lagInFrame(emission_time, 1, now() + interval '1' day) over (partition by org, course_name, run_name, actor_id order by emission_time desc) as window_end_at
from
enrollments_ranked
where
Expand All @@ -39,7 +39,7 @@ with enrollments_ranked as (
enrollment_status,
enrollment_mode,
date_trunc('day', window_start_at) as window_start_date,
date_trunc('day', coalesce(window_end_at, now())) as window_end_date
date_trunc('day', window_end_at) as window_end_date
from enrollment_windows
)
select
Expand Down

0 comments on commit 19b7b47

Please sign in to comment.