mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
ECP-125 feat:
Update cleaner to read parent races. Update uploader to set races for parents. Add race graphs to analyze page. Show both measure and scale level graphs
This commit is contained in:
parent
76f2467b97
commit
5b00454a1b
15 changed files with 322 additions and 39 deletions
|
|
@ -1,8 +1,9 @@
|
|||
StartDate,EndDate,Status,IPAddress,Progress,Duration (in seconds),Finished,RecordedDate,ResponseId,DistributionChannel,UserLanguage,DESE ID,Number of Children,Gender-1,Gender-1_7_TEXT,Race-1,Race-1_7_TEXT,Gender-2,Gender-2_7_TEXT,Race-2,Race-2_7_TEXT,Gender-3,Gender-3_7_TEXT,Race-3,Race-3_7_TEXT,Gender-4,Gender-4_7_TEXT,Race-4,Race-4_7_TEXT,Gender-5,Gender-5_7_TEXT,Race-5,Race-5_7_TEXT,Gender,Gender_7_TEXT,p-scrp-q3,p-scrp-q2,p-valm-q1,p-valm-q2,p-valm-q3,p-valm-q4,p-comm-q1,p-comm-q2,p-comm-q3,p-tcom-q1,P-tcom-q2,p-tcom-q3,p-evnt-q4,p-comm-q4,p-evnt-q3,p-evnt-q1,p-evnt-q2,p-socx-q3,p-socx-q4,p-scrp-q1,p-socx-q1,p-sosu-q1,p-sosu-q2,p-sosu-q3,p-socx-q2,p-sosu-q4,p-phys-q3,p-acpr-q1,p-acpr-q2,p-acpr-q3,p-acpr-q4,p-cure-q1,p-cure-q2,p-cure-q3,p-cure-q4,Housing,Housing_100_TEXT,Employment,Employment_100_TEXT,Caregivers,Caregivers_100_TEXT,Education,Education_100_TEXT,Benefits,Benefits_100_TEXT,Language,Language_100_TEXT,Raw Income,Income,Raw ELL,ELL,Raw SpEd,SpEd,Progress Count,Race
|
||||
5/1/2024 10:04:34,5/1/2024 10:10:49,0,72.93.86.98,100,374,1,2021-03-31T10:01:36,parent_survey_response_1,email,EN,1500025,1,,,,,,,,,,,,,,,,,,,,,2,,4,5,5,4,5,5,5,5,5,4,4,5,4,5,3,4,5,4,4,5,5,5,5,5,5,5,1,2,2,2,1,4,5,5,5,1,,1,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34,99
|
||||
5/1/2024 10:03:52,5/1/2024 10:14:42,0,73.69.182.58,100,649,1,2021-04-01T10:01:36,parent_survey_response_2,email,EN,1500025,1,,,,,,,,,,,,,,,,,,,,,1,,4,4,5,5,5,5,5,5,5,5,5,5,3,5,4,5,5,5,5,5,4,4,4,4,5,5,1,5,4,5,5,5,5,5,5,1,,99,,2,,3,,1,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34,99
|
||||
5/1/2024 10:06:44,5/1/2024 10:15:41,0,50.235.109.170,100,537,1,2021-04-02T10:01:36,parent_survey_response_3,email,EN,1500025,2,2,,5,,2,,5,,,,,,,,,,,,,,2,,5,5,5,4,5,5,5,5,5,4,4,5,4,4,3,4,4,4,4,5,4,4,5,5,2,5,3,4,4,4,4,5,5,5,5,1,,1,,3,,6,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34,5
|
||||
5/1/2024 10:14:23,5/1/2024 10:22:22,0,73.38.238.192,100,478,1,2021-04-03T10:01:36,parent_survey_response_4,email,EN,1500025,1,,,,,,,,,,,,,,,,,,,,,1,,5,5,5,5,5,5,5,4,5,4,4,4,2,5,4,5,4,5,5,5,3,5,5,5,2,5,1,5,5,5,5,5,5,5,5,1,,1,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34,99
|
||||
5/1/2024 10:18:39,5/1/2024 10:23:49,0,73.69.158.255,100,310,1,2021-04-04T10:01:36,parent_survey_response_5,email,EN,1500025,2,2,,5,,1,,5,,,,,,,,,,,,,,2,,5,4,5,5,5,5,1,1,1,1,1,1,3,1,4,4,5,1,1,1,4,1,1,1,4,5,1,5,5,5,5,1,5,1,1,1,,"2,4",,3,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34,5
|
||||
5/1/2024 10:20:30,5/1/2024 10:25:16,0,73.182.146.201,100,285,1,2021-04-05T10:01:36,parent_survey_response_6,email,EN,1500025,1,,,,,,,,,,,,,,,,,,,,,1,,3,3,3,1,3,2,4,2,4,1,1,3,3,4,3,4,1,5,5,4,3,5,4,3,3,1,3,5,5,4,5,4,4,5,4,2,,2,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34,99
|
||||
5/1/2024 10:14:01,5/1/2024 10:27:19,0,209.107.182.203,100,798,1,2021-04-06T10:01:36,parent_survey_response_7,email,EN,1500025,2,1,,5,,1,,5,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,1,,1,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34,5
|
||||
StartDate,EndDate,Status,IPAddress,Progress,Duration (in seconds),Finished,RecordedDate,ResponseId,DistributionChannel,UserLanguage,DESE ID,Number of Children,Gender-1,Gender-1_7_TEXT,Race-1,Race-1_7_TEXT,Gender-2,Gender-2_7_TEXT,Race-2,Race-2_7_TEXT,Gender-3,Gender-3_7_TEXT,Race-3,Race-3_7_TEXT,Gender-4,Gender-4_7_TEXT,Race-4,Race-4_7_TEXT,Gender-5,Gender-5_7_TEXT,Race-5,Race-5_7_TEXT,Gender,Gender_7_TEXT,p-scrp-q3,p-scrp-q2,p-valm-q1,p-valm-q2,p-valm-q3,p-valm-q4,p-comm-q1,p-comm-q2,p-comm-q3,p-tcom-q1,P-tcom-q2,p-tcom-q3,p-evnt-q4,p-comm-q4,p-evnt-q3,p-evnt-q1,p-evnt-q2,p-socx-q3,p-socx-q4,p-scrp-q1,p-socx-q1,p-sosu-q1,p-sosu-q2,p-sosu-q3,p-socx-q2,p-sosu-q4,p-phys-q3,p-acpr-q1,p-acpr-q2,p-acpr-q3,p-acpr-q4,p-cure-q1,p-cure-q2,p-cure-q3,p-cure-q4,Housing,Housing_100_TEXT,Employment,Employment_100_TEXT,Caregivers,Caregivers_100_TEXT,Education,Education_100_TEXT,Benefits,Benefits_100_TEXT,Language,Language_100_TEXT,Raw Income,Income,Raw ELL,ELL,Raw SpEd,SpEd,Progress Count
|
||||
5/1/2024 10:04:34,5/1/2024 10:10:49,0,72.93.86.98,100,374,1,2021-03-31T10:01:36,parent_survey_response_1,email,EN,1500025,1,,,1,,,,,,,,,,,,,,,,,,2,,4,5,5,4,5,5,5,5,5,4,4,5,4,5,3,4,5,4,4,5,5,5,5,5,5,5,1,2,2,2,1,4,5,5,5,1,,1,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34
|
||||
5/1/2024 10:03:52,5/1/2024 10:14:42,0,73.69.182.58,100,649,1,2021-04-01T10:01:36,parent_survey_response_2,email,EN,1500025,1,,,,,,,,,,,6,,,,7,,,,,,1,,4,4,5,5,5,5,5,5,5,5,5,5,3,5,4,5,5,5,5,5,4,4,4,4,5,5,1,5,4,5,5,5,5,5,5,1,,99,,2,,3,,1,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34
|
||||
5/1/2024 10:06:44,5/1/2024 10:15:41,0,50.235.109.170,100,537,1,2021-04-02T10:01:36,parent_survey_response_3,email,EN,1500025,2,2,,4,,2,,"1,5",,,,,,,,,,,,,,2,,5,5,5,4,5,5,5,5,5,4,4,5,4,4,3,4,4,4,4,5,4,4,5,5,2,5,3,4,4,4,4,5,5,5,5,1,,1,,3,,6,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34
|
||||
5/1/2024 10:14:23,5/1/2024 10:22:22,0,73.38.238.192,100,478,1,2021-04-03T10:01:36,parent_survey_response_4,email,EN,1500025,1,,,,,,,,,,,,,,,,,,,,,1,,5,5,5,5,5,5,5,4,5,4,4,4,2,5,4,5,4,5,5,5,3,5,5,5,2,5,1,5,5,5,5,5,5,5,5,1,,1,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34
|
||||
5/1/2024 10:18:39,5/1/2024 10:23:49,0,73.69.158.255,100,310,1,2021-04-04T10:01:36,parent_survey_response_5,email,EN,1500025,2,2,,"1,2,3",,1,,"4,5,8",,,,,,,,,,,,,,2,,5,4,5,5,5,5,1,1,1,1,1,1,3,1,4,4,5,1,1,1,4,1,1,1,4,5,1,5,5,5,5,1,5,1,1,1,,"2,4",,3,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34
|
||||
5/1/2024 10:20:30,5/1/2024 10:25:16,0,73.182.146.201,100,285,1,2021-04-05T10:01:36,parent_survey_response_6,email,EN,1500025,1,,,,,,,,,,,,,,,1,,,,"2,3,4,5,8",,1,,3,3,3,1,3,2,4,2,4,1,1,3,3,4,3,4,1,5,5,4,3,5,4,3,3,1,3,5,5,4,5,4,4,5,4,2,,2,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34
|
||||
5/1/2024 10:14:01,5/1/2024 10:27:19,0,209.107.182.203,100,798,1,2021-04-06T10:01:36,parent_survey_response_7,email,EN,1500025,2,1,,5,,1,,5,,,,,,,,,,,,,,1,,3,3,3,1,3,2,4,2,4,1,1,3,3,4,3,4,1,5,5,4,3,5,4,3,3,1,3,5,5,4,5,4,4,5,4,1,,1,,2,,5,,2,,1,,,Economically Disadvantaged - N,,Not ELL,,Not Special Education,34
|
||||
5/1/2024 10:14:01,5/1/2024 10:27:19,0,209.107.182.203,100,798,1,2021-04-06T10:01:36,parent_survey_response_8,email,EN,1500025,2,1,,5,,1,,5,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
|
||||
|
|
|
|||
|
|
|
@ -315,7 +315,7 @@ def reads_headers_from_raw_csv(processed_data)
|
|||
"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-tint-q1-1", "s-tint-q2-1", "s-tint-q3-1", "s-tint-q4-1", "s-tint-q5-1", "s-acpr-q1-1",
|
||||
"s-acpr-q2-1", "s-acpr-q3-1", "s-acpr-q4-1", "s-peff-q1-1", "s-peff-q2-1", "s-peff-q3-1", "s-peff-q4-1",
|
||||
"s-peff-q5-1", "s-peff-q6-1", "Raw Income", "Income", "Raw ELL", "ELL", "Raw SpEd", "SpEd", "Progress Count", "Housing Status", "Raw Housing Status", "Home Language", "Home Languages"].to_set.sort
|
||||
"s-peff-q5-1", "s-peff-q6-1", "Raw Income", "Income", "Raw ELL", "ELL", "Raw SpEd", "SpEd", "Progress Count", "Housing Status", "Raw Housing Status", "Home Language", "Home Languages", "Declared Races of Children from Parents"].to_set.sort
|
||||
end
|
||||
|
||||
def invalid_rows_are_rejected_for_the_correct_reasons(data)
|
||||
|
|
|
|||
|
|
@ -457,6 +457,92 @@ RSpec.describe SurveyItemValues, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
context ".races_of_children" do
|
||||
context "when there are no races listed" do
|
||||
it "returns an unknown race" do
|
||||
row = {"Race-1" => ""}
|
||||
|
||||
row.keys.each do |key|
|
||||
headers << key
|
||||
end
|
||||
|
||||
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
|
||||
expect(values.races_of_children).to eq [99]
|
||||
end
|
||||
end
|
||||
|
||||
context "when the only races listed are unknown" do
|
||||
it "returns an unknown race" do
|
||||
row = {"Race-1" => "99", "Race-2" => "99", "Race-3" => "", "Race-4" => "nil"}
|
||||
|
||||
row.keys.each do |key|
|
||||
headers << key
|
||||
end
|
||||
|
||||
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
|
||||
expect(values.races_of_children).to eq [99]
|
||||
end
|
||||
end
|
||||
|
||||
context "when there is one race defined" do
|
||||
context "for defined races" do
|
||||
it "returns the qualtrics code of that race" do
|
||||
|
||||
[1,2,3,4,5,8].each do |i|
|
||||
row = {"Race-1" => "#{i}"}
|
||||
|
||||
row.keys.each do |key|
|
||||
headers << key
|
||||
end
|
||||
|
||||
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
|
||||
expect(values.races_of_children).to eq [i]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "when the qualtrics code need to be translated" do
|
||||
it "returns 99 (unknown) for 'prefer not to disclose' or prefer to self describe" do
|
||||
|
||||
row = {"Race-1" => "6"}
|
||||
|
||||
row.keys.each do |key|
|
||||
headers << key
|
||||
end
|
||||
|
||||
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
|
||||
expect(values.races_of_children).to eq [99]
|
||||
|
||||
row = {"Race-1" => "7"}
|
||||
|
||||
row.keys.each do |key|
|
||||
headers << key
|
||||
end
|
||||
|
||||
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
|
||||
expect(values.races_of_children).to eq [99]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
context "when there is more than one race defined" do
|
||||
it "returns the qualtrics code for the two races and the designation for multiracial(100)" do
|
||||
|
||||
row = {"Race-1" => "1", "Race-2" => "2","Race-3" => "3"}
|
||||
|
||||
row.keys.each do |key|
|
||||
headers << key
|
||||
end
|
||||
|
||||
values = SurveyItemValues.new(row:, headers:, survey_items:, schools:, academic_years:)
|
||||
expect(values.races_of_children).to eq [1,2,3,100]
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
context ".respondent_type" do
|
||||
it "reads header to find the survey type" do
|
||||
headers = %w[s-sbel-q5 s-phys-q2 RecordedDate]
|
||||
|
|
|
|||
|
|
@ -120,14 +120,14 @@ describe SurveyResponsesDataLoader do
|
|||
let(:not_ell) { create(:ell, designation: "Not ELL") }
|
||||
let(:unknown_ell) { create(:ell, designation: "Unknown") }
|
||||
|
||||
let(:american_indian) { create(:race, qualtrics_code: 1) }
|
||||
let(:asian) { create(:race, qualtrics_code: 2) }
|
||||
let(:black) { create(:race, qualtrics_code: 3) }
|
||||
let(:latinx) { create(:race, qualtrics_code: 4) }
|
||||
let(:white) { create(:race, qualtrics_code: 5) }
|
||||
let(:middle_eastern) { create(:race, qualtrics_code: 8) }
|
||||
let(:unknown_race) { create(:race, qualtrics_code: 99) }
|
||||
let(:multiracial) { create(:race, qualtrics_code: 100) }
|
||||
let(:american_indian) { create(:race, qualtrics_code: 1, designation: "American Indian or Alaskan Native") }
|
||||
let(:asian) { create(:race, qualtrics_code: 2, designation: "Asian or Pacific Islander") }
|
||||
let(:black) { create(:race, qualtrics_code: 3, designation: "Black or African American") }
|
||||
let(:latinx) { create(:race, qualtrics_code: 4, designation: "Hispanic or Latinx") }
|
||||
let(:white) { create(:race, qualtrics_code: 5, designation: "White or Caucasian") }
|
||||
let(:middle_eastern) { create(:race, qualtrics_code: 8, designation: "Middle Eastern") }
|
||||
let(:unknown_race) { create(:race, qualtrics_code: 99, designation: "Race/Ethnicity Not Listed") }
|
||||
let(:multiracial) { create(:race, qualtrics_code: 100, designation: "Multiracial") }
|
||||
|
||||
let(:languages){
|
||||
create(:language, designation: "English")
|
||||
|
|
@ -265,7 +265,7 @@ describe SurveyResponsesDataLoader do
|
|||
survey_item: SurveyItem.parent_survey_items).count).to eq 23
|
||||
end
|
||||
|
||||
expect(SurveyItemResponse.where(response_id: "parent_survey_response_7").count).to eq 0
|
||||
expect(SurveyItemResponse.where(response_id: "parent_survey_response_8").count).to eq 0
|
||||
end
|
||||
|
||||
it "does not add surveyitems from questions that have been disabled" do
|
||||
|
|
@ -273,6 +273,10 @@ describe SurveyResponsesDataLoader do
|
|||
expect(SurveyItemResponse.where(school:, survey_item: id).count).to eq 0
|
||||
end
|
||||
end
|
||||
|
||||
it "loads the correct set of races for parents" do
|
||||
assigns_races_to_parents
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -465,3 +469,23 @@ def assigns_races_to_students
|
|||
expect(race).to eq value
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def assigns_races_to_parents
|
||||
results = {
|
||||
"parent_survey_response_1" => [american_indian],
|
||||
"parent_survey_response_2" => [unknown_race],
|
||||
"parent_survey_response_3" => [american_indian, latinx, white, multiracial],
|
||||
"parent_survey_response_4" => [unknown_race],
|
||||
"parent_survey_response_5" => [american_indian, asian, black, latinx, white, middle_eastern,
|
||||
multiracial],
|
||||
"parent_survey_response_6" => [american_indian, asian, black, latinx, white, middle_eastern,
|
||||
multiracial],
|
||||
"parent_survey_response_7" => [white] }
|
||||
|
||||
results.each do |key, value|
|
||||
race = SurveyItemResponse.find_by_response_id(key).parent.races.to_a
|
||||
qualtrics = race.map(&:qualtrics_code).sort
|
||||
expect(race).to eq value
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue