mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
feat: create a report at the survey item response level that shows averages by student to selected measures
This commit is contained in:
parent
645b2a8bda
commit
8a2c34462b
2 changed files with 131 additions and 0 deletions
|
|
@ -183,4 +183,15 @@ namespace :report do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Usage example
|
||||
# bundle exec rake "report:survey_item_response:create[Hampden-Wilbraham,2023-24 Spring]"
|
||||
namespace :survey_item_response do
|
||||
task :create, %i[district academic_year] => :environment do |_, args|
|
||||
district = District.find_by_name(args[:district])
|
||||
academic_years = AcademicYear.where(range: args[:academic_year])
|
||||
filename = "survey_item_response.#{district.name}.#{academic_years.map(&:range).join('.')}.csv"
|
||||
Report::SurveyItemResponse.create(schools: district.schools, academic_years:, filename:)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue