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
48 lines
1.2 KiB
Ruby
48 lines
1.2 KiB
Ruby
module Analyze
|
|
module Graph
|
|
module Column
|
|
module Parent
|
|
class Scale
|
|
attr_reader :scale
|
|
|
|
def initialize(scale:)
|
|
@scale = scale
|
|
end
|
|
|
|
def label
|
|
scale.name.split("-")
|
|
end
|
|
|
|
def basis
|
|
"parent data"
|
|
end
|
|
|
|
def show_irrelevancy_message?(construct:)
|
|
false
|
|
end
|
|
|
|
def show_insufficient_data_message?(construct:, school:, academic_years:)
|
|
false
|
|
end
|
|
|
|
def insufficiency_message
|
|
["data not", "available"]
|
|
end
|
|
|
|
def score(construct:, school:, academic_year:)
|
|
average = scale.parent_score(school:, academic_year:)
|
|
Score.new(average:, meets_teacher_threshold: true, meets_student_threshold: true, meets_admin_data_threshold: true)
|
|
end
|
|
|
|
def type
|
|
:parent
|
|
end
|
|
|
|
def n_size(construct:, school:, academic_year:)
|
|
SurveyItemResponse.where(survey_item: scale.survey_items.parent_survey_items, school:, academic_year:).select(:response_id).distinct.count
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|