Commit Graph

19868 Commits

Author SHA1 Message Date
Manjinder Singh
f7c5a109d4 Revert "feat: add explicit courserun_key parameter to /event endpoint" (#28410) 2021-08-05 18:05:20 -04:00
Braden MacDonald
da09bcadc5 refactor: run modulestore tests in common/lib/... using Django
Does 3 things:
(1) Use django for modulestore tests
(2) Use normal LMS settings for modulestore tests instead of openedx/tests/settings.py
(3) Simplify some TestCase subclasses by converting them to use ModuleStoreTestCase


Details and rationale:

(1) Currently parts of the modulestore test suite are designed to run "without django", although there is still a lot of django functionality imported at times, and many of the tests do in fact use django. But for the upcoming PR #27565 (moving split's course indexes from MongoDB to MySQL), we will need to always have Django enabled. So this commit paves the way for that change.

(2) The previous tests that did use Django used a special settings file, openedx/tests/settings.py which made some debugging confusing because those tests had quite different django settings than other tests. This change deletes that file and runs the tests using the LMS test settings.

(3) The test suite also contains many different ways of initializing and testing a modulestore, with significant differences in their configuration, and also a lot of repetition. I find this makes understanding, debugging and writing tests more difficult. So this commit also reduces the number of different "test case using modulestore" base classes:

* Simplifies MixedWithOptionsTestCase and MixedSplitTestCase by making them simple subclasses of ModuleStoreTestCase.
* Removes PureModulestoreTestCase.
2021-08-05 12:20:19 -07:00
kenclary
e14ceaab3f Merge pull request #28333 from edx/TNL-7752
feat: add explicit courserun_key parameter to /event endpoint
2021-08-05 13:59:42 -04:00
Braden MacDonald
9ce7d57556 refactor: remove unused methods from split modulestore 2021-08-05 10:27:41 -07:00
Braden MacDonald
188e9fb15e fix: use integer user IDs consistently for modulestore APIs/tests
Some actions in split modulestore record the user ID who requested the action. Currently, split modulestore doesn't care what data type you use for those user IDs. Most of the codebase uses integers, but some tests used username or email address strings.

My upcoming PR #27565 will move split modulestore's "course index" data from MongoDB into MySQL. In doing so, it requires that user IDs are always numeric. So this PR paves the way for that one by using numeric IDs consistently in all test cases. I believe the actual non-test code was already consistently using integer IDs.
2021-08-05 10:26:43 -07:00
Justin Hynes
3a87aad963 Merge pull request #28391 from edx/jhynes/microba-1354
refactor: update name of `cert_generation_enabled` function name to reflect actual purpose
2021-08-05 12:27:42 -04:00
edX cache uploader bot
cf53db8f29 Updating Bokchoy testing database cache (#28398) 2021-08-05 10:10:05 +05:00
Ken Clary
bbb14a2c6a feat: add explicit courserun_key parameter to /event endpoint
We add 'courserun_key' (aka "course_id" though that's technically a
misnomer) as an optional parameter to the /event endpoint url. If it
is not present, it will still be parsed out of the url, if the url is
of the right format.

Additionally, Logger.log() in js adds this parameter to its /event
call, pulling it from the $$course_id global.

This provides opportunity for MFEs to (separately) provide the key
without concern about url parsing.

TNL-7752
2021-08-04 22:47:43 -04:00
edX Transifex Bot
e25f4af13f geoip2: update maxmind geolite country database 2021-08-05 02:24:24 +05:00
Justin Hynes
7f5cf2fabd refactor: update certificates app Python API functions
[MICROBA-1354]

* Update Python API function named `cert_generated_enabled` to `has_self_generated_certificates_enabled` to more accurately reflect the purpose of the function
2021-08-04 08:43:12 -04:00
Michael Terry
5e2155b6ab Merge pull request #28388 from edx/mikix/library-import-fix
fix: allow importing courses into Studio with empty libraries
2021-08-03 16:49:15 -04:00
Michael Terry
8d1989cf93 fix: allow importing courses into Studio with empty libraries
If a content library xblock does not specify a library id, we
previously would error out when importing, due to some cleanup
code that wasn't accounting for this case.
2021-08-03 16:16:01 -04:00
Awais Qureshi
d6202880ae chore: Removed python_2_unicode_compatible decorator. (#28342)
* chore: Removed python_2_unicode_compatible decorator.
2021-08-03 15:42:14 +05:00
edx-pipeline-bot
48f0954771 Merge pull request #28371 from edx/private_to_public_b3bbda0
Mergeback PR from private to public.
2021-08-03 02:46:56 +05:00
Christie Rice
4996b40860 fix: Add check for existence of grade (#28348)
MICROBA-678
2021-08-02 13:07:52 -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
Christie Rice
5fa4fcea5e fix: Handle missing user profile when setting a name in a course certificate (#28319)
MICROBA-1410
2021-08-02 10:58:13 -04:00
Sarina Canelake
7df802967c Merge pull request #28105 from chiruzzimarco/fix/courseware-banner-translation
Translate prerequisite section banner text
2021-08-02 10:22:51 -04:00
edX cache uploader bot
414d020380 Updating Bokchoy testing database cache (#28328) 2021-08-02 09:15:10 -04:00
Ken Clary
67a33d47e1 feat: add explicit courserun_key parameter to /event endpoint
We add 'courserun_key' (aka "course_id" though that's technically a
misnomer) as an optional parameter to the /event endpoint url. If it
is not present, it will still be parsed out of the url, if the url is
of the right format.

Additionally, Logger.log() in js adds this parameter to its /event
call, pulling it from the $$course_id global.

This provides opportunity for MFEs to (separately) provide the key
without concern about url parsing.

TNL-7752
2021-07-30 16:46:38 -04:00
Christie Rice
8971c99da6 feat!: Add migration to drop the CertificateWhitelist table (#28307)
This model has been replaced by the CertificateAllowlist.

MICROBA-1304
2021-07-30 10:27:35 -04:00
Ken Clary
13b6ed901a feat: add explicit courserun_key parameter to /event endpoint
We add 'courserun_key' (aka "course_id" though that's technically a
misnomer) as an optional parameter to the /event endpoint url. If it
is not present, it will still be parsed out of the url, if the url is
of the right format.

Additionally, Logger.log() in js adds this parameter to its /event
call, pulling it from the $$course_id global.

This provides opportunity for MFEs to (separately) provide the key
without concern about url parsing.

TNL-7752
2021-07-30 10:25:56 -04:00
Christie Rice
5883d13092 feat!: Remove CertificateWhitelist model (#28308)
This model has been replaced by the CertificateAllowlist.

MICROBA-1304
2021-07-29 09:50:34 -04:00
edX Transifex Bot
c92177b5f8 geoip2: update maxmind geolite country database 2021-07-29 02:14:25 +05:00
edX cache uploader bot
0dc34f8862 Updating Bokchoy testing database cache (#28283) 2021-07-28 15:09:12 +05:00
=Awais Jibran
82939c3423 fix: discussion xss fix 2021-07-28 01:43:36 +05:00
sofiayoon
c927e2cebf Merge pull request #28175 from edx/syoon/AA-885
feat: AA-885 show offsets in studio self paced course outline for a subsection
2021-07-27 10:08:00 -04:00
Sofia Yoon
898684287a feat: AA-885 show offsets in studio self paced course outline for a subsection
feat: AA-883 basic prototype for custom pacing pls in studio

refactor: merge with basic prototype for self paced courses from AA-844

feat: add due date estimate message in self paced courses studio modal

refactor: merge with main that has up to date self paced custom pls editor and tests

fix: only display projected date if start date exists

fix: tests to check grading date in outline

fix: only one warning message show at a time

fix: do not show projected date when it is before the start date
2021-07-26 16:26:22 -04:00
Awais Qureshi
8a4c0b74e6 chore: Django3 has removed python_2_unicode_compatible.
Execute the codemodes.
2021-07-26 23:56:45 +05:00
Andy Shultz
2c3597291c chore: update edx-proctoring to 3.22.0
This completes the removal of unused fields in exam attempt,
so the migration test skip is no longer necessary.
2021-07-26 11:40:34 -04:00
edX cache uploader bot
665b32e477 Updating Bokchoy testing database cache (#28262) 2021-07-24 14:56:12 +05:00
taliaedX
3f59de2b80 Merge pull request #28261 from edx/trhodes/ent-1366
feat: Third Party Auth - Boolean Enable Field for Enterprise Providers
2021-07-23 15:00:15 -04:00
Talia
45772158bc feat: add boolean field to third_party_auth to be used to remove providers from enterprise selection 2021-07-23 14:17:33 -04:00
Usama Sadiq
1795008686 fix: Removed pylint constraint (#28222)
Disabled pylint warnings in pylint_tweaks
2021-07-23 18:35:57 +05:00
connorhaugh
9d25982fab fix: oblige non-studio-authoring submit settings (#28253)
Problem blocks offer a setting to make users wait a set time between submissions. If a course is not authored in studio, it might not set a value for this setting. Consequently, the problem block must handle the submission_wait_seconds field to be none, so it doesn't break the submitted responses.

These kinds of errors here will prevent learners from submitting any answer, and has for several learners. Adding in this one-line change will prevent future errors without having to change the authoring practices of those ambitious enough to write their courses with import.

This also catches the case that some internal process other than studio might be creating problems with "none" as the setting.

In response to TNL-8234

Testing: hand-testing by importing the following problem xml file within a course and attempting to answer as learner(answer is 10.4).
2021-07-22 12:57:36 -04:00
Matt Tuchfarber
325629dd25 Merge pull request #28237 from edx/tuchfarber/move_may_certify_2
Move cert display decisions to certificates app
2021-07-22 10:20:13 -04:00
Piotr Surowiec
a5d9dd4fb9 fix: hide unavailable sequence title in course breadcrumbs (#28028)
When a sequence title was unavailable for a user (e.g. before starting a timed
exam), the `None` value was displayed in course breadcrumbs. This hides it in
such cases and ensures that a trailing breadcrumb separator is not displayed.
2021-07-22 09:52:25 -04:00
edX Transifex Bot
fb6ce41478 geoip2: update maxmind geolite country database 2021-07-22 02:09:27 +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
connorhaugh
0d26738fce fix: Prevent Transcripts from Failing Export, Edit (#28242)
Instead of having json errors in transcript acquisition and conversion cause errors, have transcription conversion and acquisition simply return an error message in the transcription which can prompt a change from the user.

Although not uploading a transcript is handled, transcripts can often cause errors in edit, export, and other activities due to json errors. These errors block the entire use of these features, so to allow for reupload, etc, we add an error message instead of transcript and log the event.

In response to [TNL-8539](https://openedx.atlassian.net/secure/RapidBoard.jspa?rapidView=580&projectKey=TNL&modal=detail&selectedIssue=TNL-8539)

Testing: Unit tests coverage is included in the PR. Upload, import, and export of courses with transcriptions is also easily hand-testable. Just create a video in studio, add an irrelevant transcript. Then try to import, export, and edit the problem. Expected behavior is success.
2021-07-21 15:52:54 -04:00
David Ormsbee
1238e5d1b4 perf: add monitoring for get_course and safe_exec (#28241)
This is to help diagnose performance issues around the SequenceMetadata
API, as part of TNL-8330.
2021-07-21 11:19:10 -04:00
Albert (AJ) St. Aubin
e191d39f59 fix: Corrected issue with request cert showing when user was in mode
that did not generate certs
2021-07-21 11:18:01 -04:00
Andrew Shultz
b66b1e8719 Merge pull request #28236 from edx/ashultz0/proc-bump-3201
chore: edx-proctoring update to 3.20.1
2021-07-21 09:36:41 -04:00
Andy Shultz
e950f44e22 chore: temporarily skip migration test to allow column removal
proctoring version update disconnects the IP columns, next version
will drop them

MST-872
2021-07-20 16:49:43 -04:00
Bianca Severino
025eae4b98 chore: install edx-name-affirmation 2021-07-20 14:34:28 -04:00
edX cache uploader bot
33eee4ee3e Updating Bokchoy testing database cache (#28226) 2021-07-20 11:02:49 +05:00
Zia Fazal
6f6a9e9c0b Merge pull request #27762 from edly-io/ERTE-5
[ERTE-5] feat: Added enterprise uuid in event context for enterprise enrolment events
2021-07-19 10:43:43 +05:00
connorhaugh
a2a2a1f433 fix: Report Custom Python Errors to Instructors (#28199)
Partner Support commonly raises the issue of instructors' custom Python problems not generating any response report on the instructor dashboard. Such errors are due to the operating restrictions placed on codejail. Sometimes not all answers can be processed by the server, which kills off some to accommodate. Instead of spiking the whole report, this change logs not only the error in our system, but also allows the mostly complete response to reach the instructor.

This PR will decrease friction not only for Partner support and instructors, but T&L, who have periodically implemented workarounds to the problem.

The PR merely implements exception handling for generating reports which logged exceptions and added them to the report, continuing the work done in TNL-8218 which did the same for grading.
2021-07-16 13:39:46 -04:00
Dillon Dumesnil
33ccd05df0 Merge pull request #28195 from edx/ddumesnil/update-shift-dates-logic-aa-856
fix: AA-856: update shift dates logic to ignore missed_deadlines
2021-07-16 05:56:00 -07:00
Dillon Dumesnil
3863bdb93b fix: update shift dates logic to ignore missed_deadlines
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
2021-07-15 14:20:18 -06:00