Skip to content

Commit

Permalink
fix: Use correct schema, coerce actor_id, move include
Browse files Browse the repository at this point in the history
  • Loading branch information
bmtcril committed May 24, 2024
1 parent 5f9d33d commit 82aadf5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
-- this will be used to pick the xAPI event corresponding to that submission
with
successful_responses as (
select org, course_key, problem_id, actor_id, first_success_at
from {{ ASPECTS_XAPI_DATABASE }}.responses
select org, course_key, problem_id, actor_id::String as actor_id, first_success_at
from {{ DBT_PROFILE_TARGET_DATABASE }}.responses
where isNotNull(first_success_at)
{% include 'openedx-assets/queries/common_filters.sql' %}
),
Expand All @@ -17,12 +17,12 @@ with
org,
course_key,
problem_id,
actor_id,
actor_id::String as actor_id,
max(last_attempt_at) as last_attempt_at
from {{ ASPECTS_XAPI_DATABASE }}.responses
from {{ DBT_PROFILE_TARGET_DATABASE }}.responses
where actor_id not in (select distinct actor_id from successful_responses)
group by org, course_key, problem_id, actor_id
{% include 'openedx-assets/queries/common_filters.sql' %}
group by org, course_key, problem_id, actor_id
),
-- combine result sets for successful and unsuccessful problem submissions
responses as (
Expand Down

0 comments on commit 82aadf5

Please sign in to comment.