Commit Graph

560 Commits

Author SHA1 Message Date
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
Andy Shultz
7e3ef93a63 feat: make IDV optional for cert generation
IDV is on its way to retirement, so it's not going to be necessary for cert
generation forever.

Introduces a function to combine the honor code flag with IDV to tell
cert generation if it should care about a missing verification.

Various tests expanded to cover the retired case. The additional calls
in test_task_helper.py are caused by one call to fetch course
overrides which finds none, and that forces one check of the
background flag per student, 71 + 1 + 5 = 77.

MST-854
2021-10-22 14:46:07 -04:00
Usama Sadiq
9ee8df0980 fix: Remove pylint constraint and fix warnings (#28646) 2021-10-20 23:00:13 +05: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
Usama Sadiq
023f4144ab fix: fix new pylint warnings (#28725) 2021-09-23 17:54:15 +05:00
Awais Qureshi
eb0a66c2bd chore: Django3 has removed python_2_unicode_compatible.
Execute the codemodes.
2021-07-30 22:13:13 +05:00
Awais Qureshi
bdb1e61b82 chore: Django3 has removed python_2_unicode_compatible.
Execute the codemodes.
2021-07-27 23:35:00 +05:00
Matt Tuchfarber
d16c9a804c refactor: Move cert code to cert app
The `may_certify` function is used to determine whether a learner should
be able to see that their certificate is ready. It is therefore entirely
in the certificates domain. This remove may_certifiy and
may_certify_for_course from the xmodule and course_overview
apps and into the certificates app. The xmodule may_certify was not called
outside of tests prior to this, and the other's were easily moved.

In order to avoid circular imports, this also moved
certificate_info_for_user out of the model code and into an API
2021-07-21 15:56:19 -04:00
Christie Rice
c7d06c6bfa fix: Retrieve grade and enrollment mode only once and pass their values to the generation task, so those values can be saved in the cert. Also protect against missing course grades.
MICROBA-1373
2021-07-16 13:43:07 -04:00
Jansen Kantor
70c5bc5541 chore(add additional ORA submission zip logging) (#28125) 2021-07-09 11:56:47 -04:00
Christie Rice
b8114ebc59 fix: Remove V2 certificate checks, since V2 has been enabled globally for all course runs (#28077)
MICROBA-1083 DEPR-155
2021-07-06 11:00:54 -04:00
Christie Rice
24367919bb fix: Update logic for certificate generation status, and create cert with all available info (#28004)
MICROBA-1306 CR-3792
2021-06-28 10:05:34 -04:00
Christie Rice
532b97b4e2 fix: Temporarily disable generating certificates with a non-downloadable status (#28000)
CR-3792 MICROBA-1306
2021-06-22 15:56:11 -04:00
Justin Lapierre
37aa2db9e3 Merge pull request #27269 from open-craft/gabor/custom-report-dir-and-task-kwargs
[SE-4304] Allow custom upload directory and filename for grade and calculated profile reports
2021-06-17 12:58:51 -04:00
Christie Rice
59dc0a4a39 feat!: Enable v2 of course certificates for all course runs (#27817)
This moves all course runs that use certificates over to V2 of course certificates, and disables the option for a course run to use V1 of course certificates.

MICROBA-1082
2021-06-15 15:08:40 -04:00
Gábor Boros
4d97589984 feat: add custom task kwargs
Add task kwarg handling for some instructor tasks and and let upload
reports to a custom directory
2021-06-08 17:23:27 +02:00
Albert (AJ) St. Aubin
c37e88fdbf refactor: Move CertificateStatuses to data.py file per OEP-49
[MICROBA-678]

To allow access to CertificateStatuses constants in other Django apps we are moving the
CertificateStatuses enum to data.py per OEP-49.
2021-06-08 08:56:21 -04:00
Justin Hynes
6a0f57a266 refactor: update references to deprecated whitelist model
[MICROBA-1012]
- update python files to reference the allowlist instead of whitelist

As part of the Certificates v2 work, and in an effort to make the codebase more inclusive, we are moving away from using the term "whitelist" in favor of "allowlist". This PR is part of our renaming efforts across the Certificates Django app, and other Django apps that make use of Certificates functionality.
2021-06-03 14:09:24 -04:00
Justin Hynes
3218ee4f1c Merge pull request #27723 from edx/jhynes/microba-1075_events
feat: add `edx.certificate.revoked` event
2021-05-27 09:11:09 -04:00
João Cabrita
23eb110c26 fix: Produce grade report when subsections have future start dates
When getting a subsection grade for a user, instead of failing
if the user can't access that subsection,
fallback to the collected structure.
2021-05-26 11:16:37 -07:00
Justin Hynes
48f4f9f475 feat: add edx.certificate.revoked event
[MICROBA-1075]
- Adds a new `edx.certificate.revoked` event to the LMS.
- Refactor of our certificate revocation functions in the GeneratedCertificate model.

This new event will be emit when a GeneratedCertificate with the status of `downloadable` is revoked (through the `invalidate(), mark_notpassing(), or mark_unverified() functions). Event will have a `source` field that will allow us how our certificates are being revoked from learners and can be broken down in the following way:
*Invalidate*
- allowlist_removal
- certificate_generation
- certificate_regeneration
- certificate_service
- certificate_invalidation_list
- bulk_certificate_regeneration

*mark_notpassing*
- certificate_generation
- notpassing_signal

*unverified*
- certificate_generation
2021-05-25 13:44:01 -04:00
Justin Hynes
563a762625 Merge pull request #27643 from edx/jhynes/microba-1238_cleanup-external
refactor: update function calls outside of certificates app for updated `generate_user_certificates` and `regenerate_user_certificates` functions
2021-05-17 12:34:45 -04:00
Justin Hynes
313a295c95 refactor: update function calls outside of certificates app for updated generate_user_certificates and regenerate_user_certificates functions
[MICROBA-1238]
* remove unused `course` argument from `generate_user_certificates` function in the certificates app
* remove unused `course` argument from `regenerate_user_certificates` functioni n the certificates app
* remove `course` argument if passed in edx-platform apps outside of the certificates app
2021-05-17 09:39:36 -04:00
0x29a
6aa70b764d feat: remove course_id argument and upgrade ora2 dependency 2021-05-17 15:21:03 +02:00
Christie Rice
1473973b2b refactor: Rename whitelist to allowlist (#27533)
MICROBA-1021
2021-05-12 09:51:26 -04:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
Christie Rice
82bf0411ca test: Use allowlist factory (#27490)
MICROBA-1021
2021-05-03 12:53:36 -04:00
Christie Rice
912f2fa431 feat!: Enable the allowlist for all courses (#27468)
MICROBA-1013
2021-05-03 11:15:04 -04:00
Christie Rice
b43c1ab27c test: Update allowlist tests, and remove verification of certificates app functionality (#27486)
MICROBA-1013
2021-05-03 09:26:22 -04:00
Usama Sadiq
228c54d222 refactor: pyupgrade second iteration 2021-05-03 14:55:47 +05:00
Julia Eskew
efa13ff1d2 fix: TNL-8233: Change exception raised at problem creation failure from generic exception to LoncapaProblemError. (#27361)
Raising this specific exception will cause the failure to be handled more gracefully by problem rescoring code.
2021-04-21 16:13:23 -04:00
Usama Sadiq
ab41a7daee refactor: Apply lint-amnesty on pylint violations 2021-04-20 21:43:59 +05:00
stvn
8869a30bcd refactor: Move UserFactory helper to common/ 2021-04-14 07:26:39 -07:00
stvn
7d33d0d1e9 Merge PR #27289 refactor/lms-to-core/get-course-by-id
* Commits:
  refactor: Import a single function, not the whole module
  refactor: Move get_course_by_id helper from LMS to core
2021-04-14 07:08:19 -07:00
Justin Hynes
19d1105d0f feat: skip bulk certificate invalidation during bulk regeneration in v2 certs
[MICROBA-1077]
* Skip bulk certificate invalidation during bulk regeneration. I couldn't come up with a reason to continue to invalidate certificates right before we attempted regeneration.
2021-04-14 07:33:21 -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
Justin Hynes
13d174fdda fix: update v2 certificate generation eligibility logic
[MICROBA-1109]
* Remove the requirement for the `auto_certificate_generation` waffle switch to be enabled in order for a learner to be eligible for a certificate. This switch should control _when_ a certificate is generated, not _if_ a certificate will be generated for a learner.
* Move the `auto_certificate_generation_enabled` check to happen before we try to generate v2 certificates in signals.py
* Update unit tests
* Update documentation
2021-04-06 08:50:54 -04:00
Christie Rice
1181fb343e feat!: Remove allow_certificate checks from course certificates (#27206)
DEPR-140 MICROBA-985
2021-04-05 14:00:07 -04:00
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
Christie Rice
8198606138 feat: Refactor code to check both regular and allowlist V2 certs (#27156)
MICROBA-1039
2021-03-30 10:23:23 -04:00
SaadYousaf
5876c783f7 correct filename for anonymized id report. 2021-03-24 14:46:44 +05:00
Saad Yousaf
b6b8c3b8d6 [TNL-7970] - Convert anonymized id report code to an instructor task. (#26778)
Co-authored-by: SaadYousaf <saadyousaf@A006-00314.local>
2021-03-11 11:48:35 +05:00
Jawayria
0c33d80ac0 Merge pull request #26580 from edx/jawayria/bom-2352-7
BOM-2352: Removed unused imports from lms/djangoapps/{instructor_anal…
2021-03-09 17:04:06 +05:00
Kyle McCormick
9aefd6f986 style: django-not-configured is not a sensible lint-amnesty value (#26862)
django-not-configured is an error raised by pylint (with
the pylint-django plugin) when it's not correctly configured.

We should not be applying lint amnesty for such a violation.
2021-03-05 08:11:58 -05:00
Christie Rice
fdc219a319 MICROBA-918 Unify course cert invalidation (#26691) 2021-02-25 10:30:18 -05:00
Christie Rice
57f9005e57 MICROBA-918 Add allowlist check (#26584) 2021-02-24 09:07:04 -05:00
Jawayria
7285ae5151 BOM-2352: Removed unused imports from lms/djangoapps/{instructor_analytics, instructor_task, learner_dashboard} 2021-02-23 17:21:42 +05:00
Samuel Walladge
f43f1635df Add new functionality to generate ora summary report 2021-02-23 11:52:50 +10:30
usamasadiq
96f0915b0f Fixed new pylint warnings.
use generator in any/all()
disable not-callable warnings
disable no-member warnings
Suppressed smaller pylint warnings
Pin edx-proctoring==3.5.0
2021-02-22 16:36:53 +05:00