Skip to content

Commit

Permalink
feat: handle optional blocks in verticals
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielVZ96 committed Feb 27, 2024
1 parent b1b62cd commit b857473
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions completion/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,13 @@ def vertical_is_complete(self, item):
if not self.completion_tracking_enabled():
return None

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

# this is temporary local logic and will be removed when the whole course tree is included in completion
child_locations = [
child.location for child in item.get_children() if child.location.block_type != 'discussion'
# for non-optional verticals, only include non-optional children
and (optional_vertical or not getattr(child, "optional_content", False))
]
completions = self.get_completions(child_locations)
for child_location in child_locations:
Expand Down

0 comments on commit b857473

Please sign in to comment.