Skip to content

Access for unenrolled learners. - #19284

Merged
ormsbee merged 1 commit into
openedx:masterfrom
open-craft:symbolist/access-for-unenrolled-learners
Dec 10, 2018
Merged

Access for unenrolled learners.#19284
ormsbee merged 1 commit into
openedx:masterfrom
open-craft:symbolist/access-for-unenrolled-learners

Conversation

@symbolist

@symbolist symbolist commented Nov 19, 2018

Copy link
Copy Markdown
Contributor

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:

  1. private (default): This keeps the standard access rules.
  2. public_outline: Allows unenrolled and anonymous users access to the outline.
  3. public: Allows unenrolled and anonymous users access to both outline and
    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/

@openedx-webhooks

Copy link
Copy Markdown

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:

  • supporting documentation
  • edx-code email threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

@openedx-webhooks openedx-webhooks added needs triage open-source-contribution PR author is not from Axim or 2U labels Nov 19, 2018
@natabene

Copy link
Copy Markdown
Contributor

@symbolist Thank you for your contribution. Please let me know once this can be looked at.

@openedx-webhooks openedx-webhooks added waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. and removed needs triage labels Nov 19, 2018
@symbolist symbolist changed the title [WIP] Access for unenrolled learners. Access for unenrolled learners. Nov 20, 2018
@symbolist

Copy link
Copy Markdown
Contributor Author

@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).

@symbolist

Copy link
Copy Markdown
Contributor Author

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.

@pomegranited pomegranited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@symbolist 👍

  • I tested this using the PR sandbox, see details below.
  • I read through the code
  • I checked for accessibility issues No 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:

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_access course waffle flag, and the "Advanced Settings > Course Visibility For Unenrolled Learners" set to public.
  • Public Outline Course: has the seo.enable_anonymous_courseware_access course waffle flag, and the "Advanced Settings > Course Visibility For Unenrolled Learners" set to public_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.

@natabene

Copy link
Copy Markdown
Contributor

@symbolist Got it, please ping him or me once it is ready for engineering review by edX.

@symbolist
symbolist force-pushed the symbolist/access-for-unenrolled-learners branch from 00f4bcd to 1ddb751 Compare November 21, 2018 18:56
@symbolist

Copy link
Copy Markdown
Contributor Author

(Rebased to resolve conflicts)

@symbolist
symbolist force-pushed the symbolist/access-for-unenrolled-learners branch from 1ddb751 to 5f9fe4a Compare November 21, 2018 20:58
@symbolist

Copy link
Copy Markdown
Contributor Author

jenkins test bokchoy

@symbolist

Copy link
Copy Markdown
Contributor Author

jenkins run bokchoy

@symbolist

Copy link
Copy Markdown
Contributor Author

@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 request.user. Is the anonymous access to courseware enabled on any course on edx.org that this set of changes can be tested with (on stage)?

@natabene
natabene requested a review from ormsbee November 26, 2018 17:47
@openedx-webhooks openedx-webhooks added awaiting prioritization and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Nov 26, 2018
@symbolist
symbolist force-pushed the symbolist/access-for-unenrolled-learners branch from 5f9fe4a to 11d6fc5 Compare November 30, 2018 16:57
@symbolist

Copy link
Copy Markdown
Contributor Author

I have rebased this to fix a conflict.

@ormsbee In case you missed this, it is ready of your review.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ormsbee I had to put this in during the rebase to match recent changes to the student_view: edx@6fbd861#diff-14daf51ec8decc308953f7a4e7e0a03f

@symbolist

Copy link
Copy Markdown
Contributor Author

@ormsbee Thanks for the review! I'll resolve the conflicts.

pkulkark added a commit to open-craft/openedx-platform that referenced this pull request Feb 7, 2019
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.
ormsbee pushed a commit that referenced this pull request Feb 25, 2019
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.
pkulkark added a commit to open-craft/openedx-platform that referenced this pull request Mar 11, 2019
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)
pkulkark added a commit to open-craft/openedx-platform that referenced this pull request Mar 11, 2019
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)
@symbolist
symbolist deleted the symbolist/access-for-unenrolled-learners branch May 16, 2019 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged open-source-contribution PR author is not from Axim or 2U

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants