diff --git a/app/models/form/sales/questions/person_age.rb b/app/models/form/sales/questions/person_age.rb index 1cadad453..27b68eed7 100644 --- a/app/models/form/sales/questions/person_age.rb +++ b/app/models/form/sales/questions/person_age.rb @@ -17,11 +17,13 @@ class Form::Sales::Questions::PersonAge < ::Form::Question end def question_number - case form.start_date.year - when 2023 - 29 + (4 * @person_index) - else - 31 + (4 * @person_index) - end + base_question_number = case form.start_date.year + when 2023 + 29 + else + 31 + end + + base_question_number + (4 * @person_index) end end diff --git a/app/models/form/sales/questions/person_age_known.rb b/app/models/form/sales/questions/person_age_known.rb index 7eef1ba10..46509429d 100644 --- a/app/models/form/sales/questions/person_age_known.rb +++ b/app/models/form/sales/questions/person_age_known.rb @@ -28,11 +28,13 @@ class Form::Sales::Questions::PersonAgeKnown < ::Form::Question }.freeze def question_number - case form.start_date.year - when 2023 - 29 + (4 * @person_index) - else - 31 + (4 * @person_index) - end + base_question_number = case form.start_date.year + when 2023 + 29 + else + 31 + end + + base_question_number + (4 * @person_index) end end diff --git a/app/models/form/sales/questions/person_gender_identity.rb b/app/models/form/sales/questions/person_gender_identity.rb index 75846a2f9..2e918e8aa 100644 --- a/app/models/form/sales/questions/person_gender_identity.rb +++ b/app/models/form/sales/questions/person_gender_identity.rb @@ -29,11 +29,13 @@ class Form::Sales::Questions::PersonGenderIdentity < ::Form::Question end def question_number - case form.start_date.year - when 2023 - 30 + (4 * @person_index) - else - 32 + (4 * @person_index) - end + base_question_number = case form.start_date.year + when 2023 + 30 + else + 32 + end + + base_question_number + (4 * @person_index) end end diff --git a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb index a8bd4af7e..0e3c21e2e 100644 --- a/app/models/form/sales/questions/person_relationship_to_buyer_1.rb +++ b/app/models/form/sales/questions/person_relationship_to_buyer_1.rb @@ -23,11 +23,13 @@ class Form::Sales::Questions::PersonRelationshipToBuyer1 < ::Form::Question }.freeze def question_number - case form.start_date.year - when 2023 - 28 + (4 * @person_index) - when 2024 - 30 + (4 * @person_index) - end + base_question_number = case form.start_date.year + when 2023 + 28 + else + 30 + end + + base_question_number + (4 * @person_index) end end diff --git a/app/models/form/sales/questions/person_working_situation.rb b/app/models/form/sales/questions/person_working_situation.rb index 61d2c8b31..29ae4d1bb 100644 --- a/app/models/form/sales/questions/person_working_situation.rb +++ b/app/models/form/sales/questions/person_working_situation.rb @@ -30,11 +30,13 @@ class Form::Sales::Questions::PersonWorkingSituation < ::Form::Question }.freeze def question_number - case form.start_date.year - when 2023 - 31 + (4 * @person_index) - else - 33 + (4 * @person_index) - end + base_question_number = case form.start_date.year + when 2023 + 31 + else + 33 + end + + base_question_number + (4 * @person_index) end end