Browse Source

Reset all invalidated page questions

pull/409/head
baarkerlounger 3 years ago
parent
commit
1a01921329
  1. 2
      app/models/case_log.rb
  2. 42
      config/forms/2021_2022.json

2
app/models/case_log.rb

@ -296,7 +296,7 @@ private
enabled = form.enabled_page_questions(self) enabled = form.enabled_page_questions(self)
answer_options = enabled.map(&:id).include?(question.id) ? enabled.find { |q| q.id == question.id }.answer_options : [] answer_options = enabled.map(&:id).include?(question.id) ? enabled.find { |q| q.id == question.id }.answer_options : []
contains_selected_answer_option = answer_options.present? ? answer_options.key?(public_send(question.id).to_s) : false contains_selected_answer_option = answer_options.present? ? answer_options.key?(public_send(question.id).to_s) : false
if !contains_selected_answer_option && respond_to?(question.id.to_s) && (question.type == "radio" || question.type == "checkbox") if !contains_selected_answer_option && respond_to?(question.id.to_s)
public_send("#{question.id}=", nil) public_send("#{question.id}=", nil)
end end
end end

42
config/forms/2021_2022.json

@ -5592,11 +5592,35 @@
}, },
"depends_on": [ "depends_on": [
{ {
"has_benefits": 1, "hb": 1,
"household_charge": 0 "household_charge": 0
}, },
{ {
"has_benefits": 1, "hb": 1,
"household_charge": null
},
{
"hb": 6,
"household_charge": 0
},
{
"hb": 6,
"household_charge": null
},
{
"hb": 7,
"household_charge": 0
},
{
"hb": 7,
"household_charge": null
},
{
"hb": 8,
"household_charge": 0
},
{
"hb": 8,
"household_charge": null "household_charge": null
} }
] ]
@ -5619,7 +5643,19 @@
}, },
"depends_on": [ "depends_on": [
{ {
"has_benefits": 1, "hb": 1,
"hbrentshortfall": 0
},
{
"hb": 6,
"hbrentshortfall": 0
},
{
"hb": 7,
"hbrentshortfall": 0
},
{
"hb": 8,
"hbrentshortfall": 0 "hbrentshortfall": 0
} }
] ]

Loading…
Cancel
Save