* 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
* 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>
* 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
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
Previously, effort estimation was disabled by default and gated by
an experiment flag (effort_estimation.location).
Now, it is enabled by default and courses can opt-out by adding
course waffle override flags (effort_estimation.disabled).
* feat: Refactor out non REST portions of enrollment api from enrollment POST method
For use with edx-enterprise to avoid making REST calls for bulk enrollment and other use cases
ENT-4746
* feat: Remove unused test
Testing is covered by test_views
* refactor: isort
isort fixes
* docs: ADR for why this change
ADR
ENT-4746
* test: Fix test failure by restoring course_id to correct object
* test: Test fix
* refactor: pylint fixes
* refactor: raise from to avoid pylint error
* refactor: Start to work toward a util in enterprise_support instead of refactoring this endpoint
* feat: Add util function in enterprise_support to eventually handle enrollment, only used by bulk enrollment for now
* feat: One more revised idea, this time low risk in edx platform and also helps address enterprise specific flow. testing pending
* feat: syntax and unused constant
* feat: Restore view and add new util function to use in edx-enterprise instead
* feat: breakpoint
* unused import
* feat: don't fail on existing enrollment
* docs: ADR update
* docs: docstring minor update
* test: unit test add_user_to_course_cohort
* refactor: imports
* feat: remove unused error classes
* refactor: lint
* test: Test cases
* test: Two more tests for negative cases
* feat: missing init.py file
* test: Fix tests to use correct user mock
* unused import
* refactor: Review feedback, test fixes, needs rebase now
* feat: rebase changes
* feat: keep audit_log with similar logic as in the view
* refactor: Review feedback, test constant usage
We ignore the missed_deadlines because this endpoint is used in the Learning MFE for
learners who have remaining attempts on a problem and reset their due dates in order to
submit additional attempts. This can apply for 'completed' (submitted) content that would
not be marked as past_due
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"
[MICROBA-1307]
Before this change a user would not be auto refunded if they had a
certificate in a course with any status. This had unintended
consequences. This change updates the logic to only block auto refund
for statuses that we do not want to refund on such as downloadable.
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.
Code in ./common/lib/xmodule/xmodule should
be imported as `from xmodule`, since `xmodule`
is a locally-installed package.
This is weird, but as long as it is the case,
we should be consistent.
(In BOM-2584, I propose moving the files to
./xmodule, which would quell this confusion.)
Even if a learner could technically continue to attempt a problem,
if they didn't have any missed deadlines in the course, we would
never display the ability to shift dates. This corrects that to
not require a missed deadline. The banner on the unit is still gated
by needing a missed deadline.