mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
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.
17 lines
461 B
Ruby
17 lines
461 B
Ruby
module ResponseRate
|
|
def initialize(subcategory:, school:, academic_year:)
|
|
@subcategory = subcategory
|
|
@school = school
|
|
@academic_year = academic_year
|
|
end
|
|
|
|
def rate
|
|
return 0 unless survey_item_count.positive?
|
|
|
|
average_responses_per_survey_item = response_count / survey_item_count.to_f
|
|
|
|
return 0 unless total_possible_responses.positive?
|
|
|
|
(average_responses_per_survey_item / total_possible_responses.to_f * 100).round
|
|
end
|
|
end
|