Skip to content

Commit a1b2d4f

Browse files
committed
fix(sql): use 0 instead of null
1 parent 9c97dc2 commit a1b2d4f

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

tutoraspects/templates/openedx-assets/queries/fact_video_watches.sql

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ select
1212
subsection_with_name,
1313
video_name,
1414
video_name_with_location,
15-
concat(
16-
'<a href="', video_id, '" target="_blank">', video_name_with_location, '</a>'
17-
) as video_link,
15+
video_link,
1816
actor_id,
1917
username,
2018
email,
@@ -44,6 +42,7 @@ group by
4442
subsection_with_name,
4543
video_name,
4644
video_name_with_location,
45+
video_link,
4746
actor_id,
4847
video_id,
4948
video_segment_count,

tutoraspects/templates/openedx-assets/queries/problem_coursewide_avg.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ select
7373
'<a href="',
7474
full_responses.object_id,
7575
'" target="_blank">',
76-
blocks.problem_name_with_location,
76+
problem_name_with_location,
7777
'</a>'
7878
) as problem_link,
7979
full_responses.actor_id as actor_id,
@@ -91,10 +91,10 @@ select
9191
coursewide_attempts.coursewide_percent_correct as coursewide_percent_correct,
9292
-- Learner-specific calculations (correcting the percentage calculations)
9393
(
94-
case when full_responses.success then full_responses.attempts else null end
94+
case when full_responses.success then full_responses.attempts else 0 end
9595
) as correct_attempts_by_learner,
9696
(
97-
case when not full_responses.success then full_responses.attempts else null end
97+
case when not full_responses.success then full_responses.attempts else 0 end
9898
) as incorrect_attempts_by_learner,
9999
-- Ensure we calculate percentage based on total attempts per problem (multiplied
100100
-- by 100 only once)

0 commit comments

Comments
 (0)