mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-10 07:50:33 -07:00
Visualize survey responses even when a response rate cannot be
calculated. Set the response rate to N / A for data that has no total student and teacher data for a certain year and school
This commit is contained in:
parent
c0a8905fba
commit
91308b93e5
5 changed files with 47 additions and 11 deletions
|
|
@ -9,6 +9,8 @@ module ResponseRate
|
|||
end
|
||||
|
||||
def rate
|
||||
return 100 if Respondent.where(school: @school, academic_year: @academic_year).count.zero?
|
||||
|
||||
return 0 unless survey_item_count.positive?
|
||||
|
||||
average_responses_per_survey_item = response_count / survey_item_count.to_f
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue