|
|
|
@ -1,4 +1,6 @@
|
|
|
|
|
class Form::Subsection |
|
|
|
|
include Constants::CaseLog |
|
|
|
|
|
|
|
|
|
attr_accessor :id, :label, :section, :pages, :depends_on, :form |
|
|
|
|
|
|
|
|
|
def initialize(id, hsh, section) |
|
|
|
@ -30,7 +32,7 @@ class Form::Subsection
|
|
|
|
|
return :cannot_start_yet |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
qs = applicable_questions(case_log) |
|
|
|
|
qs = applicable_questions(case_log).reject { |q| OPTIONAL_FIELDS.include?(q.id) } |
|
|
|
|
return :not_started if qs.all? { |question| case_log[question.id].blank? || question.read_only? } |
|
|
|
|
return :completed if qs.all? { |question| question.completed?(case_log) } |
|
|
|
|
|
|
|
|
|