|
|
@ -77,12 +77,10 @@ class Form |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def checkbox_questions_for_page(page) |
|
|
|
def checkbox_questions_for_page(page) |
|
|
|
questions = {} |
|
|
|
checkbox_questions = questions_for_page(page).select { |_title, question| question["type"] == "checkbox" } |
|
|
|
questions_for_page = all_pages[page]["questions"] |
|
|
|
checkbox_questions.flat_map do |title, question| |
|
|
|
checkbox_questions = questions_for_page.select { |_title, question| question["type"] == "checkbox" } |
|
|
|
question["answer_options"].keys.reject { |key, _value| key.match?(/divider/) } |
|
|
|
checkbox_questions.each { |title, question| |
|
|
|
end |
|
|
|
questions[title] = question["answer_options"].keys.reject { |key, _value| key.match?(/divider/) } } |
|
|
|
|
|
|
|
questions.map { |_key, value| value }.flatten |
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
end |
|
|
|
end |
|
|
|