@ -73,7 +73,7 @@ private
end
end
if session [ " fields " ]
if session [ " fields " ]
session [ " fields " ] . each do | field , value |
session [ " fields " ] . each do | field , value |
unless @case_log . form . get_question ( field , @case_log ) . type == " date "
unless @case_log . form . get_question ( field , @case_log ) & . type == " date "
@case_log [ field ] = value
@case_log [ field ] = value
end
end
end
end
@ -161,10 +161,11 @@ private
def question_missing_response? ( responses_for_page , question )
def question_missing_response? ( responses_for_page , question )
if %w[ checkbox validation_override ] . include? ( question . type )
if %w[ checkbox validation_override ] . include? ( question . type )
question . answer_options . keys . reject { | x | x . match ( / divider / ) } . all? do | option |
answered = question . answer_options . keys . reject { | x | x . match ( / divider / ) } . map do | option |
session [ " fields " ] [ option ] = @case_log [ option ] = params [ " case_log " ] [ question . id ] . include? ( option ) ? 1 : 0
session [ " fields " ] [ option ] = @case_log [ option ] = params [ " case_log " ] [ question . id ] . include? ( option ) ? 1 : 0
params [ " case_log " ] [ question . id ] . exclude? ( option )
params [ " case_log " ] [ question . id ] . exclude? ( option )
end
end
answered . all?
else
else
session [ " fields " ] [ question . id ] = @case_log [ question . id ] = responses_for_page [ question . id ]
session [ " fields " ] [ question . id ] = @case_log [ question . id ] = responses_for_page [ question . id ]
responses_for_page [ question . id ] . nil? || responses_for_page [ question . id ] . blank?
responses_for_page [ question . id ] . nil? || responses_for_page [ question . id ] . blank?