mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 15:38:21 -07:00
chore: print the n-size when printing nil grades
This commit is contained in:
parent
43ae016968
commit
7142dca620
1 changed files with 6 additions and 1 deletions
|
|
@ -145,10 +145,15 @@ namespace :one_off do
|
|||
School.all.each do |school|
|
||||
total = SurveyItemResponse.where(school:, academic_year:,
|
||||
survey_item: SurveyItem.student_survey_items).count.to_f
|
||||
|
||||
respondent_count = SurveyItemResponse.where(school:, academic_year:,
|
||||
survey_item: SurveyItem.student_survey_items).pluck(:response_id).uniq.count.to_f
|
||||
nil_count = SurveyItemResponse.where(school:, academic_year:, grade: nil,
|
||||
survey_item: SurveyItem.student_survey_items).count
|
||||
percentage = ((nil_count / total) * 100).round(1)
|
||||
puts "#{percentage}% nil grades for: #{school.name}, #{academic_year.range}" if percentage > 10
|
||||
if percentage > 10
|
||||
puts "#{percentage}% nil grades out of #{respondent_count} students responding for: #{school.name}, #{academic_year.range}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue