sqm-dashboards/app/controllers/overview_controller.rb
Nelson Jovel ad03606d66 Add benchmarks to survey and admin data items. Remove them from measures. Modify seeder
Calculate benchmarks for measures based on a weighted average of survey
and admin data items

Added architectural records
2021-12-28 14:10:34 +01:00

14 lines
501 B
Ruby

class OverviewController < SqmApplicationController
def index
@variance_chart_row_presenters = Measure.all.map(&method(:presenter_for_measure))
@category_presenters = Category.sorted.map { |category| CategoryPresenter.new(category: category) }
end
private
def presenter_for_measure(measure)
score = SurveyItemResponse.score_for_measure(measure: measure, school: @school, academic_year: @academic_year)
VarianceChartRowPresenter.new(measure: measure, score: score)
end
end