mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
Feat: Add task to generate item-level survey report
This commit is contained in:
parent
65d3733189
commit
a085afb3b6
2 changed files with 118 additions and 0 deletions
|
|
@ -70,4 +70,21 @@ namespace :report do
|
|||
Report::BeyondLearningLoss.create_report(filename: "bll_report.csv", scales:)
|
||||
end
|
||||
end
|
||||
|
||||
namespace :survey_item do
|
||||
task :by_item, [:school, :academic_year] => :environment do |_, args|
|
||||
school = School.find_by_name(args[:school])
|
||||
academic_year = AcademicYear.find_by_range(args[:academic_year])
|
||||
if school == nil
|
||||
puts "Invalid school name"
|
||||
bad = 1
|
||||
end
|
||||
if academic_year == nil
|
||||
puts "Invalid academic year"
|
||||
bad = 1
|
||||
end
|
||||
next if bad == 1
|
||||
Report::SurveyItem.create_report(school: , academic_year:, filename: "survey_item_by_item_report.csv")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue