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.
This commit is contained in:
rebuilt 2022-02-16 20:40:32 +01:00
parent 1ca88bf6d1
commit d4df7cbc06
44 changed files with 1053 additions and 856 deletions

View file

@ -7,7 +7,7 @@ class OverviewController < SqmApplicationController
private
def presenter_for_measure(measure)
score = SurveyItemResponse.score_for_measure(measure: measure, school: @school, academic_year: @academic_year)
score = measure.score(school: @school, academic_year: @academic_year)
VarianceChartRowPresenter.new(measure: measure, score: score)
end

View file

@ -16,7 +16,7 @@ class SqmApplicationController < ApplicationController
@schools = School.includes([:district]).where(district: @district).order(:name)
@academic_year = AcademicYear.find_by_range params[:year]
@academic_years = AcademicYear.all.order(range: :desc)
@has_empty_dataset = Measure.none_meet_threshold? school: @school, academic_year: @academic_year
@has_empty_dataset = Measure.all.all? do |measure| measure.none_meet_threshold? school: @school, academic_year: @academic_year end
end
def district_slug