Skip to content

Commit

Permalink
refactor: rename to optional completion
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVZ96 committed Feb 29, 2024
1 parent 51c5c24 commit aae6b92
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions completion/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ def vertical_is_complete(self, item):
if not self.completion_tracking_enabled():
return None

optional_vertical = getattr(item, "optional_content", False)
optional_vertical = getattr(item, "optional_completion", False)

Check warning on line 120 in completion/services.py

View check run for this annotation

Codecov / codecov/patch

completion/services.py#L120

Added line #L120 was not covered by tests

# this is temporary local logic and will be removed when the whole course tree is included in completion
child_locations = [
child.scope_ids.usage_id for child in self.get_completable_children(item)
# for non-optional verticals, only include non-optional children
if optional_vertical or not getattr(child, "optional_content", False)
# if vertical is optional, include all children
# else only include non-optional children
if optional_vertical or not getattr(child, "optional_completion", False)
]
completions = self.get_completions(child_locations)
for child_location in child_locations:
Expand Down

0 comments on commit aae6b92

Please sign in to comment.