From 8287e5a13f9b52ee553ab60eab6d7115e22cf3b7 Mon Sep 17 00:00:00 2001 From: Bridger Maxwell Date: Tue, 7 Aug 2012 07:33:35 -0400 Subject: [PATCH] Fixed grading bug where list comprehension variable overrode local variable. --- common/lib/xmodule/xmodule/course_module.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/lib/xmodule/xmodule/course_module.py b/common/lib/xmodule/xmodule/course_module.py index 9385b83c86..7f4c204f45 100644 --- a/common/lib/xmodule/xmodule/course_module.py +++ b/common/lib/xmodule/xmodule/course_module.py @@ -100,12 +100,11 @@ class CourseDescriptor(SequenceDescriptor): sections = [] for s in c.get_children(): if s.metadata.get('graded', False): - # TODO: Only include modules that have a score here - xmoduledescriptors = [s for s in yield_descriptor_descendents(s)] + xmoduledescriptors = [child for child in yield_descriptor_descendents(s)] section_description = { 'section_descriptor' : s, 'xmoduledescriptors' : xmoduledescriptors} - + section_format = s.metadata.get('format', "") graded_sections[ section_format ] = graded_sections.get( section_format, [] ) + [section_description]