Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Data Researcher to have access on course progress page of Students #151

Open
OmarIthawi opened this issue Nov 22, 2024 · 4 comments
Open
Assignees
Labels
customer-reported Issues reported from the customers in production environment. important Takes priority over other tasks

Comments

@OmarIthawi
Copy link
Collaborator

Current Status

Data Researcher cannot access the student progress page on couses they're data researchers on.

This is the standard edx-platform permissions.

Desired Status

The Data Researcher can access the progress page on courses they're data researchers on, or on all courses if they have tenant-wide Data Researcher access.

@OmarIthawi OmarIthawi added important Takes priority over other tasks customer-reported Issues reported from the customers in production environment. labels Nov 22, 2024
@OmarIthawi
Copy link
Collaborator Author

This is a frustration that customers are facing.

We hope that's a quick fix via the permissions.py files, regardless we can discuss the implementation details in a way that's upgrade friendly.

@tehreem-sadat
Copy link
Collaborator

Following Open edX APIs are involved to access progress page on the basis of another learner from frontend.

  • /api/course_home/v1/progress/<course-key/
  • /api/course_home/v1/course_metadata//

In order to make progress page accessible:

  • user need to be enrolled in the course
    • enrolment checks are there in both above mentioned API's and even to enable 'progressTab'
  • user must have staff access
    • There is a check in progress API that says that user can only access other users progress page if it has course access or CCX_COACH.

Here is the diff of changes I made to progress page accessible

diff --git a/lms/djangoapps/course_home_api/course_metadata/views.py b/lms/djangoapps/course_home_api/course_metadata/views.py
index e534d03..2620a62 100644
--- a/lms/djangoapps/course_home_api/course_metadata/views.py
+++ b/lms/djangoapps/course_home_api/course_metadata/views.py
@@ -82,11 +82,12 @@ class CourseHomeMetadataView(RetrieveAPIView):
         # We must compute course load access *before* setting up masquerading,
         # else course staff (who are not enrolled) will not be able view
         # their course from the perspective of a learner.
+        
         load_access = check_course_access(
             course,
             request.user,
             'load',
-            check_if_enrolled=True,
+            check_if_enrolled=False,
             check_if_authenticated=True,
             apply_enterprise_checks=True,
         )
diff --git a/lms/djangoapps/course_home_api/progress/views.py b/lms/djangoapps/course_home_api/progress/views.py
index dc0ea63..2cf39fa 100644
--- a/lms/djangoapps/course_home_api/progress/views.py
+++ b/lms/djangoapps/course_home_api/progress/views.py
@@ -165,8 +165,8 @@ class ProgressTabView(RetrieveAPIView):
 
         has_access_on_students_profiles = is_staff or coach_access
         # Requesting access to a different student's profile
-        if not has_access_on_students_profiles:
-            raise Http404
+        # if not has_access_on_students_profiles:
+        #     raise Http404
 
         try:
             return User.objects.get(id=student_id)
@@ -196,8 +196,8 @@ class ProgressTabView(RetrieveAPIView):
         enrollment = CourseEnrollment.get_enrollment(student, course_key)
         enrollment_mode = getattr(enrollment, 'mode', None)
 
-        if not (enrollment and enrollment.is_active) and not is_staff:
-            return Response('User not enrolled.', status=401)
+        # if not (enrollment and enrollment.is_active) and not is_staff:  #TEHREEM
+        #     return Response('User not enrolled.', status=401)
 
         # The block structure is used for both the course_grade and has_scheduled content fields
         # So it is called upfront and reused for optimization purposes

With above changes I can not see Progress Tab as I am not enrolled in the course and just commented out the enrolment check but I can access progress page from direct URL.

image

@tehreem-sadat
Copy link
Collaborator

tehreem-sadat commented Dec 6, 2024

@OmarIthawi With above R&D there is no quicker way to access progress page.

There are following options
1- We need to change both backend and frontend edX code for the support of data-researchers.
2- We can add our custom or copied frontend and use fx dashboard APIs as a backend

CC: @shadinaif

@OmarIthawi
Copy link
Collaborator Author

@shadinaif @tehreem-sadat I think this means that open edx doesn't support the standard permissions.py for viewing the progress.

If so, we should follow the following path:

Let me know what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported Issues reported from the customers in production environment. important Takes priority over other tasks
Projects
None yet
Development

No branches or pull requests

2 participants