Commit Graph

285 Commits

Author SHA1 Message Date
Eugene Dyudyunov
adb156ac03 test: update tests query counts 2022-05-03 13:16:43 +03:00
Michael Terry
afd19f0513 feat!: drop legacy courseware tab access for learners
The only way to access the legacy courseware is now through the
Studio preview feature (and at some point, when the MFE supports a
preview mode, we can then remove even that).

This drops the courseware.use_legacy_frontend waffle.
2022-04-19 12:27:10 -04:00
Michael Terry
ce5f1bb343 feat!: drop legacy course home view and related code
This was the "outline tab" view of the course. Preceded by the
course info view, succeeded by the MFE outline tab.

In addition to the course home view itself, this drops related
features:
- Legacy version of Course Goals (MFE has a newer implementation)
- Course home in-course search (MFE has no search)

The old course info view and course about views survive for now.

This also drops a few now-unused feature toggles:
- course_experience.latest_update
- course_experience.show_upgrade_msg_on_course_home
- course_experience.upgrade_deadline_message
- course_home.course_home_use_legacy_frontend

With this change, just the progress and courseware tabs are still
supported in legacy form, if you opt-in with waffle flags. The
outline and dates tabs are offered only by the MFE.

AA-798

(This is identical to previous commit be5c1a6, just reintroduced
now that the e2e tests have been fixed)
2022-04-14 15:18:31 -04:00
Michael Terry
a515c2e992 Revert "Drop legacy outline tab in favor of the MFE's version" 2022-04-14 14:16:29 -04:00
Michael Terry
be5c1a64d5 feat!: drop legacy course home view and related code
This was the "outline tab" view of the course. Preceded by the
course info view, succeeded by the MFE outline tab.

In addition to the course home view itself, this drops related
features:
- Legacy version of Course Goals (MFE has a newer implementation)
- Course home in-course search (MFE has no search)

The old course info view and course about views survive for now.

This also drops a few now-unused feature toggles:
- course_experience.latest_update
- course_experience.show_upgrade_msg_on_course_home
- course_experience.upgrade_deadline_message
- course_home.course_home_use_legacy_frontend

With this change, just the progress and courseware tabs are still
supported in legacy form, if you opt-in with waffle flags. The
outline and dates tabs are offered only by the MFE.

AA-798
2022-04-14 09:12:01 -04:00
Michael Terry
fc8601de01 feat!: remove all access to Old Mongo courses
Change has_access to deny 'load' support for Old Mongo courses.

This is in service of dropping support for these ancient
courses and removing legacy code that they rely on.

DEPR-58
2022-04-04 10:37:09 -04:00
Michael Terry
1cbd3e46ce Revert "feat!: remove all access to Old Mongo courses" 2022-04-04 10:19:23 -04:00
Michael Terry
436fc52c52 Merge pull request #29848 from openedx/mikix/remove-old-mongo-access
feat!: remove all access to Old Mongo courses
2022-04-04 09:55:11 -04:00
Robert Raposa
8b775961a6 fix: rename table_blacklist to table_ignorelist 2022-03-09 16:43:47 -05:00
Braden MacDonald
dcb7ef8821 feat: Read course indexes from MySQL, not MongoDB (#29184)
Description
This is a follow up to #29058 and #29413. This is the next step in moving part of the modulestore data (the course indexes / "active versions" table) from MongoDB to MySQL.

There are four steps planned in moving course index data to MySQL:

Step 1: create the tables in MySQL, start writing to MySQL + MongoDB  done
Step 2: migrate all remaining courses to MySQL  done
Step 3: switch reads from MongoDB to MySQL (this PR)
Step 4 (much later, once we know this is working well): stop writing to MongoDB altogether.
Supporting information
OpenCraft Jira ticket: MNG-2557

Status
 Tested with a large Open edX instance is in progress.

Testing instructions
Try making changes in Studio and verify that they work fine.

Deadline
None
2022-03-09 10:21:09 -05:00
Michael Terry
3fad9d606d feat!: remove all access to Old Mongo courses
Change has_access to deny 'load' support for Old Mongo courses.

This is in service of dropping support for these ancient
courses and removing legacy code that they rely on.

DEPR-58
2022-03-08 09:04:39 -05:00
Michael Terry
b905de757b test: more Old Mongo removal from tests
Convert more tests from MONGO_AMNESTY to SPLIT modulestores.

This is in preparation for just wholesale denying access to Old
Mongo, so I either converted tests to split or just deleted some
test variants that were Old Mongo specific. (e.g. ddt lines)
2022-02-11 14:50:30 -05:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Michael Terry
656ec5def9 fix: avoid resetting a learner schedule to before a course starts
If a learner changes modes (like upgrades to a verified learner),
we will reset their schedule for them. But if they did this before
the course started, we would accidentally set their schedule to
the current time. So when the course did start, they would already
appear to be behind schedule.

That's silly. So now we always look at course start time when
resetting the learner's schedule.

AA-426
2022-01-28 14:58:36 -05:00
Michael Terry
bf2c2ce3c3 fix: when redirecting to the MFE, preserve query flags
This can potentially fix analytics based on query params like
utm_campaign and the like. And generally seems like the correct
thing to do.

AA-1128
2021-12-07 14:10:32 -05:00
Jawayria
328c181a38 chore: Applied lint-amnesty on openedx/features 2021-12-06 13:58:45 +05:00
SaadYousaf
e33b23517c test: fixing tests 2021-11-04 00:24:29 +05:00
M. Zulqarnain
7aadf55387 feat: New codemods on OpenedX 4 (#28779) 2021-11-01 18:05:02 +05:00
Dillon Dumesnil
78fbd28f41 chore: AA-1058: Update edx-when version
Updates query counts for the additional query to look up the Schedule
in edx-when
2021-10-22 09:36:04 -04:00
David Ormsbee
ae124bd554 Revert "feat: store split modulestore's course indexes in Django/MySQL"
This reverts commit 96e5ff8dce.
2021-10-07 15:07:42 -04:00
Braden MacDonald
96e5ff8dce feat: store split modulestore's course indexes in Django/MySQL
Split modulestore persists data in three MongoDB "collections": course_index (list of courses and the current version of each), structure (outline of the courses, and some XBlock fields), and definition (other XBlock fields). While "structure" and "definition" data can get very large, which is one of the reasons MongoDB was chosen for modulestore, the course index data is very small.

By moving course index data to MySQL / a django model, we get these advantages:
* Full history of changes to the course index data is now preserved
* Includes a django admin view to inspect the list of courses and libraries
* It's much easier to "reset" a corrupted course to a known working state, by using the simple-history revert tools from the django admin.
* The remaining MongoDB collections (structure and definition) are essentially just used as key-value stores of large JSON data structures. This paves the way for future changes that allow migrating courses one at a time from MongoDB to S3, and thus eliminating any use of MongoDB by split modulestore, simplifying the stack.
2021-10-07 10:59:47 -04:00
sarina
0c74d347f7 fix: abstract edX-specific strings 2021-09-19 14:01:20 -04:00
Matthew Piatetsky
8183a5ae64 address comments 2021-08-05 21:45:58 -04:00
Michael Terry
e81fcbf5d7 Merge pull request #27879 from open-craft/mtyaka/FAL-1938-support-learning-mfe-on-subpath
Support Learning MFE hosted on subpath.
2021-07-20 13:16:38 -04:00
Sofia Yoon
e645d11bba feat: AA-797 switch course home flag to opt out by replacing it with a course home use legacy frontend flag 2021-06-16 10:04:49 -04:00
Matjaz Gregoric
fdf600a527 fix: support Learning MFE hosted on subpath.
The Referrer header from the MFE hosted on a different origin does not
include the path, so make sure to ignore the path portion of the
learning MFE base URL when determining whether the request is coming
from the new MFE or the old courseware view.
2021-06-13 10:32:46 +02:00
Diane Kaplan
c3a22eb6e5 feat: remove course_home_welcome upsell link (REV-2131) (#27603) 2021-05-26 15:13:09 -04:00
Dillon Dumesnil
8aeb460133 feat: Update the course end date block display logic
For self-paced courses, we have decided to switch to showing the end
date as long as it is within 365 days rather than the expected
duration of the course.
2021-05-19 09:09:57 -04:00
Dillon Dumesnil
35d62ff365 Merge pull request #27602 from edx/ddumesnil/improve-course-goals-aa-768
feat: AA-768: Add history to Course Goals model and update events
2021-05-17 09:29:39 -07:00
Dillon Dumesnil
d46f6369ea feat: AA-768: Add history to Course Goals model and update events
Also removes the remove_course_goal method as it is no longer
used anywhere and removes the functionality of deleting course goals
if a user unenrolls. Adds in fields for eventing to make them more
useful.
2021-05-17 11:55:27 -04:00
Dillon Dumesnil
6f773d1eca feat: AA-802: Update the BlockCompletionTransformer
We discovered a subsection that contained a unit without any content
inside, but because of our logic requiring children, it would never be
marked complete (meaning the subsection, section, and course could thus
never be marked complete). This fixes that by removing the children
check from setting completion, but first gating that code path on the
xblock being an aggregator (to prevent leaves from marking as true
simply because there are no children).

Test fixes include adding a test for the empty aggregator case as
well as some changes to not have an entire course marked complete
because they are all empty aggregators.
2021-05-14 11:22:07 -04:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Usama Sadiq
372c4abfa6 refactor: pyupgrade second iteration (#27458) 2021-05-10 13:55:48 +05:00
stvn
f646971c74 refactor: Move OrgInstructorFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
31bc741410 refactor: Move OrgStaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
ffcfc05a61 refactor: Move BetaTesterFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
22fb1ec124 refactor: Move InstructorFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
2fa36fb0cf refactor: Move StaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
5dd8302d8b refactor: Move GlobalStaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
Dillon Dumesnil
c9197d3cfc refactor: AA-677: Switch relative dates to CourseWaffleFlag
We have been bucketing all users into the relative dates experiment
since May 18, 2020. We no longer need to keep this as an
ExperimentWaffleFlag and can convert to a CourseWaffleFlag (so it
continues to support exemptions).
2021-04-08 10:12:54 -04:00
Agrendalath
e571693455 Support EXCLUDED blocks in Block Completion Transformer
For now only the discussion blocks were supported. If we had a custom XBlock that specified `completion_mode = XBlockCompletionMode.EXCLUDED`, then it could never be marked as completed on the course outline page, despite being marked as such inside the learning sequence.
2021-03-22 16:21:43 +01:00
Usama Sadiq
aa618c460c refactor: remove unused-imports (#27083) 2021-03-19 22:42:14 +05:00
Kyle McCormick
9b37e7d0fe refactor: centralize checks for canonical courseware experience & URL (#26815)
Centralize the logic for choosing between
MFE and Legacy-frontend courseware within
three new functions:
* courseware_mfe_is_active
* courseware_mfe_is_visible
* courseware_legacy_is_visible

This allows us to create another new function:
* get_courseware_url
which can be called anywhere in LMS/Studio
to get the canonical URL to courseware
content (whether it be MFE or Legacy).

In future commits we we begin using
get_courseware_url throughout the platform.

TNL-7796
2021-03-08 15:24:16 -05:00
Usman Khalid
dd96a2aa72 Convert Course, Section and Sequence XModules to XBlocks. (#25965) 2021-03-02 10:29:33 -05:00
Michael Terry
74887aa216 feat: turn on schedule creation by default
This commit removes several waffle toggles that have been enabled
on edx.org for years. It's time to remove the rollout gating for
these features and enable them by default.

This doesn't directly change any behavior. But it does create new
database objects by default now and allows for enabling other
schedule based features more easily.

Specifically, the following toggles were affected.

schedules.create_schedules_for_course
- Waffle flag removed as always-enabled
- We now always create a schedule when an enrollment is created

schedules.send_updates_for_course
- Waffle flag removed as always-enabled
- Course update emails are sent as long as the ScheduleConfig
  allows it.
- This is not a change in default behavior, because ScheduleConfig
  is off by default.

dynamic_pacing.studio_course_update
- Waffle switch removed as always-enabled
- Course teams can now always edit course updates directly in Studio

ScheduleConfig.create_schedules
ScheduleConfig.hold_back_ratio
- Model fields for rolling out the schedules feature
- Schedules are now always created
- This commit only removes references to these fields, they still
  exist in the database. A future commit will remove them entirely

This commit also adds a new has_highlights field to CourseOverview.
This is used to cache whether a course has highlights, used to
decide which course update email behavior they get. Previously every
enrollment had to dig into the modulestore to determine that.
2021-02-23 12:34:02 -05:00
Aarif
93a4f96e30 replaced unittest assertions pytest assertions (#26575) 2021-02-22 16:19:37 +05:00
Awais Qureshi
07b182b3be BOM-2335
Apply pylint-amnesty.
2021-02-04 16:37:41 +05:00
Dillon Dumesnil
71b15df66c Merge pull request #26264 from edx/ddumesnil/reset-deadlines-event-aa-492
AA-492: Adds research tracking event for reset deadlines
2021-02-01 08:09:51 -08:00
Dillon Dumesnil
8c745cabbf AA-492: Adds research tracking event for reset deadlines
This PR also removes the exemption for staff from seeing the reset
deadlines banner (staff will now see the banner). Staff users would
still be unable to submit problems and wouldn't have a way of resetting
their deadlines while enrolled.
2021-02-01 10:48:11 -05:00
Carla Duarte
d97b058c5d AA-568: fix start course bug 2021-01-27 15:29:21 -05:00