diff --git a/lms/djangoapps/course_home_api/outline/v1/views.py b/lms/djangoapps/course_home_api/outline/v1/views.py index 7bbb48530e..5f90f99b67 100644 --- a/lms/djangoapps/course_home_api/outline/v1/views.py +++ b/lms/djangoapps/course_home_api/outline/v1/views.py @@ -83,7 +83,7 @@ class OutlineTabView(RetrieveAPIView): expiration_date: (str) When the access expires, in ISO 8601 notation masquerading_expired_course: (bool) Whether this course is expired for the masqueraded user upgrade_deadline: (str) Last chance to upgrade, in ISO 8601 notation (or None if can't upgrade anymore) - upgrade_url: (str) Upgrade linke (or None if can't upgrade anymore) + upgrade_url: (str) Upgrade link (or None if can't upgrade anymore) course_blocks: blocks: List of serialized Course Block objects. Each serialization has the following fields: id: (str) The usage ID of the block. diff --git a/lms/djangoapps/course_home_api/progress/v1/serializers.py b/lms/djangoapps/course_home_api/progress/v1/serializers.py index 3ba2934926..6ad65767cc 100644 --- a/lms/djangoapps/course_home_api/progress/v1/serializers.py +++ b/lms/djangoapps/course_home_api/progress/v1/serializers.py @@ -21,6 +21,7 @@ class SubsectionScoresSerializer(serializers.Serializer): """ assignment_type = serializers.CharField(source='format') display_name = serializers.CharField() + block_key = serializers.SerializerMethodField() has_graded_assignment = serializers.BooleanField(source='graded') num_points_earned = serializers.IntegerField(source='graded_total.earned') num_points_possible = serializers.IntegerField(source='graded_total.possible') @@ -29,6 +30,9 @@ class SubsectionScoresSerializer(serializers.Serializer): show_grades = serializers.SerializerMethodField() url = serializers.SerializerMethodField() + def get_block_key(self, subsection): + return str(subsection.location) + def get_url(self, subsection): relative_path = reverse('jump_to', args=[self.context['course_key'], subsection.location]) request = self.context['request'] diff --git a/lms/djangoapps/course_home_api/progress/v1/views.py b/lms/djangoapps/course_home_api/progress/v1/views.py index 3b099defb7..db8f7649f2 100644 --- a/lms/djangoapps/course_home_api/progress/v1/views.py +++ b/lms/djangoapps/course_home_api/progress/v1/views.py @@ -66,6 +66,7 @@ class ProgressTabView(RetrieveAPIView): 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: assignment_type: (str) the format, if any, of the Subsection (Homework, Exam, etc) + block_key: (str) the key of the given subsection block display_name: (str) a str of what the name of the Subsection is for displaying on the site has_graded_assignment: (bool) whether or not the Subsection is a graded assignment num_points_earned: (int) the amount of points the user has earned for the given subsection