From ae5733f176e0a15aba768d4918677c50511cb234 Mon Sep 17 00:00:00 2001 From: Carla Duarte Date: Fri, 9 Apr 2021 09:25:42 -0400 Subject: [PATCH] feat: add letter grade to MFE Progress Tab API --- lms/djangoapps/course_home_api/progress/v1/serializers.py | 1 + lms/djangoapps/course_home_api/progress/v1/views.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lms/djangoapps/course_home_api/progress/v1/serializers.py b/lms/djangoapps/course_home_api/progress/v1/serializers.py index 9e6e7d258c..3878986b90 100644 --- a/lms/djangoapps/course_home_api/progress/v1/serializers.py +++ b/lms/djangoapps/course_home_api/progress/v1/serializers.py @@ -9,6 +9,7 @@ class CourseGradeSerializer(serializers.Serializer): """ Serializer for course grade """ + letter_grade = serializers.CharField() percent = serializers.FloatField() is_passing = serializers.BooleanField(source='passed') diff --git a/lms/djangoapps/course_home_api/progress/v1/views.py b/lms/djangoapps/course_home_api/progress/v1/views.py index 5aa7934512..1397d8dc43 100644 --- a/lms/djangoapps/course_home_api/progress/v1/views.py +++ b/lms/djangoapps/course_home_api/progress/v1/views.py @@ -49,8 +49,10 @@ class ProgressTabView(RetrieveAPIView): incomplete_count: (float) number of incomplete units locked_count: (float) number of units where contains_gated_content is True course_grade: Object containing the following fields: - percent: (float) the user's total graded percent in the course is_passing: (bool) whether the user's grade is above the passing grade cutoff + letter_grade: (str) the user's letter grade based on the set grade range. + If user is passing, value may be 'A', 'B', 'C', 'D', 'Pass', otherwise none + percent: (float) the user's total graded percent in the course section_scores: List of serialized Chapters. Each Chapter has the following fields: display_name: (str) a str of what the name of the Chapter is for displaying on the site subsections: List of serialized Subsections, each has the following fields: