Browse Source

Revert "CLDC-4402: add log incomplete questions method"

This reverts commit a16e208ac1.
CLDC-4402-audit-start-year-2024-or-later-usage
samyou-softwire 1 day ago
parent
commit
488efc0f30
  1. 7
      app/models/log.rb

7
app/models/log.rb

@ -392,13 +392,6 @@ private
form.subsections.all? { |subsection| subsection.complete?(self) || subsection.not_displayed_in_tasklist?(self) } form.subsections.all? { |subsection| subsection.complete?(self) || subsection.not_displayed_in_tasklist?(self) }
end end
# useful for testing, call .send("incomplete_questions") to see why a log is not complete
def incomplete_questions
form.subsections
.filter { |subsection| !subsection.complete?(self) && subsection.displayed_in_tasklist?(self) }
.flat_map { |subsection| subsection.questions.filter { |question| !question.completed?(self) && question.displayed_to_user?(self) && !question.derived?(self) } }
end
def all_subsections_unstarted? def all_subsections_unstarted?
not_started_statuses = %i[not_started cannot_start_yet] not_started_statuses = %i[not_started cannot_start_yet]
form.subsections.all? { |subsection| not_started_statuses.include? subsection.status(self) } form.subsections.all? { |subsection| not_started_statuses.include? subsection.status(self) }

Loading…
Cancel
Save