mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 07:28:41 -07:00
fix: Fixes #187294757. Data is hidden when selecting multiple years if the default year has no student data to show
This commit is contained in:
parent
91e8211673
commit
51e71a7f83
7 changed files with 9 additions and 10 deletions
|
|
@ -8,7 +8,7 @@ module Analyze
|
|||
end
|
||||
|
||||
def n_size(year_index)
|
||||
SurveyItemResponse.where(ell:, survey_item: measure.student_survey_items, school:, grade: grades(year_index),
|
||||
SurveyItemResponse.where(ell:, survey_item: measure.student_survey_items, school:, grade: grades,
|
||||
academic_year: academic_years[year_index]).select(:response_id).distinct.count
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module Analyze
|
|||
end
|
||||
|
||||
def n_size(year_index)
|
||||
SurveyItemResponse.where(gender:, survey_item: measure.student_survey_items, school:, grade: grades(year_index),
|
||||
SurveyItemResponse.where(gender:, survey_item: measure.student_survey_items, school:, grade: grades,
|
||||
academic_year: academic_years[year_index]).select(:response_id).distinct.count
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ module Analyze
|
|||
end
|
||||
|
||||
def n_size(year_index)
|
||||
SurveyItemResponse.where(survey_item: measure.student_survey_items, school:, grade: grades(year_index),
|
||||
SurveyItemResponse.where(survey_item: measure.student_survey_items, school:, grade: grades,
|
||||
academic_year: academic_years[year_index]).select(:response_id).distinct.count
|
||||
end
|
||||
|
||||
|
|
@ -141,8 +141,8 @@ module Analyze
|
|||
end
|
||||
end
|
||||
|
||||
def grades(year_index)
|
||||
Respondent.by_school_and_year(school:, academic_year: academic_years[year_index]).enrollment_by_grade.keys
|
||||
def grades
|
||||
Respondent.by_school_and_year(school:, academic_year: academic_years)&.enrollment_by_grade&.keys
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module Analyze
|
|||
end
|
||||
|
||||
def n_size(year_index)
|
||||
SurveyItemResponse.where(income:, survey_item: measure.student_survey_items, school:, grade: grades(year_index),
|
||||
SurveyItemResponse.where(income:, survey_item: measure.student_survey_items, school:, grade: grades,
|
||||
academic_year: academic_years[year_index]).select(:response_id).distinct.count
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ module Analyze
|
|||
end
|
||||
|
||||
def n_size(year_index)
|
||||
SurveyItemResponse.where(sped:, survey_item: measure.student_survey_items, school:, grade: grades(year_index),
|
||||
SurveyItemResponse.where(sped:, survey_item: measure.student_survey_items, school:, grade: grades,
|
||||
academic_year: academic_years[year_index]).select(:response_id).distinct.count
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -52,4 +52,3 @@ module Analyze
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ module Analyze
|
|||
@graphs ||= [Analyze::Graph::AllData.new,
|
||||
Analyze::Graph::StudentsAndTeachers.new,
|
||||
Analyze::Graph::StudentsByRace.new(races: selected_races),
|
||||
Analyze::Graph::StudentsByGrade.new(grades: selected_grades),
|
||||
Analyze::Graph::StudentsByGrade.new(grades:),
|
||||
Analyze::Graph::StudentsByGender.new(genders: selected_genders),
|
||||
Analyze::Graph::StudentsByIncome.new(incomes: selected_incomes),
|
||||
Analyze::Graph::StudentsByEll.new(ells: selected_ells),
|
||||
|
|
@ -159,7 +159,7 @@ module Analyze
|
|||
end
|
||||
|
||||
def grades
|
||||
@grades ||= SurveyItemResponse.where(school:, academic_year:)
|
||||
@grades ||= SurveyItemResponse.where(school:, academic_year: academic_years)
|
||||
.where.not(grade: nil)
|
||||
.group(:grade)
|
||||
.select(:response_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue