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

PADV 916 - CCX support for Gradebook #111

Merged
merged 1 commit into from
Jan 11, 2024

Conversation

alexjmpb
Copy link

Ticket

https://agile-jira.pearson.com/browse/PADV-916

Description

Due to necessity, we found that the gradebook was not working for CCXs after migration. This PR aims to add CCX compatibility to the gradebook.

Changes

  • Modify gradebook API authorization to allow CCXs.

How to test?

  • Setup devstack
  • Checkout to this branch
  • Create a CCX (licensed or not)
  • Verify the access to the gradebook with a CCX coach, Instructor or Staff user.

Screenshots

Screenshot from 2023-12-26 17-20-04

Copy link

@Jacatove Jacatove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When you edit course_author_access_required you are not only affecting CourseGradingView, these views are also updated:

  • CourseImportView
  • CourseQualityView
  • CourseValidationView

Might some of them still be important for CCXs?

My initial comment is to extend the platform rather than modify it, given set that, I would recommend creating a new decorator for GradebookView. Then we can discuss the code. @alexjmpb

@Jacatove
Copy link

Jacatove commented Dec 28, 2023

I was conducting this test and the has_user method seems to work:

from common.djangoapps.student.roles import CourseCcxCoachRole, CourseInstructorRole, CourseStaffRole
from django.contrib.auth.models import User
from ccx_keys.locator import CCXLocator

ccx = CCXLocator.from_string('ccx-v1:VUE+1001+2023+ccx@27')

ccx_coach = User.objects.get(email='[email protected]')
instructor = User.objects.get(email='[email protected]') # I added this user to the ccx as admin

CourseCcxCoachRole(ccx).has_user(ccx_coach) # Result is False, since ccx_coach has the role on the master course.
CourseStaffRole(ccx).has_user(coach) # Got True
CourseInstructorRole(ccx).has_user(instructor) # Got True

Besides the has_user working, there might not need to check if a user has the CCX_COACH role on a CCX, since that role is intended only for regular courses and not for CCXs. @alexjmpb

@alexjmpb alexjmpb merged commit 2be76ad into pearson-release/olive.stage Jan 11, 2024
5 of 35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants