sqm-dashboards/app/presenters/subcategory_card_presenter.rb
rebuilt d4df7cbc06 Add scales to framework. Change calculations to first group and then
average those groupings and the way up the framework.  Likert scores for
a survey_item are averaged.  Then all the survey_items in a scale are
averaged.  Then student scales in a measure are averaged.  And teacher
scales in a measure are averaged.  Then the average of those two
calculations becomes the score for a measure.  Then the measures in a
subcategory are averaged.
2022-02-24 14:53:06 +01:00

27 lines
387 B
Ruby

class SubcategoryCardPresenter
attr_reader :name
def initialize(name:, zones:, score:)
@name = name
@zones = zones
@score = score
end
def harvey_ball_icon
"#{zone.type}-harvey-ball"
end
def color
zone.type.to_s
end
def insufficient_data?
zone.type == :insufficient_data
end
private
def zone
@zones.zone_for_score(@score)
end
end