diff --git a/CHANGELOG.md b/CHANGELOG.md index a688a35..62dd4c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to ### Added +- Download panel on Teachers Course Video Overview dashboard - Links between Teachers folder dashboards - Metadata panels for Teachers dashboard - Teachers dashboards for video activity diff --git a/src/dashboards/common.libsonnet b/src/dashboards/common.libsonnet index 3f1abc5..bf93d55 100644 --- a/src/dashboards/common.libsonnet +++ b/src/dashboards/common.libsonnet @@ -51,5 +51,6 @@ completed: 'http://adlnet.gov/expapi/verbs/completed', initialized: 'http://adlnet.gov/expapi/verbs/initialized', played: 'https://w3id.org/xapi/video/verbs/played', + downloaded: 'http://id.tincanapi.com/verb/downloaded', }, } diff --git a/src/dashboards/teachers/details.jsonnet b/src/dashboards/teachers/details.jsonnet index e7c7c7b..89ff4d1 100644 --- a/src/dashboards/teachers/details.jsonnet +++ b/src/dashboards/teachers/details.jsonnet @@ -65,7 +65,7 @@ dashboard.new( timeField='timestamp' ) ), - gridPos={ x: 0, y: 1, w: 4.8, h: 4.5 } + gridPos={ x: 0, y: 1, w: 4.8, h: 3 } ) .addPanel( statPanel.new( @@ -137,7 +137,7 @@ dashboard.new( timeField='timestamp' ) ), - gridPos={ x: 0, y: 4, w: 4.8, h: 4.5 }, + gridPos={ x: 0, y: 3, w: 4.8, h: 3 }, ) .addPanel( statPanel.new( @@ -176,6 +176,41 @@ dashboard.new( ), gridPos={ x: 4.8, y: 3, w: 4.8, h: 3 }, ) +.addPanel( + statPanel.new( + title='Downloads', + description=||| + Number of video downloads. + |||, + datasource=common.datasources.lrs, + reducerFunction='sum', + graphMode='none', + unit='none' + ).addTarget( + elasticsearch.target( + datasource=common.datasources.lrs, + query='%(video_query)s AND verb.id:"%(verb_downloaded)s"' % { + video_query: teachers_common.queries.video_id, + verb_downloaded: common.verb_ids.downloaded, + }, + metrics=[common.metrics.count], + bucketAggs=[ + { + id: 'date', + field: '@timestamp', + type: 'date_histogram', + settings: { + interval: '1d', + min_doc_count: '0', + trimEdges: '0', + }, + }, + ], + timeField='timestamp' + ) + ), + gridPos={ x: 0, y: 5, w: 4.8, h: 3 } +) .addPanel( statPanel.new( title='Completion threshold',