mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-08 23:18:18 -07:00
Fix: Ensure proper detection of survey type. Make sure to remove any survey item ids that end with the survey variant style of '-1'
This commit is contained in:
parent
5f66d3d99a
commit
ed421ceea8
1 changed files with 1 additions and 1 deletions
|
|
@ -67,7 +67,7 @@ class SurveyItem < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def self.survey_type(survey_item_ids:)
|
||||
survey_item_ids = survey_item_ids.to_set
|
||||
survey_item_ids = survey_item_ids.reject { |id| id.ends_with?('-1') }.to_set
|
||||
return :short_form if survey_item_ids.subset? short_form_survey_items.map(&:survey_item_id).to_set
|
||||
return :early_education if survey_item_ids.subset? early_education_survey_items.map(&:survey_item_id).to_set
|
||||
return :teacher if survey_item_ids.subset? teacher_survey_items.map(&:survey_item_id).to_set
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue