-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
5 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
52 changes: 52 additions & 0 deletions
52
tutoraspects/templates/openedx-assets/queries/fact_page_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,52 @@ | ||
with | ||
subsection_engagement as ( | ||
select | ||
org, | ||
course_key, | ||
'subsection' as content_level, | ||
actor_id, | ||
subsection_block_id as block_id, | ||
engagement_level as section_subsection_page_engagement | ||
from {{ ASPECTS_XAPI_DATABASE }}.subsection_page_engagement | ||
where 1=1 | ||
{% include 'openedx-assets/queries/common_filters.sql' %} | ||
), | ||
section_engagement as ( | ||
select | ||
org, | ||
course_key, | ||
'section' as content_level, | ||
actor_id, | ||
section_block_id as block_id, | ||
engagement_level as section_subsection_page_engagement | ||
from {{ ASPECTS_XAPI_DATABASE }}.section_page_engagement | ||
), | ||
page_engagement as ( | ||
select * | ||
from subsection_engagement | ||
union all | ||
select * | ||
from section_engagement | ||
) | ||
|
||
select | ||
pv.org as org, | ||
pv.course_key as course_key, | ||
course_blocks.course_run as course_run, | ||
course_blocks.display_name_with_location as section_subsection_name, | ||
pv.content_level as content_level, | ||
pv.actor_id as actor_id, | ||
pv.section_subsection_page_engagement as section_subsection_page_engagement, | ||
users.username as username, | ||
users.name as name, | ||
users.email as email | ||
from page_engagement pv | ||
join | ||
{{ DBT_PROFILE_TARGET_DATABASE }}.dim_course_blocks course_blocks | ||
on ( | ||
pv.org = course_blocks.org | ||
and pv.course_key = course_blocks.course_key | ||
and pv.block_id = course_blocks.block_id | ||
) | ||
left outer join | ||
{{ DBT_PROFILE_TARGET_DATABASE }}.dim_user_pii users on toUUID(pv.actor_id) = users.external_user_id |
4 changes: 0 additions & 4 deletions
4
tutoraspects/templates/openedx-assets/queries/fact_page_views.sql
This file was deleted.
Oops, something went wrong.