make sure survey responses for Butler get loaded correctly

pull/1/head
rebuilt 3 years ago
parent 9bbba64e9e
commit fc9e73f656

@ -132,7 +132,7 @@ class Values
end
def dese_id
@dese_id ||= (row['DESE ID' || 'Dese ID'] || row['DeseId'] || row['DeseID']).to_i
@dese_id ||= (row['DESE ID' || 'Dese ID'] || row['DeseId'] || row['DeseID'] || row['School'] || row['school']).to_i
end
def likert_score(survey_item_id:)

@ -2,7 +2,7 @@ require "#{Rails.root}/app/lib/seeder"
seeder = Seeder.new
seeder.seed_academic_years '2016-17', '2017-18', '2018-19', '2019-20', '2020-21', '2021-22'
seeder.seed_academic_years '2016-17', '2017-18', '2018-19', '2019-20', '2020-21', '2021-22', '2022-23'
seeder.seed_districts_and_schools Rails.root.join('data', 'master_list_of_schools_and_districts.csv')
seeder.seed_surveys Rails.root.join('data', 'master_list_of_schools_and_districts.csv')
seeder.seed_respondents Rails.root.join('data', 'master_list_of_schools_and_districts.csv')

@ -0,0 +1,7 @@
StartDate,EndDate,Status,IPAddress,Progress,Duration (in seconds),Finished,RecordedDate,ResponseId,District,School,"Please select the month, day and year of your birthday. - Month","Please select the month, day and year of your birthday. - Day","Please select the month, day and year of your birthday. - Year",LASID,Grade,s-emsa-q1,s-emsa-q2,s-emsa-q3,s-tint-q1,s-tint-q2,s-tint-q3,s-tint-q4,s-tint-q5,s-acpr-q1,s-acpr-q2,s-acpr-q3,s-acpr-q4,s-cure-q1,s-cure-q2,s-cure-q3,s-cure-q4,s-sten-q1,s-sten-q2,s-sten-q3,s-sper-q1,s-sper-q2,s-sper-q3,s-sper-q4,s-civp-q1,s-civp-q2,s-civp-q3,s-civp-q4,s-grmi-q1,s-grmi-q2,s-grmi-q3,s-grmi-q4,s-appa-q1,s-appa-q2,s-appa-q3,s-sbel-q1,s-sbel-q2,s-sbel-q3,s-sbel-q4,s-sbel-q5,s-phys-q1,s-phys-q2,s-phys-q3,s-phys-q4,s-vale-q1,s-vale-q2,s-vale-q3,s-vale-q4,s-acst-q1,s-acst-q2,s-acst-q3,s-sust-q1,s-sust-q2,s-grit-q1,s-grit-q2,s-grit-q3,s-grit-q4,s-expa-q1,s-poaf-q1,s-poaf-q2,s-poaf-q3,s-poaf-q4,s-peff-q1,s-peff-q2,s-peff-q3,s-peff-q4,s-peff-q5,s-peff-q6,Gender,Race
2022-11-21 10:03:00,2022-11-21 10:12:16,0,208.118.224.220,100,555,1,2022-11-21T10:12:16,R_1gTpYL1ytWhdp0e,3,1600310,7,25,110,72509,7,3,3,,3,3,3,3,3,3,,3,3,3,3,3,3,2,4,3,3,3,3,3,3,3,3,3,3,3,3,3,3,,,,,,,,,,,,,,,,,,,3,3,3,3,3,3,1,3,3,3,3,,,,,,,2,
2022-11-21 14:59:02,2022-11-21 15:08:02,0,71.233.3.7,40,540,0,2022-11-22T15:8:7,R_YXLsXvtKwOlUfoB,3,1600310,11,28,110,275751,7,,,,,,,,,,,,,,,,,,,,,,,,3,3,3,2,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
2022-11-21 10:03:34,2022-11-21 10:12:43,0,208.118.224.218,100,548,1,2022-11-21T10:12:44,R_31AX0jLj2zqTooN,3,1600310,9,28,110,277136,7,4,4,4,4,3,4,4,4,5,5,5,5,4,4,4,4,4,4,4,,4,4,4,3,3,3,3,4,4,4,4,2,4,3,4,4,4,4,3,,,,,,,,,,,,,,,,,,,,,,,5,5,5,4,5,5,1,2
2022-11-18 11:06:49,2022-11-18 11:30:12,0,208.118.224.209,100,1402,1,2022-11-18T11:30:13,R_4Ouz8n5dnnXVRPb,3,1600310,9,4,112,287185,5,3,3,3,4,3,5,5,5,5,4,5,4,4,3,4,4,3,4,4,2,3,3,3,4,4,4,4,3,3,3,3,3,3,3,3,3,4,3,3,,,,,,,,,,,,,,,,,,,,,,,5,4,4,4,4,4,1,2
2022-11-21 13:12:42,2022-11-21 13:24:30,0,131.239.118.9,100,707,1,2022-11-21T13:24:31,R_yJgj7CCKWQ91KtX,3,1600310,12,19,110,297405,7,3,4,4,4,3,4,3,4,,,,,,,,,,,,,,,,,,,,3,4,4,4,,,,4,4,3,3,4,4,4,4,4,4,3,4,3,4,2,3,4,3,3,4,3,4,3,3,3,3,4,4,4,4,4,4,4,2,"2,4"
2022-11-21 8:57:59,2022-11-21 9:02:56,0,131.239.118.46,40,297,0,2022-11-22T9:2:57,R_2CEu0sVwZkjRhvt,3,1600310,11,8,111,281578,6,,,,,,,,,,,,,,,,,,,,,,,,,,,,3,,3,4,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
1 StartDate EndDate Status IPAddress Progress Duration (in seconds) Finished RecordedDate ResponseId District School Please select the month, day and year of your birthday. - Month Please select the month, day and year of your birthday. - Day Please select the month, day and year of your birthday. - Year LASID Grade s-emsa-q1 s-emsa-q2 s-emsa-q3 s-tint-q1 s-tint-q2 s-tint-q3 s-tint-q4 s-tint-q5 s-acpr-q1 s-acpr-q2 s-acpr-q3 s-acpr-q4 s-cure-q1 s-cure-q2 s-cure-q3 s-cure-q4 s-sten-q1 s-sten-q2 s-sten-q3 s-sper-q1 s-sper-q2 s-sper-q3 s-sper-q4 s-civp-q1 s-civp-q2 s-civp-q3 s-civp-q4 s-grmi-q1 s-grmi-q2 s-grmi-q3 s-grmi-q4 s-appa-q1 s-appa-q2 s-appa-q3 s-sbel-q1 s-sbel-q2 s-sbel-q3 s-sbel-q4 s-sbel-q5 s-phys-q1 s-phys-q2 s-phys-q3 s-phys-q4 s-vale-q1 s-vale-q2 s-vale-q3 s-vale-q4 s-acst-q1 s-acst-q2 s-acst-q3 s-sust-q1 s-sust-q2 s-grit-q1 s-grit-q2 s-grit-q3 s-grit-q4 s-expa-q1 s-poaf-q1 s-poaf-q2 s-poaf-q3 s-poaf-q4 s-peff-q1 s-peff-q2 s-peff-q3 s-peff-q4 s-peff-q5 s-peff-q6 Gender Race
2 2022-11-21 10:03:00 2022-11-21 10:12:16 0 208.118.224.220 100 555 1 2022-11-21T10:12:16 R_1gTpYL1ytWhdp0e 3 1600310 7 25 110 72509 7 3 3 3 3 3 3 3 3 3 3 3 3 3 3 2 4 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 2
3 2022-11-21 14:59:02 2022-11-21 15:08:02 0 71.233.3.7 40 540 0 2022-11-22T15:8:7 R_YXLsXvtKwOlUfoB 3 1600310 11 28 110 275751 7 3 3 3 2
4 2022-11-21 10:03:34 2022-11-21 10:12:43 0 208.118.224.218 100 548 1 2022-11-21T10:12:44 R_31AX0jLj2zqTooN 3 1600310 9 28 110 277136 7 4 4 4 4 3 4 4 4 5 5 5 5 4 4 4 4 4 4 4 4 4 4 3 3 3 3 4 4 4 4 2 4 3 4 4 4 4 3 5 5 5 4 5 5 1 2
5 2022-11-18 11:06:49 2022-11-18 11:30:12 0 208.118.224.209 100 1402 1 2022-11-18T11:30:13 R_4Ouz8n5dnnXVRPb 3 1600310 9 4 112 287185 5 3 3 3 4 3 5 5 5 5 4 5 4 4 3 4 4 3 4 4 2 3 3 3 4 4 4 4 3 3 3 3 3 3 3 3 3 4 3 3 5 4 4 4 4 4 1 2
6 2022-11-21 13:12:42 2022-11-21 13:24:30 0 131.239.118.9 100 707 1 2022-11-21T13:24:31 R_yJgj7CCKWQ91KtX 3 1600310 12 19 110 297405 7 3 4 4 4 3 4 3 4 3 4 4 4 4 4 3 3 4 4 4 4 4 4 3 4 3 4 2 3 4 3 3 4 3 4 3 3 3 3 4 4 4 4 4 4 4 2 2,4
7 2022-11-21 8:57:59 2022-11-21 9:02:56 0 131.239.118.46 40 297 0 2022-11-22T9:2:57 R_2CEu0sVwZkjRhvt 3 1600310 11 8 111 281578 6 3 3 4

@ -3,6 +3,9 @@ require 'rails_helper'
describe SurveyResponsesDataLoader do
let(:path_to_teacher_responses) { Rails.root.join('spec', 'fixtures', 'test_2020-21_teacher_survey_responses.csv') }
let(:path_to_student_responses) { Rails.root.join('spec', 'fixtures', 'test_2020-21_student_survey_responses.csv') }
let(:path_to_butler_student_responses) do
Rails.root.join('spec', 'fixtures', 'test_2022-23_butler_student_survey_responses.csv')
end
let(:ay_2020_21) { AcademicYear.find_by_range '2020-21' }
@ -93,6 +96,17 @@ describe SurveyResponsesDataLoader do
expect(SurveyItemResponse.where(response_id: 'student_survey_response_4').count).to eq 22
expect(SurveyItemResponse.where(response_id: 'student_survey_response_5').count).to eq 27
end
context 'when loading 22-23 bundler survey responses' do
before :each do
SurveyResponsesDataLoader.load_data filepath: path_to_butler_student_responses,
rules: [Rule::SkipNonLowellSchools]
end
it 'loads all the responses for Butler' do
expect(SurveyItemResponse.count).to eq 310
end
end
end
end
end

Loading…
Cancel
Save