From 4ea65d69307b53e5da96cedb46296c785fe3a259 Mon Sep 17 00:00:00 2001 From: Rory Sawyer Date: Thu, 19 Oct 2023 14:18:14 -0400 Subject: [PATCH] feat: display multiple-choice answers separately --- tutoraspects/plugin.py | 2 +- .../queries/fact_learner_problem_summary.sql | 2 +- .../openedx-assets/queries/fact_problem_responses.sql | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tutoraspects/plugin.py b/tutoraspects/plugin.py index e5c77dbe6..eb225e7bc 100644 --- a/tutoraspects/plugin.py +++ b/tutoraspects/plugin.py @@ -319,7 +319,7 @@ # For now we are pulling this from github, which should allow maximum # flexibility for forking, running branches, specific versions, etc. ("DBT_REPOSITORY", "https://github.com/openedx/aspects-dbt"), - ("DBT_BRANCH", "v2.6"), + ("DBT_BRANCH", "v2.7"), # Path to the dbt project inside the repository ("DBT_REPOSITORY_PATH", "aspects-dbt"), # This is a pip compliant list of Python packages to install to run dbt diff --git a/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql b/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql index b28ed73f8..e55e91418 100644 --- a/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_learner_problem_summary.sql @@ -8,7 +8,7 @@ WITH problem_responses AS ( problem_id, actor_id, success, - first_value(success) OVER (PARTITION BY course_key, problem_id, actor_id ORDER BY success DESC) AS was_successful + first_value(success) OVER (PARTITION BY course_key, problem_id, actor_id ORDER BY success ASC) AS was_successful FROM problem_responses ), successful_responses AS ( SELECT diff --git a/tutoraspects/templates/openedx-assets/queries/fact_problem_responses.sql b/tutoraspects/templates/openedx-assets/queries/fact_problem_responses.sql index 745acbfef..94d12be8a 100644 --- a/tutoraspects/templates/openedx-assets/queries/fact_problem_responses.sql +++ b/tutoraspects/templates/openedx-assets/queries/fact_problem_responses.sql @@ -14,7 +14,12 @@ select actor_id, attempts, success, - responses + arrayJoin( + if( + startsWith(responses, '['), + cast(responses as Array(String)), + [responses] + )) as responses from problem_responses where