Commit 66985ff9 by Matt Drayer Committed by Jonathan Piacenti

mattdrayer/api-gradingpolicy: Grading policy now returned when retrieving a users course grades

parent 42de3d89
......@@ -913,9 +913,6 @@ class UsersApiTests(TestCase):
response = self.do_get(test_uri)
self.assertEqual(response.status_code, 200)
print 'data type == ' + response.data.__class__.__name__
print 'data = {}'.format(response.data)
courseware_summary = response.data['courseware_summary']
self.assertEqual(len(courseware_summary), 2)
self.assertEqual(courseware_summary[0]['course'], 'Robot Super Course')
......@@ -931,6 +928,12 @@ class UsersApiTests(TestCase):
self.assertEqual(sections[0]['display_name'], 'Sequence 2')
self.assertEqual(sections[0]['graded'], False)
grade_summary = response.data['grade_summary']
self.assertGreater(len(grade_summary['section_breakdown']), 0)
grading_policy = response.data['grading_policy']
self.assertGreater(len(grading_policy['GRADER']), 0)
self.assertIsNotNone(grading_policy['GRADE_CUTOFFS'])
def is_user_profile_created_updated(self, response, data):
"""This function compare response with user profile data """
......
......@@ -782,10 +782,12 @@ class UsersCoursesGradesDetail(SecureAPIView):
courseware_summary = grades.progress_summary(student, request, course)
grade_summary = grades.grade(student, request, course)
grading_policy = course.grading_policy
response_data = {
'courseware_summary': courseware_summary,
'grade_summary': grade_summary
'grade_summary': grade_summary,
'grading_policy': grading_policy
}
return Response(response_data)
......
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