mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
fix: change measure summary so it reports correct grade range
This commit is contained in:
parent
20f605f3b7
commit
a1f0373553
1 changed files with 4 additions and 8 deletions
|
|
@ -21,15 +21,11 @@ module Report
|
||||||
Thread.new do
|
Thread.new do
|
||||||
while measure = jobs.pop(true)
|
while measure = jobs.pop(true)
|
||||||
academic_years.each do |academic_year|
|
academic_years.each do |academic_year|
|
||||||
all_grades = Set.new
|
|
||||||
|
|
||||||
respondents = Respondent.where(school: schools, academic_year:)
|
respondents = Respondent.where(school: schools, academic_year:)
|
||||||
respondents.each do |respondent|
|
|
||||||
respondent.enrollment_by_grade.keys.each do |grade|
|
enrollment = respondents.map do | respondent| respondent.enrollment_by_grade.keys end.flatten.compact.uniq.sort
|
||||||
all_grades.add(grade)
|
grades_with_responses = ::SurveyItemResponse.where(school: schools, academic_year:).where.not(grade: nil).pluck(:grade).uniq.sort
|
||||||
end
|
all_grades = (enrollment & grades_with_responses).sort
|
||||||
end
|
|
||||||
all_grades = all_grades.to_a
|
|
||||||
grades = "#{all_grades.first}-#{all_grades.last}"
|
grades = "#{all_grades.first}-#{all_grades.last}"
|
||||||
|
|
||||||
begin_date = ::SurveyItemResponse.where(school: schools,
|
begin_date = ::SurveyItemResponse.where(school: schools,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue