Skip to content
Snippets Groups Projects
Unverified Commit 6e843f9e authored by Carla Duarte's avatar Carla Duarte Committed by GitHub
Browse files

Merge pull request #27800 from edx/ciduarte/AA-807

feat: surface subsection block keys in progress api
parents 07ab9f4c cecd37c4
No related branches found
No related tags found
No related merge requests found
......@@ -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.
......
......@@ -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']
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment