fix: have progress MFE API recalculate visible course grade

Previously, the course grade returned would be the stored grade,
which is calculated for all content, not just the visible grades.
(Some grades are not yet released to the learner.)

This fix recalculates the overall grade before sending to the MFE,
so that it doesn't have to recompute it itself (without all the
particular logic that the platform uses when grading).

AA-1217
This commit is contained in:
Michael Terry
2022-03-11 09:01:13 -05:00
parent c32d3b2762
commit a162140492
6 changed files with 81 additions and 37 deletions

View File

@@ -282,7 +282,7 @@ class TestSubmittingProblems(ModuleStoreTestCase, LoginEnrollmentTestCase, Probl
Returns list of scores: [<points on hw_1>, <points on hw_2>, ..., <points on hw_n>]
"""
return [
s.graded_total.earned for s in self.get_course_grade().graded_subsections_by_format['Homework'].values()
s.graded_total.earned for s in self.get_course_grade().graded_subsections_by_format()['Homework'].values()
]
def hw_grade(self, hw_url_name):