Update Subsection Grade Report to differentiate Not Attempted and 0
TNL-5990
This commit is contained in:
@@ -18,7 +18,7 @@ def grading_context_for_course(course_key):
|
||||
def grading_context(course_structure):
|
||||
"""
|
||||
This returns a dictionary with keys necessary for quickly grading
|
||||
a student. They are used by grades.grade()
|
||||
a student.
|
||||
|
||||
The grading context has two keys:
|
||||
all_graded_subsections_by_type - This contains all subsections that are
|
||||
@@ -27,7 +27,7 @@ def grading_context(course_structure):
|
||||
The values are arrays of dictionaries containing
|
||||
"subsection_block" : The subsection block
|
||||
"scored_descendants" : An array of usage keys for blocks
|
||||
could possibly be in the subsection, for any student
|
||||
that could possibly be in the subsection, for any student
|
||||
|
||||
all_graded_blocks - This contains a list of all blocks that can
|
||||
affect grading a student. This is used to efficiently fetch
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
CourseGrade Class
|
||||
"""
|
||||
|
||||
from collections import defaultdict
|
||||
from collections import namedtuple
|
||||
from collections import defaultdict, namedtuple, OrderedDict
|
||||
from logging import getLogger
|
||||
|
||||
from django.conf import settings
|
||||
@@ -44,13 +43,13 @@ class CourseGrade(object):
|
||||
Returns grades for the subsections in the course in
|
||||
a dict keyed by subsection format types.
|
||||
"""
|
||||
subsections_by_format = defaultdict(list)
|
||||
subsections_by_format = defaultdict(OrderedDict)
|
||||
for chapter in self.chapter_grades:
|
||||
for subsection_grade in chapter['sections']:
|
||||
if subsection_grade.graded:
|
||||
graded_total = subsection_grade.graded_total
|
||||
if graded_total.possible > 0:
|
||||
subsections_by_format[subsection_grade.format].append(subsection_grade)
|
||||
subsections_by_format[subsection_grade.format][subsection_grade.location] = subsection_grade
|
||||
return subsections_by_format
|
||||
|
||||
@lazy
|
||||
|
||||
Reference in New Issue
Block a user