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
This commit is contained in:
rebuilt 2025-05-06 14:14:47 -07:00
parent 7380d56064
commit 513445dc74
30 changed files with 333 additions and 249 deletions

View file

@ -8,6 +8,10 @@ class Measure < ActiveRecord::Base
has_many :survey_items, through: :scales
has_many :survey_item_responses, through: :survey_items
def construct_id
measure_id
end
def none_meet_threshold?(school:, academic_year:)
@none_meet_threshold ||= Hash.new do |memo, (school, academic_year)|
memo[[school, academic_year]] = !sufficient_survey_responses?(school:, academic_year:)

View file

@ -3,10 +3,19 @@
class Scale < ApplicationRecord
belongs_to :measure, counter_cache: true
has_one :category, through: :measure
has_one :subcategory, through: :measure
has_many :survey_items
has_many :survey_item_responses, through: :survey_items
has_many :admin_data_items
def construct_id
scale_id
end
def parent_survey_items
@parent_survey_items ||= survey_items.parent_survey_items
end
def score(school:, academic_year:)
@score ||= Hash.new do |memo, (school, academic_year)|
memo[[school, academic_year]] = begin