diff --git a/app/views/submissions/_value.html.erb b/app/views/submissions/_value.html.erb index 156bfcbb..d65e3db1 100644 --- a/app/views/submissions/_value.html.erb +++ b/app/views/submissions/_value.html.erb @@ -18,7 +18,8 @@ <% elsif field['type'].in?(%w[multiple radio]) && area['option_uuid'] %> <% option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] } %> - <% if option && Array.wrap(value).include?(option['value']) %> + <% option_name = option['value'].presence || "Option #{field['options'].index(option) + 1}" %> + <% if option && Array.wrap(value).include?(option_name) %>
<%= svg_icon('check', class: "aspect-square #{area['w'] > area['h'] ? '!w-auto !h-full' : '!w-full !h-auto'}") %>
diff --git a/lib/submissions/generate_result_attachments.rb b/lib/submissions/generate_result_attachments.rb index 3b58a616..10b0bf1c 100644 --- a/lib/submissions/generate_result_attachments.rb +++ b/lib/submissions/generate_result_attachments.rb @@ -159,7 +159,9 @@ module Submissions if field['type'].in?(%w[multiple radio]) option = field['options']&.find { |o| o['uuid'] == area['option_uuid'] } - value = Array.wrap(value).include?(option['value']) + option_name = option['value'].presence || "Option #{field['options'].index(option) + 1}" + + value = Array.wrap(value).include?(option_name) end next unless value == true