Commit dfa6e4c3 by Justin Riley

fix reset for latest 3.091r course xml changes

Recent updates to policy.json in 3.091r course xml changed the grade
data structure returned by edX from:

{'totaled_scores': {'Assessment': [obj, obj, obj, ...]}}

to

{'totaled_scores': {'Assessment1': [obj], 'Assessment2': [obj], ...}

Updated module_tree_reset code to aggregate all of the assessment
objects in this case.
parent 6fdb606f
......@@ -263,7 +263,15 @@ class ProctorModuleInfo(object):
# get grades, match gradeset assignments with StudentModule states, and
# put grades there
self.get_grades(student)
for score in self.gradeset['totaled_scores']['Assessment']:
totaled_scores = self.gradeset['totaled_scores']
try:
assessments = totaled_scores['Assessment']
except KeyError:
assessments = []
for assessment in totaled_scores:
assessments.extend(totaled_scores[assessment])
for score in assessments:
if score.section in smstates:
smstates[score.section].score = score
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment