|
|
|
@ -218,7 +218,7 @@ private
|
|
|
|
|
enabled = form.enabled_page_questions(self) |
|
|
|
|
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.values.map { |x| x["value"] }.include?(public_send(question.id)) : false |
|
|
|
|
if !contains_selected_answer_option && respond_to?(question.id.to_s) |
|
|
|
|
if !contains_selected_answer_option && respond_to?(question.id.to_s) && (question.type == "radio" || question.type == "checkbox") |
|
|
|
|
public_send("#{question.id}=", nil) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|