372 Commits

Author SHA1 Message Date
Rodrigo Mendez
12a46e6463 feat: AuthZ for course authoring compatibility layer (#38013) 2026-03-06 09:35:17 -07:00
Braden MacDonald
3e522d5272 feat: bump opaque-keys to get case-sensitivity support + default max_length (#38044)
refactor: remove some 'max_length=255' to be more DRY

feat: example of making an OpaqueKeyField case_sensitive (modulestore_migrator)

test: update test now that we're using case-insensitive collation on SQLite
2026-02-25 09:05:15 -08:00
Asad Ali
ab6cf6e85e revert: feat: [FC-0092] Optimize Course Info Blocks API (#37122) (#37661)
This reverts commit 7cd4170ca7.
2025-11-20 12:05:14 -05:00
Serhiii Nanai
7cd4170ca7 feat: [FC-0092] Optimize Course Info Blocks API (#37122)
The Course Info Blocks API endpoint has been known to be rather slow
to return the response. Previous investigation showed that the major
time sink was the get_course_blocks function, which is called three
times in a single request. This commit aims to improve the response
times by reducing the number of times that this function is called.

Solution Summary

The first time the function get_course_blocks is called, the result
(transformed course blocks) is stored in the current WSGI request
object. Later in the same request, before the second get_course_blocks
call is triggered, the already transformed course blocks are taken
from the request object, and if they are available, get_course_blocks
is not called (if not, it is called as a fallback). Later in the
request, the function is called again as before (see Optimization
Strategy and Difficulties).

Optimization Strategy and Difficulties

The original idea was to fetch and transform the course blocks once
and reuse them in all three cases, which would reduce get_course_blocks
call count to 1. However, this did not turn out to be a viable solution
because of the arguments passed to get_course_blocks. Notably, the
allow_start_dates_in_future boolean flag affects the behavior of
StartDateTransformer, which is a filtering transformer modifying the
block structure returned.

The first two times allow_start_dates_in_future is False, the third
time it is True. Setting it to True in all three cases would mean that
some blocks would be incorrectly included in the response.

This left us with one option - optimize the first two calls. The
difference between the first two calls is the non-filtering
transformers, however the second call applies a subset of transformers
from the first call, so it was safe to apply the superset of
transformers in both cases. This allowed to reduce the number of
function calls to 2. However, the cached structure may be further
mutated by filters downstream, which means we need to cache a copy of
the course structure (not the structure itself). The copy method itself
is quite heavy (it calls deepcopy three times), making the benefits of
this solution much less tangible. In fact, another potential
optimization that was considered was to reuse the collected block
structure (pre-transformation), but since calling copy on a collected
structure proved to be more time-consuming than calling get_collected,
this change was discarded, considering that the goal is to improve
performance.

Revised Solution

To achieve a more tangible performance improvement, it was decided to
modify the previous strategy as follows:

* Pass a for_blocks_view parameter to the get_blocks function to make
  sure the new caching logic only affects the blocks view.
* Collect and cache course blocks with future dates included.
* Include start key in requested fields.
* Reuse the cached blocks in the third call, which is in
  get_course_assignments
* Before returning the response, filter out any blocks with a future
  start date, and also remove the start key if it was not in requested
  fields
2025-10-30 17:23:49 -04:00
Kyrylo Kireiev
7f885c79f7 fix: [FC-0092] fix 500 when return_type is list (#36969)
There was problem in filter_discussion_xblocks_from_response(). This
function was breaking the list response for the BlocksInCourseView by
returning a dict instead of list.
2025-09-09 14:35:09 -04:00
Paulo Viadanna
d132efa08d feat: add a POST endpoint for listing courses (#35586)
* feat: add a POST endpoint for listing courses
2025-08-21 23:26:18 +05:30
Agrendalath
bbc0cc2baa fix: show correct icons in the sidebar for units with custom XBlocks
Currently, the sidebar relies only on the XBlock's `category` class attribute
(called `type` in the transformers). This behavior is inconsistent with the
legacy subsection navigation, which relies on the `XModuleMixin.get_icon_class`
method. This commit adds the `icon_class` to the fields collected by the
transformers and uses it to determine whether the "problem" or "video" icon
should be displayed for a unit in the sidebar.
2025-08-21 00:29:01 +05:30
Emad Rad
40a4a718c0 chore: fixed typo 2025-03-06 10:46:43 -05:00
jawad khan
05890d25b6 feat: Add hide_after_due field in blocks api (#36284) 2025-02-28 12:36:04 +05:00
Feanil Patel
d58dea336c fixup! test: Update the course in the cache after it's got new content. 2024-11-05 10:44:17 -05:00
Feanil Patel
db266e25f7 test: Update query counts.
With the new block_structure model cache enabled by default, we're donig
queries to it as a part of other tests.
2024-11-05 10:44:16 -05:00
Feanil Patel
57cdbfa013 test: Remove test variants that test without a cache.
Since the cache is now always on, remove test cases that test the case
when it's disabled.
2024-11-05 10:44:16 -05:00
Kyrylo Kireiev
53174178f3 feat: [FC-0047] Extend mobile API with course progress and primary courses on dashboard view (#34848)
* feat: [AXM-24] Update structure for course enrollments API (#2515)
---------
Co-authored-by: Glib Glugovskiy <glib.glugovskiy@raccoongang.com>

* feat: [AXM-53] add assertions for primary course (#2522)
---------
Co-authored-by: monteri <36768631+monteri@users.noreply.github.com>

* feat: [AXM-297] Add progress to assignments in BlocksInfoInCourseView API (#2546)
---------
Co-authored-by: NiedielnitsevIvan <81557788+NiedielnitsevIvan@users.noreply.github.com>
Co-authored-by: Glib Glugovskiy <glib.glugovskiy@raccoongang.com>
Co-authored-by: monteri <36768631+monteri@users.noreply.github.com>
2024-07-10 20:07:41 +05:00
Feanil Patel
70f06867af Merge pull request #34424 from qasimgulzar/qasim/fix/34379
fix: Course blocks API with param return_type=list
2024-05-10 13:25:16 -04:00
qasim.gulzar
3f709bae3f fix: add parentheses to import 2024-05-02 11:53:49 +05:00
Maria Grimaldi
809ffc3743 feat: connect teams with content groups using dynamic partition generator (#33788)
Implements the connection from the teams feature to the content groups feature. This implementation uses the dynamic partition generator extension point to associate content groups with the users that belong to a Team.

This implementation was heavily inspired by the enrollment tracks dynamic partitions.
2024-04-25 13:02:49 -04:00
Feanil Patel
9bd4474f7d test: Reduce query counts now that we dropped django-splash. 2024-04-18 12:43:33 -04:00
qasim.gulzar
73a69582d0 fix: Course blocks API with param return_type=list error when the new discussion is enabled 2024-03-28 15:48:52 +05:00
Bryann Valderrama
4c0fba2063 feat: expose hide_from_toc field for course blocks in outline API (#33955)
These changes are part of the effort made to implement https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3853975595/Feature+Enhancement+Proposal+Hide+Sections+from+course+outline
2024-02-15 10:44:28 -04:00
Syed Sajjad Hussain Shah
cb2a34e51f feat: logout other sessions on email change (#33846)
* feat: logout other sessions on email change

* fix: updated the approach for session invalidation

* fix: update and add tests

* fix: update tests with descriptive comments

* feat: add integration tests

* fix: store email in session update

* fix: add setting for tests

* fix: fix tests

* feat: Upgrade Python dependency edx-drf-extensions (#34135)

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

Co-authored-by: syedsajjadkazmii <syedsajjadkazmii@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: syedsajjadkazmii <syedsajjadkazmii@users.noreply.github.com>
2024-01-29 14:43:51 +05:00
Glib Glugovskiy
d344a7eef6 fix: [FC-0031] Restrict access to is_enrolled field 2023-12-15 20:28:31 +02:00
KyryloKireiev
bd5386356a feat: [FC-0031] Add optional field 'is_enrolled' to course detail view 2023-12-15 14:28:09 +02:00
KyryloKireiev
258f3fc8a0 fix: [FC-0031] Add limit the number of returned results for mobile_search 2023-11-01 17:07:52 +02:00
Kyrylo Kireiev
763b102ac9 fix: [AXIM-50] Fix count items in pagination 2023-11-01 17:07:52 +02:00
Feanil Patel
e3851ab3d1 test: Update to reuse variables in more places.
Some of the places where we had explicit copies of the password were not
necessary so we referece the exsting TEST_PASSWORD variable where
possible.
2023-10-16 12:33:25 -04:00
Feanil Patel
1e2ea85372 test: Update more tests that had short passwords. 2023-10-10 16:36:26 -04:00
Sagirov Evgeniy
c5d1807c81 feat!: remove most Old Mongo functionality (#31134)
This commit leaves behind just enough Old Mongo (DraftModulestore)
functionality to allow read-only access to static assets and the
root CourseBlock. It removes:

* create/update operations
* child/parent traversal
* inheritance related code

It also removes or converts tests for this functionality.

The ability to read from the root CourseBlock was maintained for
backwards compatibility, since top-level course settings are often
stored here, and this is used by various parts of the codebase,
like displaying dashboards and re-building CourseOverview models.

Any attempt to read the contents of a course by getting the
CourseBlock's children will return an empty list (i.e. it will look
empty).

This commit does _not_ delete content on MongoDB or run any sort of
data migration or cleanup.
2023-09-06 10:01:31 -04:00
Yusuf Musleh
4ad8ba1b41 feat: list courses details by keys
This adds the ability to get a list of detailed courses based on their
keys provided in the newly added `keys` query param in the `GET /courses/v1/courses/`
endpoint.
2023-07-12 17:22:38 +03:00
Pooja Kulkarni
702e14a28a refactor: rename descriptor -> block within remaining lms
Co-authored-by: Agrendalath <piotr@surowiec.it>
2023-04-26 17:10:54 +02:00
Pooja Kulkarni
a0d23b20f5 refactor: rename descriptor -> block within lms/djangoapps/course_api
Co-authored-by: Agrendalath <piotr@surowiec.it>
2023-04-26 17:10:53 +02:00
Muhammad Adeel Tajamul
198103635c fix: remove discussion xblocks from unit children (#31964) 2023-03-24 08:05:45 +05:00
Muhammad Adeel Tajamul
acace4b41e fix: removed discussion xblock from descendant in blocks api (#31856)
Co-authored-by: adeel.tajamul <adeel.tajamul@arbisoft.com>
2023-03-02 06:09:16 +05:00
Muhammad Adeel Tajamul
63b5c841cd fix: blocks v2 will filter discussion xblocks (#31820)
Co-authored-by: adeel.tajamul <adeel.tajamul@arbisoft.com>
2023-03-01 06:25:37 +05:00
ALi Raza
0ff7c5b13f feat: Enable Certificate Display Behavior add certificate_available_date in course detail API
feat: Enable Certificate Display Behavior add certificate_available_date in course detail API

fix: reviwed changes, certificate_available_date in Course Detail API but not in Course List API

fix: reviewed changes, certificate available date display condition updated

fix: final reviewed changes

fix: serializer and linting tests

fix: serializer and tests

fix: docstring

fix: docstring and tests

fix: typo and mock call
2023-02-23 22:34:11 +05:00
Feanil Patel
d846ea8558 Merge pull request #31633 from openedx/feanil/depr_bs_raise_error
feat!: Remove block_structure.raise_error_when_not_found waffle flag.
2023-01-30 10:17:00 -05:00
Arunmozhi
d417a7561f refactor: rename ItemFactory to BlockFactory 2023-01-23 14:47:47 +01:00
Feanil Patel
40eedc6889 test: Update query counts now that we've removed a waffle flag.
Various tests with query counts need to be updated now that we have
removed a waffle check that was in their codepath.
2023-01-22 18:39:51 -05:00
Syed Muhammad Dawoud Sheraz Ali
d2fd26ee91 feat: the ability to filter active courses in course listing api (#31502)
* feat: the ability to filter active courses in course listing api
2023-01-09 20:37:30 +05:00
0x29a
dd9f6936bc refactor: xmodule/video_module -> xmodule/video_block 2022-12-19 17:48:49 +01:00
0x29a
0df1411636 refactor: xmodule/course_module.py -> xmodule/course_block.py 2022-12-19 17:48:49 +01:00
Navin Karkera
c302c8a22b feat: block metadata api - index_dictionary
Adds new api to return block metadata which includes index_dictionary.
Reason for new api instead of adding it to course blocks API: data like
index_dictionary are too large for the cache used by course/blocks
transformers API.
2022-11-29 10:49:36 -08: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
Moeez Zahid
2f098c54e6 fix: Youtube has highest default stream priority (#31014) 2022-09-19 20:31:42 +05:00
Sarina Canelake
4a2f231302 fix: fix github url strings (org edx -> openedx) 2022-09-15 14:52:28 -04:00
Chris Chávez
ebd96cba8a fix: Bug showing hidden sections for learners of a public course fixed (#27925)
The bug is explained in https://openedx.atlassian.net/browse/CRI-233. Only is missing add the `VisibilityTransformer` in `get_blocks()` when the user is not enrolled to the course.
On the test, `html_block` is visible only for staff and `vertical_block` is a normal block. The new behaviour hides the `html_block` and show the `vertical_block` to anonymous users
2022-08-02 12:40:23 -04:00
Moeez Zahid
500cc9f0f0 fix: Add default video stream priority (#30810) 2022-07-29 22:31:47 +05:00
Moeez Zahid
3311225292 feat: Add stream_priority for videos (#30767)
* feat: Add stream_priority for videos
2022-07-29 13:33:42 +05:00