diff --git a/app/services/survey_responses_data_loader.rb b/app/services/survey_responses_data_loader.rb index 9e92af90..8f39c125 100644 --- a/app/services/survey_responses_data_loader.rb +++ b/app/services/survey_responses_data_loader.rb @@ -37,7 +37,11 @@ class SurveyResponsesDataLoader survey_items.map do |survey_item| likert_score = row[survey_item.survey_item_id] next if likert_score.nil? - next unless likert_score.valid_likert_score? + + unless likert_score.valid_likert_score? + puts "Response ID: #{response_id}, Likert score: #{likert_score} rejected" unless likert_score == 'NA' + next + end survey_item_response = SurveyItemResponse.where(response_id:, survey_item:).first if survey_item_response.present? diff --git a/doc/architectural_decision_records/8.md b/doc/architectural_decision_records/8.md new file mode 100644 index 00000000..2fa55fd7 --- /dev/null +++ b/doc/architectural_decision_records/8.md @@ -0,0 +1,18 @@ +# Decision record 8 + +# Capture information about rejected survey item responses + +## Status + +Completed + +## Context + +The script to import survey item responses was previously silently rejecting values outside of the likert score range of 1-5. This led to situations where the average scores on google sheets did not match the average likert score on the site. The google sheets score was averaging invalid likert scores where the site was not. +## Decision + +Now instead of silently rejecting invalid values we print any values we rejected. + +## Consequences + +This change should make it clearer when some data is being filtered from upload to the database