Skip to content

Commit 8a09d67

Browse files
committed
docs: update docs for 9f52138
1 parent efb3809 commit 8a09d67

18 files changed

+631
-229
lines changed

catalog.json

+1-1
Large diffs are not rendered by default.

compiled/aspects/models/navigation/fact_navigation_completion.sql

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ select
4141
pages.section_with_name as section_with_name,
4242
pages.subsection_with_name as subsection_with_name,
4343
pages.course_order as course_order,
44-
pages.page_count as page_count,
44+
pages.item_count as page_count,
4545
visits.actor_id as actor_id,
4646
visits.block_id as block_id,
4747
users.username as username,
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,50 @@
11
with
2-
subsection_counts as (
2+
subsection_engagement as (
33
select
44
org,
55
course_key,
6-
course_run,
7-
section_with_name,
8-
subsection_with_name,
9-
actor_id,
10-
page_count,
11-
count(distinct block_id) as pages_visited,
12-
case
13-
when pages_visited = 0
14-
then 'No pages viewed yet'
15-
when pages_visited = page_count
16-
then 'All pages viewed'
17-
else 'At least one page viewed'
18-
end as engagement_level
19-
from `xapi`.`fact_navigation_completion`
20-
group by
21-
org,
22-
course_key,
23-
course_run,
24-
section_with_name,
25-
subsection_with_name,
6+
'subsection' as content_level,
267
actor_id,
27-
page_count
8+
subsection_block_id as block_id,
9+
engagement_level as section_subsection_page_engagement
10+
from `xapi`.`subsection_page_engagement`
2811
),
29-
section_counts as (
12+
section_engagement as (
3013
select
3114
org,
3215
course_key,
33-
course_run,
34-
section_with_name,
35-
'' as subsection_with_name,
16+
'section' as content_level,
3617
actor_id,
37-
sum(page_count) as page_count,
38-
sum(pages_visited) as pages_visited,
39-
case
40-
when pages_visited = 0
41-
then 'No pages viewed yet'
42-
when pages_visited = page_count
43-
then 'All pages viewed'
44-
else 'At least one page viewed'
45-
end as engagement_level
46-
from subsection_counts
47-
group by
48-
org,
49-
course_key,
50-
course_run,
51-
section_with_name,
52-
subsection_with_name,
53-
actor_id
54-
),
55-
pageview_counts as (
56-
select
57-
org,
58-
course_key,
59-
course_run,
60-
section_with_name as section_with_name,
61-
subsection_with_name as subsection_with_name,
62-
subsection_with_name as section_subsection_name,
63-
'subsection' as content_level,
64-
actor_id as actor_id,
18+
section_block_id as block_id,
6519
engagement_level as section_subsection_page_engagement
66-
from subsection_counts
20+
from `xapi`.`section_page_engagement`
21+
),
22+
page_engagement as (
23+
select *
24+
from subsection_engagement
6725
union all
68-
select
69-
org,
70-
course_key,
71-
course_run,
72-
section_with_name as section_with_name,
73-
subsection_with_name as subsection_with_name,
74-
section_with_name as section_subsection_name,
75-
'section' as content_level,
76-
actor_id as actor_id,
77-
engagement_level as section_subsection_page_engagement
78-
from section_counts
79-
26+
select *
27+
from section_engagement
8028
)
8129

8230
select
8331
pv.org as org,
8432
pv.course_key as course_key,
85-
pv.course_run as course_run,
86-
pv.section_with_name as section_with_name,
87-
pv.subsection_with_name as subsection_with_name,
88-
pv.section_subsection_name as section_subsection_name,
33+
course_blocks.course_run as course_run,
34+
course_blocks.display_name_with_location as section_subsection_name,
8935
pv.content_level as content_level,
9036
pv.actor_id as actor_id,
9137
pv.section_subsection_page_engagement as section_subsection_page_engagement,
9238
users.username as username,
9339
users.name as name,
9440
users.email as email
95-
from pageview_counts pv
41+
from page_engagement pv
42+
join
43+
`xapi`.`dim_course_blocks` course_blocks
44+
on (
45+
pv.org = course_blocks.org
46+
and pv.course_key = course_blocks.course_key
47+
and pv.block_id = course_blocks.block_id
48+
)
9649
left outer join
97-
`xapi`.`dim_user_pii` users on toUUID(actor_id) = users.external_user_id
50+
`xapi`.`dim_user_pii` users on toUUID(pv.actor_id) = users.external_user_id
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,47 @@
1-
with
2-
pages_per_subsection as (
3-
select
4-
org,
5-
course_key,
6-
section_number,
7-
subsection_number,
8-
course_order,
9-
count(*) as page_count
10-
from `xapi`.`dim_course_blocks`
11-
where block_id like '%@vertical+block@%'
12-
group by org, course_key, section_number, subsection_number, course_order
13-
)
1+
select * from (
2+
with
3+
items_per_subsection as (
4+
select
5+
org,
6+
course_key,
7+
section_number,
8+
subsection_number,
9+
course_order,
10+
graded,
11+
count(*) as item_count
12+
from `xapi`.`dim_course_blocks`
13+
where block_id like '%@vertical+block@%'
14+
group by
15+
org, course_key, section_number, subsection_number, course_order, graded
16+
)
1417

15-
select
16-
pps.org as org,
17-
pps.course_key as course_key,
18-
pps.section_number as section_number,
19-
section_blocks.display_name_with_location as section_with_name,
20-
pps.subsection_number as subsection_number,
21-
subsection_blocks.display_name_with_location as subsection_with_name,
22-
pps.course_order as course_order,
23-
pps.page_count as page_count
24-
from pages_per_subsection pps
25-
left join
26-
`xapi`.`dim_course_blocks` section_blocks
27-
on (
28-
pps.section_number = section_blocks.hierarchy_location
29-
and pps.org = section_blocks.org
30-
and pps.course_key = section_blocks.course_key
31-
and section_blocks.block_id like '%@chapter+block@%'
32-
)
33-
left join
34-
`xapi`.`dim_course_blocks` subsection_blocks
35-
on (
36-
pps.subsection_number = subsection_blocks.hierarchy_location
37-
and pps.org = subsection_blocks.org
38-
and pps.course_key = subsection_blocks.course_key
39-
and subsection_blocks.block_id like '%@sequential+block@%'
40-
)
18+
select
19+
ips.org as org,
20+
ips.course_key as course_key,
21+
ips.section_number as section_number,
22+
section_blocks.display_name_with_location as section_with_name,
23+
ips.subsection_number as subsection_number,
24+
subsection_blocks.display_name_with_location as subsection_with_name,
25+
ips.course_order as course_order,
26+
ips.graded as graded,
27+
ips.item_count as item_count,
28+
subsection_blocks.block_id as subsection_block_id,
29+
section_blocks.block_id as section_block_id
30+
from items_per_subsection ips
31+
left join
32+
`xapi`.`dim_course_blocks` section_blocks
33+
on (
34+
ips.section_number = section_blocks.hierarchy_location
35+
and ips.org = section_blocks.org
36+
and ips.course_key = section_blocks.course_key
37+
and section_blocks.block_id like '%@chapter+block@%'
38+
)
39+
left join
40+
`xapi`.`dim_course_blocks` subsection_blocks
41+
on (
42+
ips.subsection_number = subsection_blocks.hierarchy_location
43+
and ips.org = subsection_blocks.org
44+
and ips.course_key = subsection_blocks.course_key
45+
and subsection_blocks.block_id like '%@sequential+block@%'
46+
)
47+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
3+
4+
5+
with all_values as (
6+
7+
select
8+
engagement_level as value_field,
9+
count(*) as n_records
10+
11+
from `xapi`.`section_page_engagement`
12+
group by engagement_level
13+
14+
)
15+
16+
select *
17+
from all_values
18+
where value_field not in (
19+
'No problems attempted yet','All problems attempted','At least one problem attempted'
20+
)
21+
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
3+
4+
5+
with all_values as (
6+
7+
select
8+
engagement_level as value_field,
9+
count(*) as n_records
10+
11+
from `xapi`.`subsection_page_engagement`
12+
group by engagement_level
13+
14+
)
15+
16+
select *
17+
from all_values
18+
where value_field not in (
19+
'No pages viewed yet','All pages viewed','At least one page viewed'
20+
)
21+
22+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
2+
3+
with
4+
fact_navigation as (
5+
select
6+
navigation.emission_time as emission_time,
7+
navigation.org as org,
8+
navigation.course_key as course_key,
9+
navigation.actor_id as actor_id,
10+
navigation.block_id as block_id,
11+
blocks.display_name_with_location as block_name_with_location
12+
from `xapi`.`navigation_events` navigation
13+
join
14+
`xapi`.`dim_course_blocks` blocks
15+
on (
16+
navigation.course_key = blocks.course_key
17+
and navigation.block_id = blocks.block_id
18+
)
19+
),
20+
visited_subsection_pages as (
21+
select distinct
22+
date(emission_time) as visited_on,
23+
org,
24+
course_key,
25+
26+
concat(
27+
splitByString(
28+
':', splitByString(' - ', block_name_with_location)[1], 1
29+
)[1],
30+
':0:0'
31+
)
32+
as section_number,
33+
34+
concat(
35+
arrayStringConcat(
36+
splitByString(
37+
':', splitByString(' - ', block_name_with_location)[1], 2
38+
),
39+
':'
40+
),
41+
':0'
42+
)
43+
44+
as subsection_number,
45+
actor_id,
46+
block_id
47+
from fact_navigation
48+
),
49+
fact_navigation_completion as (
50+
select
51+
visits.visited_on as visited_on,
52+
visits.org as org,
53+
visits.course_key as course_key,
54+
pages.section_with_name as section_with_name,
55+
pages.subsection_with_name as subsection_with_name,
56+
pages.item_count as item_count,
57+
visits.actor_id as actor_id,
58+
visits.block_id as block_id,
59+
pages.section_block_id as section_block_id
60+
from visited_subsection_pages visits
61+
join
62+
`xapi`.`int_pages_per_subsection` pages
63+
on (
64+
visits.org = pages.org
65+
and visits.course_key = pages.course_key
66+
and visits.section_number = pages.section_number
67+
and visits.subsection_number = pages.subsection_number
68+
)
69+
),
70+
subsection_counts as (
71+
select
72+
org,
73+
course_key,
74+
section_with_name,
75+
subsection_with_name,
76+
actor_id,
77+
item_count,
78+
count(distinct block_id) as pages_visited,
79+
case
80+
when pages_visited = 0
81+
then 'No pages viewed yet'
82+
when pages_visited = item_count
83+
then 'All pages viewed'
84+
else 'At least one page viewed'
85+
end as engagement_level,
86+
section_block_id
87+
from fact_navigation_completion
88+
group by
89+
org,
90+
course_key,
91+
section_with_name,
92+
subsection_with_name,
93+
actor_id,
94+
item_count,
95+
section_block_id
96+
),
97+
section_counts as (
98+
select
99+
org,
100+
course_key,
101+
actor_id,
102+
sum(item_count) as item_count,
103+
sum(pages_visited) as pages_visited,
104+
case
105+
when pages_visited = 0
106+
then 'No pages viewed yet'
107+
when pages_visited = item_count
108+
then 'All pages viewed'
109+
else 'At least one page viewed'
110+
end as engagement_level,
111+
section_block_id
112+
from subsection_counts
113+
group by org, course_key, section_block_id, actor_id
114+
)
115+
116+
select org, course_key, actor_id, section_block_id, engagement_level
117+
from section_counts

0 commit comments

Comments
 (0)