mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Print a message when a survey item response is rejected from database import due to an invalid likert score
This commit is contained in:
parent
d4413f6886
commit
2d945fb696
2 changed files with 23 additions and 1 deletions
|
|
@ -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?
|
||||
|
|
|
|||
18
doc/architectural_decision_records/8.md
Normal file
18
doc/architectural_decision_records/8.md
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue