* feat!: Remove all trivial mentions of PREVIEW_LMS_BASE
There are a few more mentions but these are all the ones that don't need
major further followup.
BREAKING CHANGE: The learning MFE now supports preview functionality
natively and it is no longer necessary to use a different domain on the
LMS to render a preview of course content.
See https://github.com/openedx/frontend-app-learning/issues/1455 for
more details.
* feat: Drop the `in_preview_mode` function.
Since we're no longer using a separate domain, that check always
returned false. Remove it and update any places/tests where it is used.
* feat: Drop courseware_mfe_is_active function.
With the removal of the preview check this function is also a no-op now
so drop calls to it and update the places where it is called to not
change other behavior.
* feat!: Drop redirect to preview from the legacy courseware index.
The CoursewareIndex view is going to be removed eventually but for now
we're focusing on removing the PREVIEW_LMS_BASE setting. With this
change, if someone tries to load the legacy courseware URL from the
preview domain it will no longer redirect them to the MFE preview.
This is not a problem that will occur for users coming from existing
studio links because those links have already been updated to go
directly to the new urls.
The only way this path could execute is if someone goes directly to the
old Preview URL that they saved off platform somewhere. eg. If they
bookmarked it for some reason.
BREAKING CHANGE: Saved links (including bookmarks) to the legacy preview
URLs will no longer redirect to the MFE preview URLs.
* test: Drop the set_preview_mode test helper.
This test helper was setting the preview mode for tests by changing the
hostname that was set while tests were running. This was mostly not
being used to test preview but to run a bunch of legacy courseware tests
while defaulting to the new learning MFE for the courseware.
This commit updates various tests in the `courseware` app to not rely on
the fact that we're in preview to test legacy courseware behavior and
instead directly patches either the `_redirect_to_learning_mfe` function
or uses the `_get_legacy_courseware_url` or both to be able to have the
tests continue to test the legacy coursewary.
This will hopefully make the tests more accuarte even though hopefully
we'll just be removing many of them soon as a part of the legacy
courseware cleanup.
We're just doing the preview removal separately to reduce the number of
things that are changing at once.
* test: Drop the `_get_urls_function`
With the other recent cleanup, this function is no longer being
referenced by anything so we can just drop it.
* test: Test student access to unpublihsed content.
Ensure that students can't get access to unpublished content.
If we wish this event to be sent to Segment through the event-tracking lib, we must ensure that the context includes at least the `user_id` field in the context dict.
* fix: add error handling for potential issues calculating course progress
Realized there is potential in a few places for exceptions to be thrown. I'm adding some more error handling in the course progress task and function to handle potential issues.
This PR attempts to improve the ability to collect analytics about learner's progress
in their courses. Currently, the only place we regularly calculate course progress is
when a learner visits the "Progress" tab in the courseware.
Now, _optionally_, when a learner visits the home page of their course, we will enqueue
a Celery task that will calculate their progress and emit a tracking event.
This event is gated by use of the COURSE_HOME_SEND_COURSE_PROGRESS_ANALYTICS_FOR_STUDENT
waffle flag.
DEPR: https://github.com/openedx/edx-platform/issues/36429
This change removes the course_sock and related API data. The UI it
removes is on the Legacy Courseware pages which have also been replaced
and have their own [deprecation ticket](https://github.com/openedx/edx-platform/issues/35803)
Before this can be merged, we will need to update the
frontend-app-learning MFE to no longer consume the
`can_show_upgrade_sock` attribute.
BREAKING CHANGE: CourseHomeMetadata, ProgressTab, OutlineTab and
VerifiedMode APIs will no longer have a `can_show_upgrade_sock`
attribute.
The courseware URL is going away but it's just used here to test the
middleware. That can be test with other urls that are relevant to this
middleware.
Note, I was unable to re-produce the failures so I've put back using the
standard `reverse` logic for fetching the URL in the test.
We want to remove this page and URL endpoint so we're removing all the
references in the code that might point to this page. It was replaced
by the sequences page in the Learning MFE years ago but the old pages
were never cleaned up. We are replacing the calls with the URL for the
courseware in the learning MFE.
See https://github.com/openedx/edx-platform/issues/35803 for more
details.
* fix: make the issued date displayed on previewed certificates match real certificates
This PR fixes an inconsistency in the dates displayed on certificates previewed via Studio with "real" certificates rendered to users.
It is possible for self-paced courses to be configured with a display behavior of "END" even though this configuration option should be invalid. The fix to this problem is beyond the scope of this PR. However, we can ensure we are selecting the correct display date for the certificate with a little bit of defensive coding.
I've added a check to ensure that we only use the end date of the course when the course is instructor-paced and configured with a display behavior of "END".
Fixes: https://github.com/openedx/platform-roadmap/issues/423
This PR updates the logic for determining the issued date shown on course certificates. For courses with a display behavior set to 'end date of the course', certificates earned by learners will now show the course run’s end date as the issued date.
Moves the Program Dashboard APIs out of the deprecated remnants of the legacy learner dashboard, into the Programs djangoapp.
Keeps the old legacy routes for this API, left over from the deprecated remnants of the legacy learner dashboard, alongside future-proofed routes which will work when the deprecated, legacy Program Dashboard is eventually replaced with functionality in the Learner Dashboard MFE.
FIXES: APER-3949