From 0cd497d184fa2b91cbda70f59c7da60cbee316f2 Mon Sep 17 00:00:00 2001 From: Rafay Ghafoor Date: Thu, 21 Sep 2023 13:24:42 +0200 Subject: [PATCH] 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. (cherry picked from commit b14396bbfb36845903791b5b5677496e6a816e8a) --- lms/djangoapps/course_home_api/progress/serializers.py | 1 + lms/djangoapps/course_home_api/progress/views.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/lms/djangoapps/course_home_api/progress/serializers.py b/lms/djangoapps/course_home_api/progress/serializers.py index 190cd76bf9b5..6bdc204434af 100644 --- a/lms/djangoapps/course_home_api/progress/serializers.py +++ b/lms/djangoapps/course_home_api/progress/serializers.py @@ -145,3 +145,4 @@ class ProgressTabSerializer(VerifiedModeSerializer): username = serializers.CharField() user_has_passing_grade = serializers.BooleanField() verification_data = VerificationDataSerializer() + disable_progress_graph = serializers.BooleanField() diff --git a/lms/djangoapps/course_home_api/progress/views.py b/lms/djangoapps/course_home_api/progress/views.py index dc0ea63525f7..5d0f8a08f42d 100644 --- a/lms/djangoapps/course_home_api/progress/views.py +++ b/lms/djangoapps/course_home_api/progress/views.py @@ -228,6 +228,7 @@ def get(self, request, *args, **kwargs): descriptor = modulestore().get_course(course_key) grading_policy = descriptor.grading_policy + disable_progress_graph = descriptor.disable_progress_graph verification_status = IDVerificationService.user_status(student) verification_link = None if verification_status['status'] is None or verification_status['status'] == 'expired': @@ -257,6 +258,7 @@ def get(self, request, *args, **kwargs): '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