sqm-dashboards/app/presenters/analyze/graph/column/all_data.rb
rebuilt 513445dc74 feat: ECP-126 Add measure and scale level graphs for parents by language
WIP: refactor so multiple graphs can be defined for a given slug

WIP: fixed scale view but broke 'All Parent' graph

WIP: working state.  All views working properly

WIP: Refactor graph_map into two collections; measure_level_graphs and scale_level_graphs

WIP: refacter GroupedBarColumnPresenter to accept a 'construct' instead of specifying measure or scale

WIP: fix scale graphs being shown on incorrect view

WIP: Merge parents_by_language class with parents_by_language_by_scale so it can handle display of both measure-level and scale-level graphs
2025-05-09 15:54:43 -07:00

42 lines
1.1 KiB
Ruby

module Analyze
module Graph
module Column
class AllData
def label
%w[All Data]
end
def show_irrelevancy_message?(construct:)
false
end
def show_insufficient_data_message?(construct:, school:, academic_years:)
scores = academic_years.map do |year|
construct.score(school:, academic_year: year)
end
scores.none? do |score|
score.meets_teacher_threshold? || score.meets_student_threshold? || score.meets_admin_data_threshold?
end
end
def score(construct:, school:, academic_year:)
construct.score(school:, academic_year:) || 0
end
def type
:all_data
end
def basis
"student surveys"
end
def n_size(construct:, school:, academic_year:)
SurveyItemResponse.where(survey_item: construct.student_survey_items, school:, grade: grades,
academic_year:).select(:response_id).distinct.count
end
end
end
end
end