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: Teaching Assistant role [BB-8580] #632

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

0x29a
Copy link
Member

@0x29a 0x29a commented Feb 13, 2024

Description

Adds a new Teaching Assistant course team role, which is similar to eSHE Instructor, with the only difference being that it doesn't have access to viewing and modifying grades.

Provided you set ENABLE_TEACHING_ASSISTANT_ROLE feature flag to True, as an Admin or Staff, you should see this on the Membership tab of the instructor dashboard:

Screenshot

image

Here is how the dashboard looks for a user with this role:

Screenshot

image

You can see that the Membership tab is hidden and that the Student Admin tab contains only two sections, unlike the regular Staff, from which the role in question is derived:

Screenshot

image

This role should be composable with any other course team roles. For example, Teaching Assistant + Admin will have the same permissions as Admin. Teaching Assistant + Discussion Admin will be able to access the membership tab, but assign only forum-related roles.

Testing instructions

  1. Switch your devstack to the 0x29a/bb8580/teaching-assistant branch from the [email protected]:open-craft/edx-platform.git repo.
  2. Set ENABLE_TEACHING_ASSISTANT_ROLE to True.
  3. Create two users: [email protected] and [email protected]. Give the former Staff course team role using the Instructor Dashboard.
  4. Since we've changed the instructor.enroll, instructor.give_student_extension, and instructor.override_grades permissions, verify that [email protected] still can enroll students (Membership tab) and that all features on the Student Admin tab work for this user as before.
  5. Now, give [email protected] the Teaching Assistant role.
  6. As [email protected], verify that you have access to the Instructor Dashboard, but not to the Membership tab.
  7. Also, check that [email protected] sees only two sections on the Student Admin tab of the dashboard.
  8. Now, give [email protected] the Staff role and verify that it has all Staff permissions (can enroll students, see the Membership tab and all Student Admin content).
  9. Remove the Staff role from [email protected], give Discussion Admin and verify that it can assign forum moderator roles.
  10. Remove the Forum Discussion role from [email protected], give Data Researcher and verify that it can access the Data Download tab.

Additionally, this script can be used to test that the instructor.enroll, instructor.give_student_extension, and instructor.override_grades permissions work as expected:

from django.contrib.auth import get_user_model
from openedx.core.lib.courses import get_course_by_id
from opaque_keys.edx.keys import CourseKey
from lms.djangoapps.courseware.rules import HasAccessRule, HasRolesRule

course_key = CourseKey.from_string("course-v1:Test+Test+Test")
course = get_course_by_id(course_key)
user = get_user_model().objects.get(email="[email protected]")

assert not user.has_perm('instructor.enroll', course_key)
assert not user.has_perm('instructor.give_student_extension', course_key)
assert not user.has_perm('instructor.override_grades', course_key)

@0x29a 0x29a force-pushed the 0x29a/bb8580/teaching-assistant branch 2 times, most recently from 9f4c91c to 41ebe7f Compare February 13, 2024 12:11
@0x29a 0x29a force-pushed the 0x29a/bb8580/teaching-assistant branch from 41ebe7f to 176de06 Compare February 13, 2024 12:36
Copy link

@CefBoud CefBoud left a comment

Choose a reason for hiding this comment

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

Great job on this one, @0x29a !
LGTM ✅

  • I tested this: followed the testing instructions
  • I read through the code
  • Includes documentation (N/A)

@0x29a 0x29a merged commit 23d37ac into opencraft-release/palm.1 Feb 16, 2024
41 checks passed
@0x29a 0x29a deleted the 0x29a/bb8580/teaching-assistant branch February 16, 2024 12:43
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.

2 participants