diff --git a/lib/cadet/assessments/assessments.ex b/lib/cadet/assessments/assessments.ex index 7203d4e4b..e1327bf0a 100644 --- a/lib/cadet/assessments/assessments.ex +++ b/lib/cadet/assessments/assessments.ex @@ -1505,7 +1505,9 @@ defmodule Cadet.Assessments do submission.student_id in subquery( from(user in User, where: ilike(user.name, ^"%#{value}%"), - select: user.id + inner_join: cr in CourseRegistration, + on: user.id == cr.user_id, + select: cr.id ) ) ) @@ -1517,7 +1519,9 @@ defmodule Cadet.Assessments do submission.student_id in subquery( from(user in User, where: ilike(user.username, ^"%#{value}%"), - select: user.id + inner_join: cr in CourseRegistration, + on: user.id == cr.user_id, + select: cr.id ) ) )