|
|
@ -47,15 +47,15 @@ private |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def get_answer_label(question, lettings_log) |
|
|
|
def get_answer_label(question, lettings_log) |
|
|
|
question.answer_label(lettings_log, current_user).presence || unanswered_value(log: lettings_log) |
|
|
|
question.answer_label(lettings_log, current_user).presence || unanswered_value(log: lettings_log, question:) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def get_question_label(question) |
|
|
|
def get_question_label(question) |
|
|
|
[question.question_number_string, question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ") |
|
|
|
[question.question_number_string, question.check_answer_label.to_s.presence || question.header.to_s].compact.join(" - ") |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def unanswered_value(log:) |
|
|
|
def unanswered_value(log:, question:) |
|
|
|
if log.creation_method_bulk_upload? && log.bulk_upload.present? |
|
|
|
if log.creation_method_bulk_upload? && log.bulk_upload.present? && !log.optional_fields.include?(question.id) |
|
|
|
"<span class=\"app-!-colour-red\">You still need to answer this question</span>".html_safe |
|
|
|
"<span class=\"app-!-colour-red\">You still need to answer this question</span>".html_safe |
|
|
|
else |
|
|
|
else |
|
|
|
"<span class=\"app-!-colour-muted\">You didn’t answer this question</span>".html_safe |
|
|
|
"<span class=\"app-!-colour-muted\">You didn’t answer this question</span>".html_safe |
|
|
|