Access for unenrolled learners. - #19284
Conversation
|
Thanks for the pull request, @symbolist! I've created OSPR-2814 to keep track of it in JIRA. JIRA is a place for product owners to prioritize feature reviews by the engineering development teams. Feel free to add as much of the following information to the ticket:
All technical communication about the code itself will still be done via the GitHub pull request interface. As a reminder, our process documentation is here. |
|
@symbolist Thank you for your contribution. Please let me know once this can be looked at. |
|
@ormsbee @pomegranited See the second commit for the fix. While working on this I realized that the current behavior is that while adding a team member to a course does enroll them in, it is still possible for unenrolled team members to access the courseware. From the RCA conversation, my understanding was that the later was only allowed for global staff (where User.is_staff = True). So just to make sure we are covering all cases, I have refactored the course home and courseware index access check tests and added all the possible combinations I could think of. Are there any which are missing or do not meet expectations? I have added a global staff (email: edx@example.com) and an unenrolled staff for the demo course (email: unenrolled_staff@example.com). |
|
Hi @natabene, thanks for checking in! @ormsbee reviewed https://github.com/edx/edx-platform/pull/18720 which was later reverted so my understanding is that he will be reviewing this one as well. |
There was a problem hiding this comment.
- I tested this using the PR sandbox, see details below.
- I read through the code
-
I checked for accessibility issuesNo GUI changes made - Includes documentation -- docstrings only. A PR for edx/documentation will need to be created to describe this feature for users.
Sandbox server:
- LMS: https://pr19284.sandbox.opencraft.hosting
- Studio: studio-pr19284.sandbox.opencraft.hosting
Testing setup:
The sandbox has the usual demo users on it: staff (global staff, enrolled), honor, audit, edx (global staff, not enrolled), unenrolled_staff (global staff, unenrolled).
Contains 3 courses:
- edX Demo Course: unmodified, and with no added course waffle flags.
- Public Course: has the
seo.enable_anonymous_courseware_accesscourse waffle flag, and the "Advanced Settings > Course Visibility For Unenrolled Learners" set topublic. - Public Outline Course: has the
seo.enable_anonymous_courseware_accesscourse waffle flag, and the "Advanced Settings > Course Visibility For Unenrolled Learners" set topublic_outline.
Anonymous user
Not logged in.
- edX Demo Course:
Course outline: not shown. Banner: "To see course content, sign in or register."
Course content: redirects to login page. - Public Course:
Course outline: shown, with active links. Banner: "To see course content, sign in or register."
Course content: Public view. Banner: "You are not signed in. To see additional course content, sign in or register, and enroll in this course." - Public Outline Course:
Course outline: shown, with no links. Banner: "To see course content, sign in or register."
Course content: redirects to course about page.
Unenrolled learner user
Logged in as the audit user, and unenrolled from the edX Demo Course.
- edX Demo Course:
Course outline: not shown. Banner: "You must be enrolled in the course to see course content. Enroll now."
Course content: redirects to login page. - Public Course:
Course outline: shown, with active links. Banner: "You must be enrolled in the course to see course content. Enroll now."
Course content: Public view. No banner. - Public Outline Course:
Course outline: shown, with no links. Banner: "You must be enrolled in the course to see course content. Enroll now."
Course content: redirects to course about page.
Enrolled learner user
Logged in as the honor user, and enrolled in all 3 courses.
- edX Demo Course:
Course outline: shown, with active links, no banner.
Course content: student view shown, no banner. - Public Course:
Course outline: shown, with active links, no banner.
Course content: student view shown, no banner. - Public Outline Course:
Course outline: shown, with active links, no banner.
Course content: student view shown, no banner.
Enrolled staff user
Logged in as the staff user, who is enrolled in all 3 courses.
- edX Demo Course:
Course outline: shown, with active links, no banner.
Course content: student view shown, no banner. - Public Course:
Course outline: shown, with active links, no banner.
Course content: student view shown, no banner. - Public Outline Course:
Course outline: shown, with active links, no banner.
Course content: student view shown, no banner.
Unenrolled global staff and superuser
Logged in as the unenrolled_staff user, who has a disabled enrollment in all 3 courses, the edx user, who is global staff but has no enrollments, and the superuser, who is a global staff + superuser, with no enrollments.
- edX Demo Course:
Course outline: shown, with links. Banner: "You must be enrolled in the course to see course content. Enroll now."
Course content: shown, no banner. - Public Course:
Course outline: shown, with links. Banner: "You must be enrolled in the course to see course content. Enroll now."
Course content: shown, no banner. - Public Outline Course:
Course outline: shown, with links. Banner: "You must be enrolled in the course to see course content. Enroll now."
Course content: shown, no banner.
|
@symbolist Got it, please ping him or me once it is ready for engineering review by edX. |
00f4bcd to
1ddb751
Compare
|
(Rebased to resolve conflicts) |
1ddb751 to
5f9fe4a
Compare
|
jenkins test bokchoy |
|
jenkins run bokchoy |
|
@ormsbee This is ready for an engineering review from edX. Just to be on the safe side I have also changed the enrollment check in the milestones transformer. I do have one question. There are a number of features in courseware which are behinds flags which may be disabled in the default config but are enabled on edx.org and those features may require a valid |
5f9fe4a to
11d6fc5
Compare
|
I have rebased this to fix a conflict. @ormsbee In case you missed this, it is ready of your review. |
There was a problem hiding this comment.
@ormsbee I had to put this in during the rebase to match recent changes to the student_view: edx@6fbd861#diff-14daf51ec8decc308953f7a4e7e0a03f
|
@ormsbee Thanks for the review! I'll resolve the conflicts. |
11d6fc5 to
0c07798
Compare
This PR is based on openedx#19284 and is part of the series of work related to the proposal openedx#18134. This PR avoids the assignment of anonymous/unenrolled users to any cohort when course is public. Anonymous or unenrolled users will only see content that does not have a content group assigned. The "View Course" link to the course outline is shown on the course about page for a course marked public/public outline. It also makes course handouts available for public courses (not for public_outline). This PR also hides the different warnings and messages asking the user to sign-in and enroll in the course, when the course is marked public. It modifies the default public_view text to include the component display_name when unenrolled access is not available.
This PR is based on #19284 and is part of the series of work related to the proposal #18134. This PR avoids the assignment of anonymous/unenrolled users to any cohort when course is public. Anonymous or unenrolled users will only see content that does not have a content group assigned. The "View Course" link to the course outline is shown on the course about page for a course marked public/public outline. It also makes course handouts available for public courses (not for public_outline). This PR also hides the different warnings and messages asking the user to sign-in and enroll in the course, when the course is marked public. It modifies the default public_view text to include the component display_name when unenrolled access is not available.
This is based on PR openedx#19284 and is part of the series of work related to the proposal openedx#18134. Adds VideoModule.public_view() to enable unenrolled and anonymous users to view the video contents of a public course. When an unenrolled or anonymous user accesses the video content of a public course, the public_view() introduced in the previous PR is used instead of student_view() method. (cherry picked from commit 6f0e5d6)
This PR is based on openedx#19284 and is part of the series of work related to the proposal openedx#18134. This PR avoids the assignment of anonymous/unenrolled users to any cohort when course is public. Anonymous or unenrolled users will only see content that does not have a content group assigned. The "View Course" link to the course outline is shown on the course about page for a course marked public/public outline. It also makes course handouts available for public courses (not for public_outline). This PR also hides the different warnings and messages asking the user to sign-in and enroll in the course, when the course is marked public. It modifies the default public_view text to include the component display_name when unenrolled access is not available. (cherry picked from commit 9ddb1cc)
https://github.com/edx/edx-platform/pull/18720 was reverted because of a bug. This PR adds back the changes with the bug fixed.
Description:
Adds CouseModule.course_visibility and XBlock.public_view() for unenrolled users access to courses.
The course_visiblity field can have one of three values:
course content.
When an unenrolled user accesses course content, instead of student_view(),
public_view() is used. A default implementation is provided for XBlocks
which do not implement this view. The public_view() must not have any
functionality which assumes the presence of a valid User and should show
a readonly only interface for the XBlock content.
Description goes here. e.g. This PR contains the LibraryContent XBlock, which allows to display library content in a course.
JIRA tickets:
https://openedx.atlassian.net/browse/EDUCATOR-3705
https://openedx.atlassian.net/browse/EDUCATOR-3706
Discussions:
Proposal: https://github.com/edx/edx-platform/pull/18134
PR that was reverted: https://github.com/edx/edx-platform/pull/18720.
Sandbox URL: https://pr19284.sandbox.opencraft.hosting/courses/course-v1:edX+DemoX+Demo_Course/course/