From 0bacac69622794eccd6fbc14882c4d984e82f6e7 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Thu, 3 Aug 2023 12:40:42 -0700 Subject: [PATCH] fix: fix teacher n_size so instead of counting all the indivual teacher responses for a measure, it only counts the unique respondents --- app/presenters/analyze/graph/column/all_teacher.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/presenters/analyze/graph/column/all_teacher.rb b/app/presenters/analyze/graph/column/all_teacher.rb index d4bbdf7b..dc3a8443 100644 --- a/app/presenters/analyze/graph/column/all_teacher.rb +++ b/app/presenters/analyze/graph/column/all_teacher.rb @@ -34,7 +34,7 @@ module Analyze def n_size(year_index) SurveyItemResponse.where(survey_item: measure.teacher_survey_items, school:, - academic_year: academic_years[year_index]).count + academic_year: academic_years[year_index]).select(:response_id).distinct.count end end end