diff --git a/app/models/form/question.rb b/app/models/form/question.rb
index a3b8ea21b..ca1eef09a 100644
--- a/app/models/form/question.rb
+++ b/app/models/form/question.rb
@@ -86,15 +86,18 @@ class Form::Question
end
end
- def update_answer_link_name(case_log)
- link_type = if has_inferred_check_answers_value?(case_log)
- "Change"
- elsif type == "checkbox"
- answer_options.keys.any? { |key| value_is_yes?(case_log[key]) } ? "Change" : "Answer"
- else
- case_log[id].blank? ? "Answer" : "Change"
- end
- "#{link_type} #{check_answer_label.to_s.downcase}".html_safe
+ def action_text(case_log)
+ if has_inferred_check_answers_value?(case_log)
+ "Change"
+ elsif type == "checkbox"
+ answer_options.keys.any? { |key| value_is_yes?(case_log[key]) } ? "Change" : "Answer"
+ else
+ case_log[id].blank? ? "Answer" : "Change"
+ end
+ end
+
+ def action_href(case_log, page_id)
+ "/logs/#{case_log.id}/#{page_id.to_s.dasherize}?referrer=check_answers"
end
def completed?(case_log)
diff --git a/app/views/form/_check_answers_summary_list.html.erb b/app/views/form/_check_answers_summary_list.html.erb
new file mode 100644
index 000000000..a2aa3311f
--- /dev/null
+++ b/app/views/form/_check_answers_summary_list.html.erb
@@ -0,0 +1,18 @@
+<%= govuk_summary_list do |summary_list| %>
+ <% subsection.applicable_questions(@case_log).each do |question| %>
+ <% summary_list.row do |row| %>
+ <% row.key { question.check_answer_label.to_s.presence || question.header.to_s } %>
+ <% row.value do %>
+ <%= get_answer_label(question, @case_log) %>
+ <% question.get_inferred_answers(@case_log).each do |inferred_answer| %>
+ <%= inferred_answer %>
+ <% end %>
+ <% end %>
+ <% row.action(
+ text: question.action_text(@case_log),
+ href: question.action_href(@case_log, question.page.id),
+ visually_hidden_text: question.check_answer_label.to_s.downcase,
+ ) %>
+ <% end %>
+ <% end %>
+<% end %>
diff --git a/app/views/form/_check_answers_table.html.erb b/app/views/form/_check_answers_table.html.erb
deleted file mode 100644
index c34c868e0..000000000
--- a/app/views/form/_check_answers_table.html.erb
+++ /dev/null
@@ -1,14 +0,0 @@
-