Commit Graph

6622 Commits

Author SHA1 Message Date
Kshitij Sobti
4fc9eb8324 fix: Change approach to processing course topics (#31200)
Course topics are now created by traversing the entire course structure from top to bottom instead of starting at the sequential level and then moving up or down as needed.

This also introduces a lot of debug logs to pontetially find the reason why under some circumstances new units don't get processed and end up without a discussions topic.
2022-11-01 14:31:27 +05:00
Sagirov Eugeniy
8f88422c4a test: prepare tests for removing support for children in Old Mongo 2022-10-28 11:43:20 -04:00
Usama Sadiq
4734f9f16e fix: bump pylint version (#31084) 2022-10-27 12:19:09 +05:00
Varsha Menon
c4b2c49ab6 feat: show exam info in course outline 2022-10-26 14:28:27 +00:00
Sagirov Eugeniy
3f3d0d25d8 feat!: Remove inheritance-related code from Old Mongo 2022-10-24 11:58:44 -04:00
Kshitij Sobti
acbd424270 docs: Document the discussions app (#31045)
This change documents some of the workings of the discussions app for reference.
2022-10-19 17:15:07 +05:00
Moeez Zahid
4271e24eb9 feat: Waffle switch to disable JWT for mobile (#31096)
* feat: Waffle switch to disable JWT for mobile
2022-10-17 16:57:11 +05:00
Alejandro Cardenas
43158404bc perf: add lru_cache to improve performance with multiple themes
These changes should improve the performance caused by the file I/O
when it's running in docker, using lru_cache to save thousands of calls to listdir
when running with a handful of themes defined in COMPREHENSIVE_THEME_DIRS.
2022-10-06 14:32:14 -04:00
Justin Hynes
2a54414eaf Merge pull request #31063 from openedx/jhynes/APER-1941_fix-cad-mgmt-cmd
fix issue with cert available dates not being removed from credentials
2022-10-04 08:20:25 -04:00
Shahbaz Shabbir
a41552b905 Merge pull request #31060 from shahbaz-arbisoft/shahbaz/VAN-1091
fix: use timeout from settings
2022-10-04 15:57:14 +05:00
Ned Batchelder
a5f687bf70 build: add a success aggregation step to simplify required check configuration 2022-10-03 07:11:53 -07:00
Justin Hynes
8fd59044f9 fix: improve Celery task that sends certificate availability date data to Credentials IDA
[APER-1941]

We are aware of a product issue that causes a `certificate_available_date` (CAD) to be set for self-paced courses (and thus copied to the course-run's (course) certificate configuration) that causes an issue with learners' Program Records to be inaccurate. The stored CAD in Credentials is causing these certificates to be marked as "unearned" on the Program Record in Credentials, as the IDA believes the learner should *not* have access to them yet (but these certificates are available in the LMS).

A management command was recently introduced in Studio that can be used to clean/remove the `certificate_available_date` data from a course-run in Mongo. These updates aren't making it to the Credentials IDA because of an issue with our logic in the `update_certificate_visible_date_on_course_update` Celery task. This task assumes that we only want to send updates for *Instructor-Paced* courses that have a Certificate Display Behavior set to `end_with_date`. In reality, we need updates to pass to Credentials for _some_ self-paced courses with bad data.

This PR hopes to update our infrastructure to allow these updates to flow to Credentials.

* Improve logging for failed requests to the Credentials IDA's `course_certificates` endpoint when updating a course certificate configuration.
* Update docstrings and comments where appropriate
* Split the logic of the update_certificate_visible_date_on_course_update task into two tasks. The former task will continue to _just_ handle visible_date attribute updates. The latter (new) task will be dedicated to making the REST API call that updates the `certificate_available_date` data in Credentials.
* Update the `handle_course_cert_date_change` function wqhen the COURSE_CERT_DATE_CHANGE signal is received to queue both the "visible_date" and "certificate available date" Celery tasks.
* Update existing tests for the task changes.
2022-09-29 14:42:22 -04:00
Kshitij Sobti
346257dadf fix: discussion topic links not created in some cases (#31032)
This commit attempts to fix cases where dicussion topic links aren't created
during a provider change.

It does so by eliminating areas where there could be desynchronisation between
the configuration the course configuration in Mogo and the discussion config
in MySQL.

The topic creation code now uses the database version of the config which is
more recent.
2022-09-29 17:16:03 +05:00
Piotr Surowiec
fcb594d635 Merge pull request #30715 from open-craft/agrendalath/bd-13-deprecate_course_id
refactor: deprecate course_id from ModuleSystem [BD-13]
2022-09-26 14:23:11 +02:00
shahbaz-arbisoft
b685d09067 fix: use timeout from settings 2022-09-23 18:16:16 +05:00
Mubbshar Anwar
0d66bb6db9 fix: return error code (#31027)
return error code instead of error message and use this code for error message in authn mfe.

VAN-1082
2022-09-23 11:30:15 +05:00
Agrendalath
dd97c74fde refactor: deprecate course_id from ModuleSystem
This attribute is already deprecated for XBlocks in favour of directly
retrieving it like `block.scope_ids.usage_id.context_key`.

This commit also removes some redundant logging code which was omitted in the
Datadog removal in #19420.
2022-09-21 18:53:45 +02:00
Agrendalath
668683559b refactor: deprecate static_url argument from ModuleSystem
This argument was officially used only by the ProblemBlock.
If you need to get the base URL for static assets in your XBlock, please use
`settings.STATIC_URL` directly, instead of `runtime.STATIC_URL`.
2022-09-21 18:28:44 +02:00
Tim McCormack
4ecd9fe683 feat!: Delete all non-legacy IP code (#31000)
The IP chain code has moved to edx-django-utils—except for the legacy-IP code,
which is now in a new module. This will allow other IDAs to use the IP code.

Commit includes some adjustments to the toggle annotation.

Part of <https://github.com/openedx/edx-django-utils/issues/241>.
2022-09-21 14:11:34 +00:00
Ahtisham Shahid
dfd98e9655 fix: removed password from api response (#30988)
* fix: removed password from API response

* fix: in case an empty secret is provided use the previous record

* fix: resolver linter issues
2022-09-21 14:43:56 +05:00
Ahtisham Shahid
87ef27166f fix: resolved bug in big blue button (#31023) 2022-09-20 22:01:04 +05:00
Robert Raposa
3f147335ca docs: enhance mobile JWT ADR (#30906)
As part of the implementation of this ADR, we determined that we needed
to make some of the endpoints that return JWTs able to produce
asymmetric JWTs as needed, since asymmetric JWTs are a requirement
in certain cases. This ADR update notes this additional consequence.
2022-09-19 12:23:59 -04:00
Kshitij Sobti
a923cfc32e feat: Add mechanism to migrate discussion blocks to discussion flag (#30931)
The new mechanism for marking that a unit has discussions is to use the
discussion_enabled flag instead of adding a discussion block. This change
adds code that is run during the course rerun process to mark any existing
units that have a discussion block as discussible using the new mechanism.
It doesn't touch the existing discussion blocks.

If the new discussions configuration experience is globally enabled, this
will also switch from the legacy provider to the new provider. It analyses
the course for any discussion blocks that have been added to graded
subsections, and if that is the case, it also automatically enables
discussions in graded subsections (which are otherwise disabled for new
courses by default).
2022-09-19 16:56:50 +05:00
Sarina Canelake
40467d8604 Merge pull request #30951 from openedx/tcril/fix-gh-org-url
Fix github url strings (org edx -> openedx)
2022-09-16 09:58:15 -04:00
Sarina Canelake
cf5fa64bd7 fix: update repo paths that stayed in the edx org
Co-authored-by: Kyle McCormick <kdmc@pm.me>
2022-09-15 14:52:28 -04:00
Sarina Canelake
4a2f231302 fix: fix github url strings (org edx -> openedx) 2022-09-15 14:52:28 -04:00
Justin Hynes
ef6de11467 feat: Send modified data of a learner's grade to the Credentials IDA
[APER-1968]

We don't have a good way to understand if grade data in Credentials is out of sync with the LMS. Grades are sent to Credentials via a REST API call originating from an asynchronous Celery task on the LMS side. This PR updates our Celery task `send_grade_to_credentials` to include sending the `modified` DateTime value of a grade record to the Credentials IDA. Updates will be made on the Credentials side to accept and store this data as part of the UserGrade instance.

* Updates the `send_grade_to_credentials` task to include passing the grade's `modified` DateTime info as part of the request data to Credentials
* Updates the `CourseGradeBase` class to include an optional `last_updated` field. This will store the `modified` date of a PersistentCourseGrade instance when a grade is read through the CourseGradeFactory.
* Update existing log statement to use format strings where possible.
2022-09-15 08:02:26 -04:00
Attiya Ishaque
795fbbde8c chore: update tests according to is_register_page check (#30986) 2022-09-15 14:42:08 +05:00
Sagirov Evgeniy
42adcaaf4d FC-0001: Remove Persistent Course Grades Flags (#30978)
* feat: revert Fix certificate generation without persistent grades

* feat: Remove Persistent Course Grades Flags

* test: update tests
2022-09-14 14:00:01 -04:00
Sagirov Evgeniy
b429e55cac feat!: remove Studio editing for Old Mongo Courses
This removes user-facing Studio edit support for Old Mongo courses
(courses that have a CourseKey of the format {org}/{course}/{run}).
This does not affect our normal courses, which have CourseKeys
starting with "course-v1:".

After this commit:

* Old Mongo courses will continue to appear on the Studio course
  listing page, but are not clickable.
* Any attempt to directly access an Old Mongo course in Studio via URL
  fail with a 404 error.
* Course certificates will still be available for Old Mongo courses.
* Old Mongo courses will continue to be returned by CourseOverviews
  and get_course_summaries() calls.

We decided against removing Old Mongo courses from the listing entirely
because that would require very expensive CourseOverviews query to
filter them out. Making that query more efficient would involve a
database migration to add appropriate indexing, which is something else
that we are looking to avoid. CourseOverviews are used everywhere in
the system, so we want to avoid changing how they work so that we can
minimize risk.

This is part of the Old Mongo Modulestore deprecation effort:
  https://github.com/openedx/public-engineering/issues/62
2022-09-14 10:53:33 -04:00
Kshitij Sobti
6ebc9b3888 feat: Track additional discussion context for better deletion handling (#30140)
Tracks a discussion topics' section and subsection in a new context field so that we have access to that information when the topic's section/subsection/unit has been deleted. This is then used when a topic is deleted to append the section and subsection name to the topic title.

ADR: https://github.com/openedx/edx-platform/pull/29928
2022-09-13 16:01:25 +05:00
Ali Akbar
59ad4f4025 Merge pull request #30013 from openedx/aakbar/PROD-2521
feat: check for retired users from email
2022-09-13 14:41:47 +05:00
AliAkbar
d36fb2cd28 feat: check for retired user by email 2022-09-13 14:05:43 +05:00
Justin Hynes
9e83bf8f94 feat: Add configuration option to route View Records button to the Learner Record MFE
[APER-1922]

We are converting the legacy UI of the `records` app in the Credentials IDA (credentials.edx.org/records/, credentials.edx.org/records/programs/{uuid}, etc.) to a new MFE. Today, the Program Dashboard and the legacy (non-MFE) profile page have buttons that route learners to the Credentials IDA pages. We need to (optionally) introduce a way to route learner's to the new MFE instead.

- Introduces a new configuration setting called `LEARNER_RECORD_MICROFRONTEND_URL` (defaulting to None). This will be used by the LMS to store the base URL of the new MFE (e.g. records.stage.edx.org).
- Introduces a new waffle switch named `USE_LEARNER_RECORD_MFE`. This will be used to control whether routing learner's to the new MFE is enabled from the LMS's side.
- Updates the existing `get_credentials_records_url` function to add additional logic that will determine if we need to build a link to the legacy FE or the new MFE
- Adds tests for new and existing behavior. There were no existing unit tests for the utility function that I updated.
2022-09-07 13:44:05 -04:00
Kshitij Sobti
3cd3c60b59 feat: enable unit-level control over discussions by default (#30903)
This PR changes the default behaviour of the discussions experience by making the previous "unit-level
visibility" the default mechanism for configuring discussions.

Prior to this PR, under the new discussions configuration experience, all units would automatically get
assigned a discussion topic and have discussions enabled for them (other than units in graded or exam
subsections). However, if authors wanted they could enabled a custom visibility mode which would allow
toggling discussions on or off on a per-unit level.

This PR makes this custom visibility mode the standard behaviour (and eventually, only behaviour)
and enables discussion for all units by default. This replicates the behaviour that already existed,
however, now gives authors control over disabling discussions for individual units by default.

It also removes the ability to disable discussions for all units (while still keeping course-wide
discussions) enabled.
2022-09-07 16:41:17 +05:00
Ahtisham Shahid
4541750eec feat: added tracking event on learner search (#30945) 2022-09-07 14:50:00 +05:00
Ahtisham Shahid
80b654676e fix: update free tier validation rule (#30932) 2022-09-06 16:59:07 +05:00
Shafqat Farhan
34a4cbf715 feat: VAN-1075 - Added country field validation on registration endpoint 2022-09-06 15:19:14 +05:00
Zainab Amir
c962583304 fix: remove legacy error messages (#30937) 2022-09-06 14:26:27 +05:00
AsadAzam
21e9490c66 fix: hide new provider if flag disabled (#30925) 2022-08-31 18:29:53 +05:00
jawad khan
dc256139f3 feat: Exchange jwt token with session cookies (#29963)
Exchange jwt token with session cookies so that it can work on mobile.
Mobile platform is migrating to jwt and for accessing  xblocks we need session cookies in exchnage of jwt token.
For additional details, see
https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/oauth_dispatch/docs/decisions/0013-mobile-migration-to-jwt.rst

LEARNER-8518
2022-08-31 13:29:52 +05:00
Mubbshar Anwar
2980265764 Revert "feat: Pass segment properties (#30742)" (#30918)
This reverts commit b76d5c2a66.
2022-08-30 12:11:25 +05:00
Mubbshar Anwar
b76d5c2a66 feat: Pass segment properties (#30742)
- For enrollment email pass extra segment event properties.
VAN-999
2022-08-29 15:36:24 +05:00
Mubbshar Anwar
1b509f3a81 perf: Performance improvement (#30907)
Course recommendation API performance improvement.

VAN-1061
2022-08-29 14:44:37 +05:00
Attiya Ishaque
614054bf10 fix: [VAN-1038] city field value is saved for optional fields. (#30897) 2022-08-25 16:58:00 +05:00
Kshitij Sobti
c2326f0399 fix: change conditions for showing new and legacy discussion providers (#30818)
The current logic for showing discussion providers makes it hard to switch
from the legacy to the new provider. This commit changes the conditions in
which different providers are shown, and which provider is used as default.

Before this commit, the new provider would be hidden if the legacy provider
was in use and vice-versa. So both would only be shown if neither legacy
nor the new provider were in use (i.e. an LTI provider was in use).

Now, all providers are always displayed to global staff. If the waffle
flag for the new provider is set
(`discussions.enable_new_structure_discussions`), then new provider is
always displayed, and the legacy provider is hidden unless it's currently
in use.

If flag is not set, then the new provider is always hidden unless it is
used by a course.

Finally, the default provider now depends on the flag above. If it is
set globally, then the default provider is the new provider, otherwise
the legacy provider remains the default provider.
2022-08-25 04:00:18 -07:00
Syed Sajjad Hussain Shah
a868646e98 fix: number of usersuggestions sometimes less than 3 [VAN-1023] (#30875) 2022-08-24 12:21:32 +05:00
Raymond Zhou
aafac8f69b Revert "feat: TNL-10051 blockstore API perf instrumentation" (#30885) 2022-08-22 16:51:53 -04:00
Bernard Szabo
d58607ea2d feat: TNL-10051 reorder import statements
import logging must come near top
2022-08-22 13:19:53 -04:00
Bernard Szabo
e4d5de09da feat: TNL-10051 fix whitespace violation
Need two blank lines, not one
2022-08-22 12:55:50 -04:00