From 82aadf5afc9949df612aac53f95cdc8083906b2a Mon Sep 17 00:00:00 2001 From: Brian Mesick Date: Fri, 24 May 2024 10:25:49 -0400 Subject: [PATCH] fix: Use correct schema, coerce actor_id, move include --- .../openedx-assets/queries/int_problem_results.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tutoraspects/templates/openedx-assets/queries/int_problem_results.sql b/tutoraspects/templates/openedx-assets/queries/int_problem_results.sql index 24824afed..cf2095be4 100644 --- a/tutoraspects/templates/openedx-assets/queries/int_problem_results.sql +++ b/tutoraspects/templates/openedx-assets/queries/int_problem_results.sql @@ -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' %} ), @@ -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 (