mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
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
46 lines
1.1 KiB
Ruby
46 lines
1.1 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module Analyze
|
|
module Graph
|
|
module Column
|
|
class AllTeacher
|
|
def label
|
|
%w[All Teachers]
|
|
end
|
|
|
|
def basis
|
|
"teacher surveys"
|
|
end
|
|
|
|
def insufficiency_message
|
|
["survey response", "rate below 25%"]
|
|
end
|
|
|
|
def show_irrelevancy_message?(construct:)
|
|
!construct.includes_teacher_survey_items?
|
|
end
|
|
|
|
def show_insufficient_data_message?(construct:, school:, academic_years:)
|
|
scores = academic_years.map do |year|
|
|
construct.score(school:, academic_year: year)
|
|
end
|
|
|
|
scores.all? { |score| !score.meets_teacher_threshold? }
|
|
end
|
|
|
|
def score(construct:, school:, academic_year:)
|
|
construct.teacher_score(school:, academic_year:)
|
|
end
|
|
|
|
def type
|
|
:teacher
|
|
end
|
|
|
|
def n_size(construct:, school:, academic_year:)
|
|
SurveyItemResponse.where(survey_item: construct.teacher_survey_items, school:,
|
|
academic_year:).pluck(:response_id).uniq.count
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|