mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
Fix: Isolate Report::SurveyItem
This commit is contained in:
parent
b08214fe10
commit
37766e777d
1 changed files with 10 additions and 1 deletions
|
|
@ -85,10 +85,19 @@ module Report
|
|||
end
|
||||
FileUtils.mkdir_p Rails.root.join("tmp", "reports")
|
||||
filepath = Rails.root.join("tmp", "reports", filename)
|
||||
Measure.write_csv(data:, filepath:)
|
||||
write_csv(data:, filepath:)
|
||||
data
|
||||
end
|
||||
|
||||
def self.write_csv(data:, filepath:)
|
||||
csv = CSV.generate do |csv|
|
||||
data.each do |row|
|
||||
csv << row
|
||||
end
|
||||
end
|
||||
File.write(filepath, csv)
|
||||
end
|
||||
|
||||
def self.survey_item_info(survey_item:)
|
||||
prompt = survey_item.prompt
|
||||
scale = Scale.find_by_id(survey_item.scale_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue