Skip to content

Commit

Permalink
Address comments on openedx#394
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Shnayder committed Aug 13, 2012
1 parent f1e5c8f commit 60781b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 2 additions & 2 deletions common/lib/xmodule/xmodule/x_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ def get_children(self):
def get_display_items(self):
'''
Returns a list of descendent module instances that will display
immediately inside this module
immediately inside this module.
'''
items = []
for child in self.get_children():
Expand All @@ -238,7 +238,7 @@ def get_display_items(self):
def displayable_items(self):
'''
Returns list of displayable modules contained by this module. If this
module is visible, should return [self]
module is visible, should return [self].
'''
return [self]

Expand Down
10 changes: 3 additions & 7 deletions lms/djangoapps/courseware/grades.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,11 @@ def progress_summary(student, course, grader, student_module_cache):
instance_modules for the student
"""
chapters = []
for c in course.get_children():
# Don't include chapters that aren't displayable (e.g. due to error)
if c not in c.displayable_items():
continue
# Don't include chapters that aren't displayable (e.g. due to error)
for c in course.get_display_items():
sections = []
for s in c.get_children():
for s in c.get_display_items():
# Same for sections
if s not in s.displayable_items():
continue
graded = s.metadata.get('graded', False)
scores = []
for module in yield_module_descendents(s):
Expand Down

0 comments on commit 60781b8

Please sign in to comment.