From a83d16d276eb97187b6c91b9bb0d3026511c2004 Mon Sep 17 00:00:00 2001 From: Eli Knebel Date: Thu, 8 Aug 2024 09:09:51 -0400 Subject: [PATCH] fix quiz scores query (#5004) --- lib/oli/grading.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/oli/grading.ex b/lib/oli/grading.ex index 81e0b9aea69..6dac19c34db 100644 --- a/lib/oli/grading.ex +++ b/lib/oli/grading.ex @@ -232,9 +232,13 @@ defmodule Oli.Grading do join: rev in Revision, on: rev.id == pr.revision_id, left_join: ra in ResourceAccess, - on: ra.resource_id == rev.resource_id and ra.user_id == ^student_id, + on: + ra.section_id == ^section_id and ra.resource_id == sr.resource_id and + ra.user_id == ^student_id, where: - sec.id == ^section_id and rev.deleted == false and + sec.id == ^section_id and + sr.section_id == ^section_id and + rev.deleted == false and rev.resource_type_id == ^resource_type_id and rev.graded == true, select: %GradebookScore{