|
5 | 5 | // and it wouldn’t reflect when the data was actually dumped from canvas.
|
6 | 6 | // More info on UDP's batch-ingest DAG process can be found here: https://resources.unizin.org/display/UDP/Batch-ingest+application
|
7 | 7 | '''
|
8 |
| - SELECT * FROM EXTERNAL_QUERY("unizin-shared.context_store", "select 'canvasdatadate' as pkey, min(dag_run) as pvalue from report.publish_info pi2"); |
| 8 | + SELECT * FROM EXTERNAL_QUERY("context_store", "select 'canvasdatadate' as pkey, min(dag_run) as pvalue from report.publish_info pi2"); |
9 | 9 | ''',
|
10 | 10 | "user" :
|
11 | 11 | '''
|
|
27 | 27 | when cse.role = 'Teacher' then 'TeacherEnrollment'
|
28 | 28 | else '' end
|
29 | 29 | as enrollment_type
|
30 |
| - from unizin-shared.context_store_entity.course_section_enrollment cse |
31 |
| - left join unizin-shared.context_store_entity.course_section cs |
| 30 | + from context_store_entity.course_section_enrollment cse |
| 31 | + left join context_store_entity.course_section cs |
32 | 32 | on cse.course_section_id = cs.course_section_id
|
33 |
| - left join unizin-shared.context_store_keymap.course_offering co |
| 33 | + left join context_store_keymap.course_offering co |
34 | 34 | on cs.le_current_course_offering_id = co.id
|
35 |
| - left join unizin-shared.context_store_entity.person p |
| 35 | + left join context_store_entity.person p |
36 | 36 | on cse.person_id = p.person_id
|
37 |
| - left join unizin-shared.context_store_keymap.person p2 |
| 37 | + left join context_store_keymap.person p2 |
38 | 38 | on p.person_id = p2.id
|
39 |
| - left join unizin-shared.context_store_entity.person_email pe |
| 39 | + left join context_store_entity.person_email pe |
40 | 40 | on p.person_id = pe.person_id
|
41 |
| - left join unizin-shared.context_store_entity.course_grade cg |
| 41 | + left join context_store_entity.course_grade cg |
42 | 42 | on cse.course_section_id = cg.course_section_id and cse.person_id = cg.person_id
|
43 | 43 | where
|
44 | 44 | co.lms_int_id IN UNNEST(@course_ids)
|
|
51 | 51 | '''
|
52 | 52 | with assignment_details as (
|
53 | 53 | select la.due_date, title, la.course_offering_id, la.learner_activity_id, la.points_possible, la.learner_activity_group_id
|
54 |
| - from unizin-shared.context_store_entity.learner_activity la, unizin-shared.context_store_keymap.course_offering co |
| 54 | + from context_store_entity.learner_activity la, context_store_keymap.course_offering co |
55 | 55 | where
|
56 | 56 | la.visibility = 'everyone'
|
57 | 57 | and la.status = 'published'
|
58 | 58 | and la.course_offering_id = co.id
|
59 | 59 | and co.lms_int_id IN UNNEST(@course_ids)
|
60 | 60 | ), assignment_grp as (
|
61 | 61 | select lg.*
|
62 |
| - from unizin-shared.context_store_entity.learner_activity_group lg, unizin-shared.context_store_keymap.course_offering co |
| 62 | + from context_store_entity.learner_activity_group lg, context_store_keymap.course_offering co |
63 | 63 | where
|
64 | 64 | lg.status = 'available'
|
65 | 65 | and lg.course_offering_id = co.id
|
|
84 | 84 | ), assign_rules as (
|
85 | 85 | select distinct ad.learner_activity_group_id, agr.drop_lowest_amount as drop_lowest, agr.drop_highest_amount as drop_highest
|
86 | 86 | from grp_full ad
|
87 |
| - join unizin-shared.context_store_entity.learner_activity_group agr |
| 87 | + join context_store_entity.learner_activity_group agr |
88 | 88 | on ad.learner_activity_group_id = agr.learner_activity_group_id
|
89 | 89 | ), assignment_grp_points as (
|
90 | 90 | select ag.*, am.group_points AS group_points, ar.drop_lowest as drop_lowest, ar.drop_highest as drop_highest
|
|
101 | 101 | agp.drop_lowest as drop_lowest,
|
102 | 102 | agp.drop_highest as drop_highest
|
103 | 103 | from assignment_grp_points agp,
|
104 |
| - unizin-shared.context_store_keymap.course_offering co_km, |
105 |
| - unizin-shared.context_store_keymap.learner_activity_group lag_km |
| 104 | + context_store_keymap.course_offering co_km, |
| 105 | + context_store_keymap.learner_activity_group lag_km |
106 | 106 | where agp.course_offering_id = co_km.id
|
107 | 107 | and agp.learner_activity_group_id = lag_km.id
|
108 | 108 | order by id
|
|
119 | 119 | la.points_possible as points_possible,
|
120 | 120 | cast(lag_km.lms_int_id as INT64) as assignment_group_id
|
121 | 121 | from
|
122 |
| - unizin-shared.context_store_entity.learner_activity la, |
123 |
| - unizin-shared.context_store_keymap.course_offering co, |
124 |
| - unizin-shared.context_store_keymap.learner_activity la_km, |
125 |
| - unizin-shared.context_store_keymap.learner_activity_group lag_km |
| 122 | + context_store_entity.learner_activity la, |
| 123 | + context_store_keymap.course_offering co, |
| 124 | + context_store_keymap.learner_activity la_km, |
| 125 | + context_store_keymap.learner_activity_group lag_km |
126 | 126 | where
|
127 | 127 | la.visibility = 'everyone'
|
128 | 128 | and la.status = 'published'
|
|
145 | 145 | cast(0 as boolean)
|
146 | 146 | end as consider_weight
|
147 | 147 | from
|
148 |
| - unizin-shared.context_store_entity.learner_activity_group lag, |
149 |
| - unizin-shared.context_store_keymap.course_offering co_km |
| 148 | + context_store_entity.learner_activity_group lag, |
| 149 | + context_store_keymap.course_offering co_km |
150 | 150 | where
|
151 | 151 | lag.course_offering_id = co_km.id
|
152 | 152 | and co_km.lms_int_id IN UNNEST(@course_ids)
|
|
161 | 161 | a.le_term_begin_date as date_start,
|
162 | 162 | a.le_term_end_date as date_end
|
163 | 163 | from
|
164 |
| - unizin-shared.context_store_entity.academic_term as a |
165 |
| - left join unizin-shared.context_store_keymap.academic_term as ka on ka.id = a.academic_term_id |
| 164 | + context_store_entity.academic_term as a |
| 165 | + left join context_store_keymap.academic_term as ka on ka.id = a.academic_term_id |
166 | 166 | where
|
167 | 167 | ka.lms_ext_id is not null
|
168 | 168 | order by id
|
|
180 | 180 | TIMESTAMP(co.le_start_date) as start_at,
|
181 | 181 | TIMESTAMP(co.le_end_date) as conclude_at
|
182 | 182 | FROM
|
183 |
| - unizin-shared.context_store_entity.course_offering co |
184 |
| - LEFT OUTER JOIN unizin-shared.context_store_entity.academic_term at1 on (co.academic_term_id = at1.academic_term_id), |
185 |
| - unizin-shared.context_store_keymap.course_offering co2, |
186 |
| - unizin-shared.context_store_keymap.academic_term at2 |
| 183 | + context_store_entity.course_offering co |
| 184 | + LEFT OUTER JOIN context_store_entity.academic_term at1 on (co.academic_term_id = at1.academic_term_id), |
| 185 | + context_store_keymap.course_offering co2, |
| 186 | + context_store_keymap.academic_term at2 |
187 | 187 | WHERE co2.lms_int_id IN UNNEST(@course_ids)
|
188 | 188 | and co.course_offering_id = co2.id
|
189 | 189 | and at1.academic_term_id = at2.id
|
|
194 | 194 | cast(f_km.lms_int_id as BIGINT) as id,
|
195 | 195 | f.status as file_state,
|
196 | 196 | f.display_name as display_name
|
197 |
| - from unizin-shared.context_store_entity.file f, unizin-shared.context_store_keymap.file f_km, unizin-shared.context_store_keymap.course_offering co_km |
| 197 | + from context_store_entity.file f, context_store_keymap.file f_km, context_store_keymap.course_offering co_km |
198 | 198 | where
|
199 | 199 | f.course_offering_id = co_km.id
|
200 | 200 | and f.file_id = f_km.id
|
|
207 | 207 | (
|
208 | 208 | select
|
209 | 209 | distinct cse.person_id as user_id
|
210 |
| - from unizin-shared.context_store_entity.course_section_enrollment cse |
211 |
| - left join unizin-shared.context_store_entity.course_section cs |
| 210 | + from context_store_entity.course_section_enrollment cse |
| 211 | + left join context_store_entity.course_section cs |
212 | 212 | on cse.course_section_id = cs.course_section_id
|
213 |
| - left join unizin-shared.context_store_keymap.course_offering co |
| 213 | + left join context_store_keymap.course_offering co |
214 | 214 | on cs.le_current_course_offering_id = co.id
|
215 | 215 | where
|
216 | 216 | co.lms_int_id in UNNEST(@course_ids)
|
|
236 | 236 | lar.person_id as short_user_id,
|
237 | 237 | lar2.lms_int_id as submission_id,
|
238 | 238 | CAST(@canvas_data_id_increment AS INT64) + CAST(p.lms_ext_id AS INT64) as canvas_user_id
|
239 |
| - from unizin-shared.context_store_entity.learner_activity_result lar |
| 239 | + from context_store_entity.learner_activity_result lar |
240 | 240 | join enrollment on lar.person_id= enrollment.user_id
|
241 | 241 | join enrollment e on lar.person_id = e.user_id
|
242 |
| - join unizin-shared.context_store_keymap.learner_activity_result lar2 on lar.learner_activity_result_id = lar2.id |
243 |
| - left join unizin-shared.context_store_entity.learner_activity la on lar.learner_activity_id = la.learner_activity_id |
244 |
| - left join unizin-shared.context_store_keymap.learner_activity la2 on la.learner_activity_id = la2.id |
245 |
| - left join unizin-shared.context_store_keymap.course_offering co on co.id = la.course_offering_id |
246 |
| - join unizin-shared.context_store_keymap.person p on p.id = lar.person_id |
| 242 | + join context_store_keymap.learner_activity_result lar2 on lar.learner_activity_result_id = lar2.id |
| 243 | + left join context_store_entity.learner_activity la on lar.learner_activity_id = la.learner_activity_id |
| 244 | + left join context_store_keymap.learner_activity la2 on la.learner_activity_id = la2.id |
| 245 | + left join context_store_keymap.course_offering co on co.id = la.course_offering_id |
| 246 | + join context_store_keymap.person p on p.id = lar.person_id |
247 | 247 | where
|
248 | 248 | co.lms_int_id in UNNEST(@course_ids)
|
249 | 249 | and la.status = 'published'
|
|
0 commit comments