mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
fix: make sure averages for admin data scales are included in report
This commit is contained in:
parent
d90669b74d
commit
9f5ca007a1
2 changed files with 10 additions and 1 deletions
|
|
@ -20,7 +20,14 @@ module Report
|
|||
response_rate = scale.measure.subcategory.response_rate(school:, academic_year:)
|
||||
next unless response_rate.meets_student_threshold? || response_rate.meets_teacher_threshold?
|
||||
|
||||
score = scale.score(school:, academic_year:)
|
||||
score = if scale.scale_id.starts_with?("a-")
|
||||
AdminDataValue.where(admin_data_item: scale.admin_data_items, school:,
|
||||
academic_year:).map do |item|
|
||||
item.likert_score
|
||||
end.average
|
||||
else
|
||||
scale.score(school:, academic_year:)
|
||||
end
|
||||
|
||||
begin_date = SurveyItemResponse.where(school:,
|
||||
academic_year:).where.not(recorded_date: nil).order(:recorded_date).first&.recorded_date&.to_date
|
||||
|
|
|
|||
|
|
@ -45,7 +45,9 @@ namespace :report do
|
|||
|
||||
Report::Measure.create_report(filename: "measure_report.csv", measures:)
|
||||
end
|
||||
end
|
||||
|
||||
namespace :scale do
|
||||
task bll: :environment do
|
||||
measure_ids = %w[
|
||||
2A-i
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue