feat: Adds disable_progress_graph attribute to the returned course_metadata response

Currently, https://github.com/openedx/frontend-app-course-authoring/issues/517 faces an issue when the
progress graph toggle is enabled/disabled but the settings are not respected, the disable_progress_graph
attribute will allow the frontend-app-learning repo to use this attribute to respect the settings authored
from frontend-app-course-authoring and ultimately fix https://github.com/openedx/frontend-app-course-authoring/issues/517.
This commit is contained in:
Rafay Ghafoor
2023-09-21 16:24:42 +05:00
committed by Navin Karkera
parent 254903531a
commit b14396bbfb
2 changed files with 3 additions and 0 deletions

View File

@@ -145,3 +145,4 @@ class ProgressTabSerializer(VerifiedModeSerializer):
username = serializers.CharField()
user_has_passing_grade = serializers.BooleanField()
verification_data = VerificationDataSerializer()
disable_progress_graph = serializers.BooleanField()

View File

@@ -230,6 +230,7 @@ class ProgressTabView(RetrieveAPIView):
block = modulestore().get_course(course_key)
grading_policy = block.grading_policy
disable_progress_graph = block.disable_progress_graph
verification_status = IDVerificationService.user_status(student)
verification_link = None
if verification_status['status'] is None or verification_status['status'] == 'expired':
@@ -259,6 +260,7 @@ class ProgressTabView(RetrieveAPIView):
'username': username,
'user_has_passing_grade': user_has_passing_grade,
'verification_data': verification_data,
'disable_progress_graph': disable_progress_graph,
}
context = self.get_serializer_context()
context['staff_access'] = is_staff