Commit Graph

140 Commits

Author SHA1 Message Date
Mohammad Ahtasham ul Hassan
4260bd2af5 fix: fixed django40 warnings (#29655)
* fix: fixed django40 warnings
* fix: fix quality failures

Co-authored-by: UsamaSadiq <usama.sadiq@arbisoft.com>
2022-03-02 16:08:04 +05:00
Simon Chen
a76f8d4f32 fix: do not deny proctoring access when masquerading as verified learner (#29937)
Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
2022-02-16 15:02:29 -05:00
Simon Chen
5cfec9732b fix: Provide a new data property on CoursewareMeta for proctoring exam access (#29929)
Co-authored-by: Simon Chen <schen@edX-C02FW0GUML85.local>
2022-02-16 11:02:15 -05:00
Bianca Severino
af81b3a609 chore: replace integrity signature flag with django setting 2022-02-15 09:57:00 -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
Bianca Severino
e848935000 fix: exclude masters from honor code check 2022-01-19 15:11:41 -05:00
Dillon Dumesnil
7b1fead04c feat: AA-1138: Adds ability to have Weekly Goal Celebration Modal in MFE
Adds celebrate_weekly_goal to the CourseEnrollmentCelebration and includes logic
for only returning True if the db field is true and the learner has hit their goal
this week. Adds ability to set to false via the API already used by the frontend.
Default db value is False, but all new enrollments after merge will be set to True.
2022-01-14 13:59:22 -05:00
Chris Deery
dddcadb706 feat: [AA-922] remove deprecated Goals backend (#29705)
* feat: [AA-922] remove deprecated Goals backend

While the new Weekly Learning Goals were being rolled out, the previous goal setting feature still existed behind a waffle flag.
The Weekly Learning Goals now become the one and only learning goal feature.

This change does not remove the old goals feature from the legacy backend, and therefore it does not remove any of the data that was used by the old goals feature.
The goals are now driven by the single pre-existing Waffle flag ENABLE_COURSE_GOALS

 - Removed COURSE_GOALS_NUMBER_OF_DAYS_GOALS waffle flag, replacing it where needed with the existing ENABLE_COURSE_GOALS

 - modified the API to remove the old goal_options, keeping the redundant weekly_learning_goal_enabled flag

 - updated tests

 - refactor tests to fit 50 line limit in lint
2022-01-11 09:02:03 -05:00
Jawayria
7f5b4a6a47 chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
2022-01-06 19:14:51 +05:00
Michael Terry
712380713b fix: give proper status code for invalid sequence metadata requests
If the sequence metadata view is asked to give metadata for a block
that is not a sequence (or section), give a proper http code back,
rather than throwing an attribute exception.

This avoids a monitoring error being flagged, and lets the frontend
catch this case specially (which the MFE does do, to notice that it
actually has a unit, not a sequence).
2022-01-04 14:30:48 -05:00
Michael Terry
e2e37154ce fix: add a couple guards for anonymous users
This fixes a couple places (LastSeenCoursewareTimezone and
UserCourseTag) where we were saving an entry for a user, but not
making sure we ignored anonymous users.
2021-12-09 10:26:51 -05:00
Jawayria
8ccb8b0608 chore: Applied lint-amnesty on openedx/core/djangoapps 2021-12-09 13:32:06 +05:00
Simon Chen
d1904bd99b fix: Ensure edX staff user can also see Honor Code modal dialog (#29479)
Co-authored-by: Simon Chen <schen@dhcp-10-31-112-124.dyn.mit.edu>
2021-12-01 10:13:27 -05:00
Bianca Severino
9f2dc8606b fix: add integrity signature flag to courseware api 2021-11-05 15:35:04 -04:00
Matthew Piatetsky
0c4f45a98b fix: don't introduce integrity errors when updating LastSeenCoursewareTimezone (#29162) 2021-10-29 10:39:11 -04:00
M. Zulqarnain
39b91154fb feat: New codemods on OpenedX 1 (#28776) 2021-10-27 13:07:36 +05:00
Braden MacDonald
6c85668099 feat: write split modulestore's course indexes to 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.

This commit starts writing course indexes (active_versions) to both MySQL and Mongo, but continues to read from MongoDB only.

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-26 10:06:52 -07:00
Michael Terry
6e2277f522 Merge pull request #28868 from edx/mikix/double-coupon
fix: drop segment call for streak discount
2021-10-21 12:51:22 -04:00
Kyle McCormick
9bf266f717 fix: add missing __init__.py files 2021-10-21 09:54:22 -04:00
Michael Terry
8253d41ccf fix: drop segment call for streak discount
It's being moved to the frontend, to better control when it's
emitted (we want to only emit it if the voucher has not yet been
claimed, which the frontend will ask ecommerce about).

AA-1012
2021-10-08 13:51:34 -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
Kshitij Sobti
3e05e0f49b feat: add support for enabling/disabling the wiki app (#28889)
Currently the wiki app can't be enabled or configured. This change allows enabling/disabling the wiki app which effectively hides/shows the wiki tab.
2021-10-07 11:04:03 +05:00
Matthew Piatetsky
449d5c7a2d feat: only email users about their goal in the morning in their timezone (#28922) 2021-10-06 15:02:03 -04:00
Matthew Piatetsky
d7cc866280 feat: surface goals in courseware api (#28952) 2021-10-06 12:28:06 -04:00
Matthew Piatetsky
ae618151a9 fix: Remove debugging flag that is no longer necessary and refactor 2021-09-29 15:05:14 -04:00
Bianca Severino
0484799f84 fix: remove special exam mfe flags 2021-09-22 09:07:33 -04:00
Matthew Piatetsky
3200851563 start addressing comments 2021-09-20 13:08:12 -04:00
Michael Terry
d5bacad86f Merge pull request #28698 from edx/mikix/hide-after-due-mfe
feat: notify MFE when a sequence is hidden-after-due
2021-09-10 09:12:57 -04:00
Michael Terry
cd7d13cd6d feat: notify MFE when a sequence is hidden-after-due
Currently, if a learner manually loads a sequence page that would
normally be skipped for them because it is hidden-after-due, the
sequence renders anyway.

This commit tells the frontend when it should not show a sequence
because it's hidden.

AA-1000
2021-09-09 14:43:00 -04:00
Chris Deery
4078443969 fix: [AA-950] Add unit test to verify segment called correctly (#28668)
* fix: [AA-950] Add unit test to verify segment called correctly

Add positive and negative test
Moved flag update to same block as segment
Moved WaffleFlag check to can_show_streak_discount_coupon for consistency
2021-09-07 12:53:13 -04:00
Chris Deery
2092933f72 fix: [AA-950] Fix gating feature from WaffleFlag (#28652)
* fix: [AA-950] Fix gating feature from WaffleFlag

Streak Discount was being offered for non-verified courses
2021-09-03 11:31:40 -04:00
Chris Deery
c4cedbae38 fix: [AA-950] Change coupon flag from WaffleFlag to CourseWaffleFlag (#28623)
Replacing the streak_celebration.discount_experiment_AA759 Waffle flag with
courseware.streak_discount_enabled CourseWaffleFlag

https://openedx.atlassian.net/browse/AA-950

Co-authored-by: cdeery <cdeery@edx.edu>
2021-09-02 08:32:56 -04:00
Chris Deery
8d682cb447 feat: [AA-950] Productize Streak Discount (#28582)
* feat: [AA-950] Productize Streak Discount

- Change STREAK_DISCOUNT_EXPERIMENT_FLAG to STREAK_DISCOUNT_FLAG
- Remove references to "experiment" and ticket AA-759
- Made flag names more consistent
- Move segment event from get_bucket  to streak calculation
- Streak discount event edx.bi.course.streak_discount_enabled is sent when celebrations are calculated
- Convert LegacyWaffleFlags to WaffleFlags

Co-authored-by: cdeery <cdeery@edx.edu>
2021-09-01 10:55:32 -04:00
Azan Bin Zahid
de0f42c93e Merge pull request #28289 from edx/azan/PROD-2400
Pact Provider Verification Setup
2021-08-24 17:19:59 +05:00
Azan Bin Zahid
1cce2e952d feat: add pact verification method 2021-08-24 14:59:46 +05:00
Michael Terry
2176dd7890 feat: allow unsubcribing from a course goal with just a token
* Add unsubscribe_token uuid field to CourseGoal model
* Add endpoint to unsubcribe from just a token (no login needed)
* Add admin page for the course_goals djangoapp
* Add get_course_overview_or_404 utility method
* Clean up URL handling in course_home_api

AA-907
2021-08-23 12:07:32 -04:00
Matt Tuchfarber
622d56026c Certificate Display Settings revamp (round 2) (#28286)
feat: reimagine certificate display settings

The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously
acting indedependantly of one another. They now work in
tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview model and CourseDetails objects to
validate these fields and choose sane defaults if they aren't
expected values

This work was previously done in bd9e7dd (complete with bugs), so this
version is toggleable via the ENABLE_V2_CERT_DISPLAY_SETTINGS setting
2021-08-02 11:30:15 -04:00
Michael Terry
beb84bb4cb chore: remove unused serialized field 2021-07-27 09:00:04 -04:00
Michael Terry
789edbe555 Merge pull request #28256 from edx/mikix/course-home-access
feat: send course access error along to course home MFE
2021-07-26 13:34:54 -04:00
Michael Terry
29159891c3 feat: send course access error along to course home MFE
We previously only sent it to the courseware MFE. Also unify the
naming of this access error to 'course_access' in courseware and
course home APIs.
2021-07-23 14:01:58 -04:00
David Ormsbee
46f42a1512 perf: reduce calls to get_course_by_id
CoursewareMeta alredy initializes self.course, so there's no need to
separately call get_course_by_id for various attributes. This was
resulting in separate modulestore fetches that would pull down the
structure document and re-do all the expensive top-level course queries
in modulestore.
2021-07-19 11:30:41 -04:00
Matt Tuchfarber
63cb6a97ff Revert "feat: Reimagine certificate_availability_date and certificates_display_behavior" 2021-07-07 16:53:05 -04:00
Matt Tuchfarber
2a7106acfb feat: reimagine certificate display settings
The course settings `certificate_available_date` (CAD) and
`certificates_display_behavior` (CDB) were previously acting indedependantly
of one another. They now work in tandem. This change:
- limits CDB to a dropdown
- removes "early_with_info" and adds "end_with_date"
- only takes CAD into account if "end_with_date" is selected
- Moves CDB to the main course schedule settings page
- updates CourseOverview to validate these fields and choose sane
defaults if they aren't expected values

Certificates will now show under the following circumstances:
"Immediately upon passing"
certificate_availability_date = null
certificates_display_behavior = "early_no_info"

"End date of course"
certificate_availability_date = null
certificates_display_behavior = "end"

"A date after the course end date"
certificate_availability_date = <date>
certificates_display_behavior = "end_with_date"
2021-07-06 16:45:23 -04:00
Kyle McCormick
d86aa824c1 revert: feat: add & expose courseware.use_learning_sequences_api flag (#28054)
The learning_sequences.use_for_outlines flag was recently added,
intended to serve the same purpose
as courseware.use_learning_seuqences_api. We do not need
both flags.

Furthermore, exposing either flag in the Courseware
Metadata API is neither necessary nor helpful, since
the easiest and quickest way for the Learning MFE to see
if the Learning Sequences API is enabled is to hit it,
and fall back to a different API if a 403 is returned.

This reverts commit 78f1e2b3bd.

TNL-8330
2021-07-06 11:34:40 -04:00
Michael Terry
c62626227a fix: jump_to should redirect to first unit on invalid key
Previously, it would 404. While accurate, it's not a great user
experience. Users can be offered invalid jump_to paths in the normal
course of things, if course content disappears or they lose access
to it.

In both cases, they might be offered a resume URL in the courseware
that would be to a now-invalid location.

With this change, that invalid link will at least give them
*something* (the first unit in the course) rather than an error
page.

This also (unrelatedly) fixes an exception when the learning MFE
outline page tries to render a course that contains sequences
with no children.

AA-867
2021-06-28 15:43:12 -04:00
Kyle McCormick
78f1e2b3bd feat: add & expose courseware.use_learning_sequences_api flag (#27993)
Add a Waffle Flag. When enabled, the courseware pages of the
Learning MFE should use the Learning Sequences HTTP API instead
of the Course Blocks HTTP API in order to load course structure
data. We expect that this switchover will lead to performance
improvements and a more comprehensible system.

(We are putting the switchover behind a temporary flag in order to
enable debugging, incremental rollout, and comparison testing.)

The flag is exposed to the MFE via the Course API.
As of this commit, the new flag is not enabled in any environment,
and the MFE does not have any code to act on the flag's value.
So, this commit on its own should have no production impact.

TNL-8330
2021-06-25 11:19:28 -04:00
Christie Rice
09d58a4eb8 test: Update course certificate tests before enabling v2 of course certificates globally (#27954)
MICROBA-1082
2021-06-15 10:27:44 -04:00
Ihor Romaniuk
06c542dfa0 [BD-26] feat: add temporary waffle flag for enabling disabling proctored exams (#27810)
* feat: [BD-26] add the is_proctored value to SequenceMetadata API

* feat: add temporary flag for enabling/disabling proctored exams

* fix: change creation date

* fix: fix text indents

* fix: [BD-26] Remove redundant duplicated test.

Co-authored-by: Sagirov Eugeniy <sagirov19@gmail.com>
Co-authored-by: Igor Degtiarov <igor.degtiarov@raccoongang.com>
2021-06-11 10:04:11 -04:00
Julia Eskew
14ec30e018 feat: Make the new courseware MFE the default courseware experience.
- Remove the REDIRECT_TO_COURSEWARE_MICROFRONTEND waffle flag.
- Add a new COURSEWARE_USE_LEGACY_FRONTEND waffle flag that directs
all learners to the legacy courseware experience.
- Skip two failing a11y tests which fail due to the new default of
the courseware MFE.

TNL-8279
2021-06-10 12:21:24 -04:00