Commit Graph

108 Commits

Author SHA1 Message Date
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
Bianca Severino
58d5b29f19 fix: convert integrity signature waffle flag to CourseWaffleFlag 2021-06-09 13:19:17 -04:00
Matthew Piatetsky
cea450a35b fix: pass in course key when checking the bucket for the streak discount experiment 2021-06-01 16:32:21 -04:00
Matthew Piatetsky
f89ae754e4 Revert "feat: add debugging logs to help figure out why experiment isn't activating in production" 2021-06-01 15:10:14 -04:00
Matthew Piatetsky
98eb516745 feat: add debugging logs to help figure out why experiment isn't activating in production 2021-06-01 09:10:40 -04:00
Bianca Severino
744d650ef2 feat: add integrity signature check to courseware api 2021-05-19 15:04:55 -04:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Usama Sadiq
13ef0c7762 refactor: pyupgrade second iteration (#27462) 2021-05-11 11:25:22 +05:00
Matthew Piatetsky
526982c548 Merge pull request #27505 from edx/AA-759
[AA-759] feat: Add flag for AA-759 streak celebration discount experiment
2021-05-10 14:43:40 -04:00
Matthew Piatetsky
9c5992521a feat: Add flag for AA-759 streak celebration discount experiment
AA-759
2021-05-10 13:11:07 -04:00
Vladas Tamoshaitis
ec98847c74 feat: Add Waffle flag to enable/disable special exams on MFE learning (#27545)
* feat: Use forked RG version of edx_proctoring in devstack

* Add waffle flag for special exams for mfe (#2371)

* feat: add waffle flag for special exams for mfe

* fix: waffle flag name, add coma to imports

Co-authored-by: Vladas Tamoshaitis <vladas.tamoshaitis@raccoongang.com>

* fix: revert requirements for master branch

* fix: revert dev requirements

* fix: trailing comma after imported item

* feat: add special exams waffle flag test

* fix: use ENABLE_SPECIAL_EXAMS global settings flag

* fix: toggle description

* fix: naming of waffle flag helpers to reflect relation with mfe

* fix(tests): assertion operators order

Co-authored-by: Sagirov Eugeniy <sagirov19@gmail.com>
Co-authored-by: Sagirov Evgeniy <34642612+UvgenGen@users.noreply.github.com>
Co-authored-by: Vladas Tamoshaitis <vladas.tamoshaitis@raccoongang.com>
2021-05-07 08:52:53 -04:00
Michael Terry
78c6be8bee Merge pull request #27422 from edx/mikix/handler-will-recheck-access
fix: the get_completion JS handler should not ignore FBE blocks
2021-05-04 15:54:36 -04:00
Julia Eskew
599d21b7bb feat: Deny course staff visibility of legacy courseware. (#27469)
Currently, course staff can always view their courses
in the Legacy courseware experience.

With this change, course staff will *not* be able
to view their courses if the New (MFE) courseware
experience has been enabled for them.

This does not affect global staff, and it does not
affect courses that are still running in the Legacy
experience.

Adds a new parameter returned by the course metadata API
used by the courseware MFE to determine if the button to
show legacy experience should be displayed or not.

TNL-8203
2021-05-04 13:55:34 -04:00
Michael Terry
b90039b23d fix: the get_completion JS handler should not ignore FBE blocks
Because xblock handlers normally get a block tree that already has
inaccessible blocks stripped, they don't see FBE gated blocks at
all. So the get_completion handler would return True for FBE units
incorrectly. Leading to a visual bug as an audit user went through
their units in the courseware.

In order to let the handler know about the full tree, I've added a
new attribute you can set on your xblock handlers:
my_handler.will_recheck_access = True

This will tell the top-level handler code get the full tree for you.

As part of this, I've also changed the sequence xblock handler's
into proper xblock handlers (not old-style xmodule handlers).
This changes their URLs slightly. I've kept the old URLs for now
as well, but they'll be removed after Maple.

AA-409
2021-04-27 15:17:53 -04:00
Dillon Dumesnil
82414f5b5e Merge pull request #27401 from edx/ddumesnil/enable-dates-tab-aa-741
feat: AA-741: Enables the dates tab for all enrolled learners
2021-04-26 10:56:08 -07:00
Dillon Dumesnil
0a08852600 feat: AA-741: Enables the dates tab for all enrolled learners
Removes the relative dates flag check as it is no longer
necessary to show the dates tab
2021-04-22 15:22:26 -04:00
stvn
43698fff0a refactor: Move get_course_by_id helper from LMS to core
This helper is used by the LMS, CMS, _and_ `openedx.core`,
so let's move it to `openedx.core` to reduce import complexity.

The following files no longer import from LMS:
- cms/djangoapps/contentstore/management/commands/edit_course_tabs.py
- lms/djangoapps/ccx/migrations/0006_set_display_name_as_override.py
- openedx/core/djangoapps/ccxcon/api.py
- openedx/core/djangoapps/verified_track_content/models.py
- openedx/features/course_experience/plugins.py

Note: The LTI XBlock has a dependency on this import path (!?);
a fix can be found here [1].

- [1] https://github.com/edx/xblock-lti-consumer/pull/154
2021-04-13 23:25:48 -07:00
Jawayria
df06d1312d refactor: Removed unused imports
Removed unused imports from openedx/core/djangoapps/{content_libraries, coursegraph,courseware_api, crawlers, credentials, credit}
2021-04-06 17:07:13 +05:00
Ben Holt
ec3c31eb05 feat: added another 'Date' expose-headers for outline api clients (#27221)
Exposed the Date header on the outline api so clients can accurately compute times relative to the dates returned by the API; this was previously done with the course API (#26979)

Browser time is notoriously unreliable for this, especially for a Learner-facing countdown call-to-action based on the access expiration date. (REV-2126)

Using the Date header for this allows the client to make use of information that is already sent, does not require additional calls nor modifying the API, and could be generalized to more or all our APIs without modifying them.
2021-04-02 10:37:19 -04:00
Usama Sadiq
369885002d refactor: ran pyupgrade on openedx apps (#26846)
Ran pyupgrade on openedx/core/djangoapps/{coursegraph, courseware_api, crawlers}
2021-03-16 15:15:35 +05:00
Ben Holt
e93f035876 feat: exposed 'Date' header so clients can compute accurate relative time (#26979) REV-2126
Exposed the Date header so clients can accurately compute times relative to the dates returned by the API; browser time is notoriously unreliable for this, especially for a Learner-facing countdown call-to-action based on the access expiration date. (REV-2126)

Using the Date header for this allows the client to make use of information that is already sent, does not require additional calls nor modifying the API, and could be generalized to more or all our APIs without modifying them.
2021-03-15 14:43:00 -04:00
Kyle McCormick
f50a2138e4 fix: masquerading as a role in MFE should not require enrollment (#26975)
The Learning MFE had a bug where instructors selecting
'View As: Audit' would find themselves redirected to the
'Enroll Now' page. This was because the Courseware API,
 which powers the MFE, checked courseware access *after*
setting up masquerading--so, instead of checking whether
the instructor had access to view the course, we checked
whether some arbitrary un-enrolled learner would have
access to the course (the answer is generally No).

We fix this by doing what the Legacy courseware index
does: calculate courseware access *before* setting up
masquerading.

TNL-7989
2021-03-12 12:13:45 -05:00
Carla Duarte
99f73312b8 Progress Tab 2021-03-11 15:43:58 -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
Matt Tuchfarber
6c97dfe1e5 Move cert date signals to avoid race conditions
COURSE_CERT_DATE_CHANGE was being called before saving the new data in
the course overview. The listeners were expecting to pull the data out
of the course overview, and thus were only right about half the time.
This moves the signal to trigger after the course publish signals are
handled.
2021-03-04 15:57:21 -05:00
jawad khan
948d6351b6 LEARNER-8251 - Added BearerAuthenticationAllowInactiveUser in courseware view (#26829)
Added BearerAuthenticationAllowInactiveUser in courseware view
2021-03-03 18:39:42 +05:00
Kyle McCormick
e792242b5f refactor!: remove redundant ENABLE_COURSEWARE_MICROFRONTEND toggle (#26792)
The Django setting
FEATURES['ENABLE_COURSEWARE_MICROFRONTEND']
has been an additional gate to activating
usage of the Learning MFE for an Open edX
instance.

The toggle is redundant with the
`courseware.courseware_mfe`
Waffle flag. By removing it, we simplify our config
and simplify our path towards making the Learning MFE
the default courseware experience.

TNL-7796
2021-03-02 11:36:43 -05:00
Matthew Piatetsky
3b45a72b8e Create backend for three day streak celebration
This feature uses the first_day_of_streak, last_day_of_streak and last_streak_celebration fields to determine whether the user should see a celebration.
AA-304
2021-02-22 10:50:33 -05:00
Zainab Amir
c260f72c2e VAN-311: Add multiple enterprise support for Authn MFE (#26526) 2021-02-18 17:24:44 +05:00
Carla Duarte
7f7edd93c7 Merge pull request #26440 from edx/ciduarte/AA-590
AA-590: pass translated tab titles to MFE
2021-02-09 08:57:10 -05:00
jawad khan
95580b79a7 LEARNER-8218 Added BearerAuthenticationAllowInactiveUsern in celebration api
Added BearerAuthenticationAllowInactiveUsern in celebration api
2021-02-09 12:52:12 +05:00
Carla Duarte
00a025f073 AA-590: pass translated tab titles to MFE 2021-02-08 17:00:33 -05:00
Matthew Piatetsky
b91f720b7e Merge pull request #26293 from edx/AA-613
[AA-613] Return content type gate for staff users when masquerading as the Learner in Audit or Learner in Limited Access Roles
2021-02-05 09:18:34 -05:00