Commit Graph

31 Commits

Author SHA1 Message Date
Robert Raposa
8ef8b35a54 docs: update toggle docs
A variety of updates were made to improve the toggle documentation:
* Added comments to help ensure that the waffle(), waffle_switches(),
  waffle_flags() anti-pattern won't be contagious (copied).
* Some minor toggle_description updates.
* Removed empty toggle_target_removal_date annotations for
  non-temporary toggles.
* Removed empty optional toggle_warnings annotations.
* Removed empty optional toggle_tickets annotations.
* Removed deprecated toggle_category, toggle_status,
  and toggle_expiration_date annotations.
* Fixed some indents, use cases, and implementations.

ARCHBOM-1721
2021-04-01 21:58:29 -04:00
Bianca Severino
73c5866678 fix: remove proctored exam resume waffle flag 2021-03-31 14:14:09 -04:00
Kyle McCormick
05dbd83290 fix: streak celebration feature should require progress milestones (#26922)
In commit 9b37e7d0, the logic of
`streak_celebration_is_active` was accidentally
changed such that it no longer checks the
Progress Milestones waffle flag.
This commit fixes that.

Note: This also adds in a transitive check to
`courseware_mfe_is_active`,
which makes sense for Streak Celebration
and should not have any functional impact.
2021-03-09 10:23:13 -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
Michael Terry
9570c1c72b feat: add 'external course updates' experiment flag
When this flag is enabled, users will be 50/50 bucketed into an
experiment where users get course highlights and nudges from an
external service (like sailthru or braze) rather than from
edx-platform via ACE.

AA-661
2021-03-02 14:51:45 -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
69ec9a2599 Check course home toggle in addition to courseware toggle 2021-03-01 09:40:02 -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
David Ormsbee
691472e475 [feat]: Don't use Mathjax if an HTMLBlock has no math. (#26478)
Mobile apps load HTML (and other) XBlocks individually using the
render_xblock endpoint. This is an attmept to reduce the number
of requests and JS processing needed to do so by detecting when
we have math content in HTMLBlocks and only adding the Mathjax
resources when necessary.

This is controlled by the "courseware.optimized_render_xblock"
CourseWaffleFlag. For maximum safety, we currently only optimize
in this way when directly hitting HTMLBlocks, and not for
ProblemBlock or VerticalBlock.

This was made as part of edX's Hackathon XXV.
2021-02-11 13:31:17 -05:00
Michael Roytman
71cc2e18e5 pass value of EXAM_RESUME_PROCTORING_IMPROVEMENTS feature toggle to edx-proctoring Javascript via the student-proctored-exam-container div 2021-01-25 09:59:44 -05:00
Kyle McCormick
643fbe82a0 Downgrade REDIRECT_TO_COURSEWARE_MICROFRONTEND to CourseWaffleFlag (#25815)
The toggle was previously an ExperimentWaffleFlag,
which allows stable A/B testing but increases the toggle's
complexity. Since we do not plan an doing any more A/B
tests as part of the MFE rollout, we can 'downgrade' this
toggle to a CourseWaffleFlag, which still allows us to do
phased rollout and course-run-specific overrides.
2020-12-09 13:48:47 -05:00
Régis Behmo
a16cd71046 Start waffle namespace deprecation
By explicitly importing the legacy namespace classes, we make it clear
that we are using soon-to-be-deprecated classes. We will then be able to
start removing the legacy classes, one module at a time.
2020-12-03 16:06:14 +01:00
Manjinder Singh
c74b623948 Fixing code-annotations (#25539)
* Fixing code-annotations
2020-11-06 12:52:08 -05:00
Régis Behmo
4586002956 Import waffle classes from edx_toggles instead of waffle_utils
Those classes were ported to edx_toggles. The imports remain in
waffle_utils.__init__ for backward compatibility.
2020-11-03 19:25:37 +01:00
Michael Roytman
b007c7236c add a CourseWaffleFlag to toggle various proctoring experience improvements 2020-10-07 15:04:00 -04:00
Carla Duarte
080f04c18c AA-371: Progress Milestone Waffle Flags 2020-10-07 09:36:07 -04:00
Dillon Dumesnil
a96079f2d1 AA-196: Course Celebration for passing Verified Learners 2020-10-01 16:53:25 -04:00
Régis Behmo
a4ba4ae45e Clarify many feature toggle annotations across all applications 2020-09-16 15:20:43 +02:00
Régis Behmo
7d93715880 Rename toggle_expiration_date to toggle_target_removal_date
This is part of the changes brought by code-annotations==0.7.0
2020-09-16 15:19:16 +02:00
Régis Behmo
98a13d6a7e Remove deprecated toggle_status annotation
This annotation is deprecated since code-annotations==0.7.0
2020-09-16 15:19:15 +02:00
Régis Behmo
ab0e21455a Get rid of the toggle_category annotation, now deprecated
Since code-annotations==0.7.0, this annotation is not used anymore.
2020-09-16 15:16:13 +02:00
Régis Behmo
7dc460d50a Wrap toggle annotation lines with multiline comments
This takes advantage of the new multiline annotation format with
single-line comment prefix, from code-annotations.
2020-09-16 15:16:12 +02:00
Régis Behmo
d34aa1c643 Document lms/djangoapps/courseware feature toggles 2020-09-16 15:15:46 +02:00
Régis Behmo
307457a255 Simplify hack to obtain waffle module names
Instead of going up the stacktrace to find the module names of waffle
flags and switches, we manually pass the module __name__ whenever the
flag is created. This is similar to `logging.getLogger(__name__)`
standard behaviour.

As the waffle classes are used outside of edx-platform, we make the new
module_name argument an optional keyword argument. This will change once
we pull waffle_utils outside of edx-platform.

Note that the module name is normally only required to view the list of
existing waffle flags and switches. The module name should not be
necessary to verify if a flag is enabled. Thus, maybe it would make
sense to create a `add` class methor similar to:

    class WaffleFlag:
        @classmethod
        def add(cls, namespace, flag, module):
            instance = cls(namespace, flag)
            cls._class_instances.add((instance, module))
2020-09-14 09:30:24 +02:00
Kyle McCormick
b05948153a Add course-unawareness option to ExperimentWaffleFlag
For the Courseware MFE rollout experiment, we want users'
default buckets to be consistent across course runs.

ExperimentWaffleFlag advised that this could be done
by calling `.is_enabled(...)` without a course_key argument;
however, doing so breaks when uing the main_flag.BUCKET_NUM
scheme to apply bucket rules for a specific set of users
or courses.

This commit explicitly adds course-unaware-bucketing via
a new kwarg to ExperimentWaffleFlag.__init__ method.

Furthermore, it fixes ExperimentWaffleFlag.is_enabled(course_key=None)
to work as advertised, by means of calling
.is_enabled_without_course_context on its subordinate flags.

TNL-7405
2020-08-10 11:57:02 -04:00
stvn
9e31d65afe Consolidate MFE redirect logic
Its ripe for confusion to have this logic split between two separate
methods. This consolidation should make things easier to understand and
hopefully, less issue prone.

We don't really benefit from having two methods here anyway, as one is
_only_ ever called by the other.

It's also misleading that the second helper, in `toggles.py`, _also_
checks the FEATURE flag, as well as the waffle flag.
2020-07-16 15:21:32 -07:00
Adam Butterworth
1f59463720 Swap courseware-mfe CourseWaffleFlag with ExperimentWaffleFlag (#23429)
TNL-7000
2020-03-23 13:46:42 -04:00
David Ormsbee
ed9062f409 Create flag for Courseware MFE staff rollout.
Create the COURSEWARE_MICROFRONTEND_COURSE_TEAM_PREVIEW
CourseWaffleFlag (courseware.microfrontend_course_team_preview) to
enable us to roll out the new Courseware MFE as a preview to
select course teams without affecting their students. TNL-7117

This commit also fixes an issue where these links are shown in Old
Mongo courses (TNL-7116). Old Mongo is marked for deprecation
(DEPR-58), and is not intended to ever be supported by the new MFE.
2020-03-09 10:01:41 -04:00
David Ormsbee
979906275c Show Courseware MFE link to course staff.
Show a link the courseware MFE to course staff if the
ENABLE_COURSEWARE_MICROFRONTEND feature is enabled and the
REDIRECT_TO_COURSEWARE_MICROFRONTEND CourseWaffleFlag is active
for that course. Previously only global staff could see this link.

This commit also adds ENABLE_COURSEWARE_MICROFRONTEND to
lms/envs/common.py and makes this value True by default on
devstack, since that front end application should soon be part
of devstack: https://github.com/edx/devstack/pull/484

Related to TNL-6982 and TNL-7045.
2020-03-06 11:00:22 -05:00
David Joy
fe1942561a Redirect to the courseware MFE when the ‘courseware’ view is loaded 2020-02-21 11:44:38 -05:00
David Joy
d96ff272e2 feat: waffle flag for redirecting to courseware MFE
1. This is a partial check-in.  It causes jump_to links in the header user menu to work, but doesn’t address any other dashboard links.
2. I also need to figure out the best way to test this, having not tested a toggle like this before.
2020-02-21 11:44:38 -05:00