-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #696 from SoryRawyer/rds/add-problem-dropoff-chart
feat: add problem engagement dropoff chart to instructor dashboard (FC-0051)
- Loading branch information
Showing
5 changed files
with
317 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
...pects-superset/openedx-assets/assets/charts/Problem_engagement_by_section_subsection.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
_file_name: Problem_engagement_by_section_subsection.yaml | ||
cache_timeout: null | ||
certification_details: null | ||
certified_by: null | ||
dataset_uuid: 171c88e5-fd4b-4aab-b287-361fa6fa5415 | ||
description: null | ||
params: | ||
adhoc_filters: [] | ||
annotation_layers: [] | ||
color_scheme: supersetColors | ||
comparison_type: values | ||
extra_form_data: {} | ||
forecastInterval: 0.8 | ||
forecastPeriods: 10 | ||
groupby: [] | ||
legendOrientation: top | ||
legendType: scroll | ||
metrics: | ||
- aggregate: null | ||
column: null | ||
datasourceWarning: false | ||
expressionType: SQL | ||
hasCustomLabel: true | ||
label: All problems attempted | ||
optionName: metric_2q7yrcr33gf_xoor1p4yj4k | ||
sqlExpression: |- | ||
countIf("section/subsection problem engagement" = 'All problems attempted') | ||
- aggregate: null | ||
column: null | ||
datasourceWarning: false | ||
expressionType: SQL | ||
hasCustomLabel: true | ||
label: At least one problem attempted | ||
optionName: metric_1ba5vqj4jds_vd7nek7dw9 | ||
sqlExpression: |- | ||
countIf("section/subsection problem engagement" = 'All problems attempted' or "section/subsection problem engagement" = 'At least one problem attempted') | ||
only_total: true | ||
order_desc: true | ||
orientation: vertical | ||
rich_tooltip: true | ||
row_limit: 10000 | ||
show_empty_columns: true | ||
show_legend: true | ||
sort_series_type: sum | ||
time_grain_sqla: P1D | ||
tooltipTimeFormat: smart_date | ||
truncate_metric: true | ||
viz_type: echarts_timeseries_bar | ||
xAxisLabelRotation: 45 | ||
x_axis: section/subsection name | ||
x_axis_sort_asc: true | ||
x_axis_sort_series: name | ||
x_axis_sort_series_ascending: true | ||
x_axis_time_format: smart_date | ||
x_axis_title_margin: 15 | ||
y_axis_bounds: | ||
- null | ||
- null | ||
y_axis_format: SMART_NUMBER | ||
y_axis_title: Number of learners | ||
y_axis_title_margin: 30 | ||
y_axis_title_position: Left | ||
query_context: |- | ||
{"datasource":{"id":537,"type":"table"},"force":false,"queries":[{"filters":[],"extras":{"having":"","where":""},"applied_time_extras":{},"columns":[{"timeGrain":"P1D","columnType":"BASE_AXIS","sqlExpression":"section/subsection name","label":"section/subsection name","expressionType":"SQL"}],"metrics":[{"expressionType":"SQL","sqlExpression":"countIf(\"section/subsection problem engagement\" = 'All problems attempted')","column":null,"aggregate":null,"datasourceWarning":false,"hasCustomLabel":true,"label":"All problems attempted","optionName":"metric_2q7yrcr33gf_xoor1p4yj4k"},{"expressionType":"SQL","sqlExpression":"countIf(\"section/subsection problem engagement\" = 'All problems attempted' or \"section/subsection problem engagement\" = 'At least one problem attempted')","column":null,"aggregate":null,"datasourceWarning":false,"hasCustomLabel":true,"label":"At least one problem attempted","optionName":"metric_1ba5vqj4jds_vd7nek7dw9"}],"orderby":[[{"expressionType":"SQL","sqlExpression":"countIf(\"section/subsection problem engagement\" = 'All problems attempted')","column":null,"aggregate":null,"datasourceWarning":false,"hasCustomLabel":true,"label":"All problems attempted","optionName":"metric_2q7yrcr33gf_xoor1p4yj4k"},false]],"annotation_layers":[],"row_limit":10000,"series_columns":[],"series_limit":0,"order_desc":true,"url_params":{},"custom_params":{},"custom_form_data":{},"time_offsets":[],"post_processing":[{"operation":"pivot","options":{"index":["section/subsection name"],"columns":[],"aggregates":{"All problems attempted":{"operator":"mean"},"At least one problem attempted":{"operator":"mean"}},"drop_missing_columns":false}},{"operation":"flatten"}]}],"form_data":{"datasource":"537__table","viz_type":"echarts_timeseries_bar","x_axis":"section/subsection name","time_grain_sqla":"P1D","x_axis_sort_asc":true,"x_axis_sort_series":"name","x_axis_sort_series_ascending":true,"metrics":[{"expressionType":"SQL","sqlExpression":"countIf(\"section/subsection problem engagement\" = 'All problems attempted')","column":null,"aggregate":null,"datasourceWarning":false,"hasCustomLabel":true,"label":"All problems attempted","optionName":"metric_2q7yrcr33gf_xoor1p4yj4k"},{"expressionType":"SQL","sqlExpression":"countIf(\"section/subsection problem engagement\" = 'All problems attempted' or \"section/subsection problem engagement\" = 'At least one problem attempted')","column":null,"aggregate":null,"datasourceWarning":false,"hasCustomLabel":true,"label":"At least one problem attempted","optionName":"metric_1ba5vqj4jds_vd7nek7dw9"}],"groupby":[],"adhoc_filters":[],"order_desc":true,"row_limit":10000,"truncate_metric":true,"show_empty_columns":true,"comparison_type":"values","annotation_layers":[],"forecastPeriods":10,"forecastInterval":0.8,"orientation":"vertical","x_axis_title_margin":15,"y_axis_title":"Number of learners","y_axis_title_margin":30,"y_axis_title_position":"Left","sort_series_type":"sum","color_scheme":"supersetColors","only_total":true,"show_legend":true,"legendType":"scroll","legendOrientation":"top","x_axis_time_format":"smart_date","xAxisLabelRotation":45,"y_axis_format":"SMART_NUMBER","y_axis_bounds":[null,null],"rich_tooltip":true,"tooltipTimeFormat":"smart_date","extra_form_data":{},"dashboards":[1642],"force":false,"result_format":"json","result_type":"full"},"result_format":"json","result_type":"full"} | ||
slice_name: Problem engagement by section/subsection | ||
uuid: 158b1b84-0784-4cc7-8e67-3ee3be7460c2 | ||
version: 1.0.0 | ||
viz_type: echarts_timeseries_bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
114 changes: 114 additions & 0 deletions
114
...spects/build/aspects-superset/openedx-assets/assets/datasets/fact_problem_engagement.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
_file_name: fact_problem_engagement.yaml | ||
cache_timeout: null | ||
columns: | ||
- advanced_data_type: null | ||
column_name: section/subsection problem engagement | ||
description: null | ||
expression: null | ||
extra: null | ||
filterable: true | ||
groupby: true | ||
is_active: true | ||
is_dttm: false | ||
python_date_format: null | ||
type: String | ||
verbose_name: null | ||
- advanced_data_type: null | ||
column_name: section/subsection name | ||
description: null | ||
expression: null | ||
extra: null | ||
filterable: true | ||
groupby: true | ||
is_active: true | ||
is_dttm: false | ||
python_date_format: null | ||
type: String | ||
verbose_name: null | ||
- advanced_data_type: null | ||
column_name: content level | ||
description: null | ||
expression: null | ||
extra: null | ||
filterable: true | ||
groupby: true | ||
is_active: true | ||
is_dttm: false | ||
python_date_format: null | ||
type: String | ||
verbose_name: null | ||
- advanced_data_type: null | ||
column_name: actor_id | ||
description: null | ||
expression: null | ||
extra: null | ||
filterable: true | ||
groupby: true | ||
is_active: true | ||
is_dttm: false | ||
python_date_format: null | ||
type: String | ||
verbose_name: null | ||
- advanced_data_type: null | ||
column_name: course_key | ||
description: null | ||
expression: null | ||
extra: null | ||
filterable: true | ||
groupby: true | ||
is_active: true | ||
is_dttm: false | ||
python_date_format: null | ||
type: String | ||
verbose_name: null | ||
- advanced_data_type: null | ||
column_name: course_run | ||
description: null | ||
expression: null | ||
extra: null | ||
filterable: true | ||
groupby: true | ||
is_active: true | ||
is_dttm: false | ||
python_date_format: null | ||
type: String | ||
verbose_name: null | ||
- advanced_data_type: null | ||
column_name: org | ||
description: null | ||
expression: null | ||
extra: null | ||
filterable: true | ||
groupby: true | ||
is_active: true | ||
is_dttm: false | ||
python_date_format: null | ||
type: String | ||
verbose_name: null | ||
database_uuid: 21174b6c-4d40-4958-8161-d6c3cf5e77b6 | ||
default_endpoint: null | ||
description: null | ||
extra: null | ||
fetch_values_predicate: null | ||
filter_select_enabled: false | ||
main_dttm_col: null | ||
metrics: | ||
- currency: null | ||
d3format: null | ||
description: null | ||
expression: count(*) | ||
extra: null | ||
metric_name: count | ||
metric_type: null | ||
verbose_name: null | ||
warning_text: null | ||
normalize_columns: true | ||
offset: 0 | ||
params: null | ||
schema: main | ||
sql: |- | ||
{% filter indent(width=2) %}{% include 'openedx-assets/queries/fact_problem_engagement.sql' %}{% endfilter %} | ||
table_name: fact_problem_engagement | ||
template_params: {} | ||
uuid: 171c88e5-fd4b-4aab-b287-361fa6fa5415 | ||
version: 1.0.0 |
78 changes: 78 additions & 0 deletions
78
tutoraspects/templates/openedx-assets/queries/fact_problem_engagement.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
with | ||
subsection_counts as ( | ||
select | ||
org, | ||
course_key, | ||
course_run, | ||
section_with_name, | ||
subsection_with_name, | ||
actor_id, | ||
item_count, | ||
count(distinct problem_id) as problems_attempted, | ||
case | ||
when problems_attempted = 0 | ||
then 'No problems attempted yet' | ||
when problems_attempted = item_count | ||
then 'All problems attempted' | ||
else 'At least one problem attempted' | ||
end as engagement_level | ||
from {{ DBT_PROFILE_TARGET_DATABASE }}.fact_problem_engagement | ||
where | ||
1 = 1 | ||
{% raw %} | ||
{% if from_dttm is not none %} | ||
and attempted_on > date('{{ from_dttm }}') | ||
{% endif %} | ||
{% if to_dttm is not none %} | ||
and attempted_on < date('{{ to_dttm }}') | ||
{% endif %} | ||
{% endraw %} | ||
{% include 'openedx-assets/queries/common_filters.sql' %} | ||
group by | ||
org, | ||
course_key, | ||
course_run, | ||
section_with_name, | ||
subsection_with_name, | ||
actor_id, | ||
item_count | ||
), | ||
section_counts as ( | ||
select | ||
org, | ||
course_key, | ||
course_run, | ||
section_with_name, | ||
actor_id, | ||
sum(item_count) as item_count, | ||
sum(problems_attempted) as problems_attempted, | ||
case | ||
when problems_attempted = 0 | ||
then 'No problems attempted yet' | ||
when problems_attempted = item_count | ||
then 'All problems attempted' | ||
else 'At least one problem attempted' | ||
end as engagement_level | ||
from subsection_counts | ||
group by org, course_key, course_run, section_with_name, actor_id | ||
) | ||
|
||
select | ||
org, | ||
course_key, | ||
course_run, | ||
subsection_with_name as `section/subsection name`, | ||
'subsection' as `content level`, | ||
actor_id as actor_id, | ||
engagement_level as `section/subsection problem engagement` | ||
from subsection_counts | ||
union all | ||
select | ||
org, | ||
course_key, | ||
course_run, | ||
section_with_name as `section/subsection name`, | ||
'section' as `content level`, | ||
actor_id as actor_id, | ||
engagement_level as `section/subsection problem engagement` | ||
from section_counts |