You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
958 B
39 lines
958 B
# frozen_string_literal: true
|
|
|
|
module Analyze
|
|
module Graph
|
|
module Column
|
|
class AllStudent < GroupedBarColumnPresenter
|
|
def label
|
|
%w[All Students]
|
|
end
|
|
|
|
def show_irrelevancy_message?
|
|
!measure.includes_student_survey_items?
|
|
end
|
|
|
|
def show_insufficient_data_message?
|
|
scores = academic_years.map do |academic_year|
|
|
measure.student_score(school:, academic_year:)
|
|
end
|
|
|
|
scores.none? { |score| score.meets_student_threshold? }
|
|
end
|
|
|
|
def score(academic_year)
|
|
measure.student_score(school:, academic_year:)
|
|
end
|
|
|
|
def type
|
|
:student
|
|
end
|
|
|
|
def n_size(academic_year)
|
|
SurveyItemResponse.where(survey_item: measure.student_survey_items, school:, grade: grades,
|
|
academic_year:).select(:response_id).distinct.count
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|