338 Commits

Author SHA1 Message Date
Akanshu Aich
2d82d90279 refactor: migrated FEATURES dict settings to top-level in core files and fixed related test files. (#37389)
* refactor: moved remaining feature dicts settings into top-level settings.

* refactor: moved remaining feature dicts settings into top-level settings.

* fix: fixed the test files

* fix: fixed tehe pylint errors

* fix: fixation of the cms ci failure

* fix: fixed remaining feature settings for cms

* fix: added fix for requirements

* fix: added fix for lms tests

* fix: resolved the test views issue

* fix: configured views file and test_views

* fix: fixed lint errors and assertion issues

* fix: added fix for base url issue in test view

* fix: added fix for base_url and assertion issue

* fix: added configurations for base utl fix

* fix: handled none issue for mfe config

* fix: corrected override settings in test views

* fix: added getattr defensive technique for view settings

* fix: reverted views and test_views file

* fix: added settings in views file

* fix: added with patch within functions in test view

* fix: rearranged the features in default_legacy_config

* fix: fixing the tests  with clearing cache

* fix: reverted test views to verify the CI check

* fix: added cache clear in mfe config test

* fix: fixed the patch toggles to override settings

* fix: fixed the lint errors

* fix: changed patch toggle to override settings
2026-01-20 11:55:26 -05: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
777ba88218 feat: [AXM-2398] Add short label to assignment (#36970)
Rationale: The instructor may create short labels that are longer than
3 characters, and they can be hard to work with in the mobile UI. Thus,
on mobile, it was decided to add short labels to the api response by
getting them from section breakdown, which ensures they are consistent
with the labels the user sees in the Grading section.
2025-09-18 10:46:02 -04:00
Ahtisham Shahid
914887ff78 Revert "feat: added api for mobile configs (#37323)" (#37332)
This reverts commit 3d4652420c.
2025-09-08 19:33:33 +05:00
Ahtisham Shahid
3d4652420c feat: added api for mobile configs (#37323) 2025-09-04 16:21:07 +05:00
jawad khan
3cb9c00de2 Add organization logo field in mobile apis (#36940)
* feat: Add org_logo field in mobile apis

* fix: fixed quality checks
2025-06-24 19:42:36 +05:00
jawad khan
98e39aa03d fix: Removed unwanted param to course blocks api
* fix: removed unwanted param to course blocks api
2025-06-03 16:43:54 +05:00
andrey-canon
3eab7ea27f feat: add site-aware unit test 2025-01-23 18:23:49 -05:00
andrey-canon
fd74df3857 feat: filter by current site organizations 2025-01-21 16:21:38 -05:00
jawad khan
6ad5b1014c feat: Add deprecate_youtube flag in course blocks api (#35754) 2024-11-08 11:06:34 +05:00
KyryloKireiev
e868888f54 refactor: [AXM-549] Use course keys instead ids 2024-10-30 17:55:31 +02:00
KyryloKireiev
bc71be4811 feat: [AXM-549] Add query limit to User Enrollments 2024-10-24 13:15:36 +03:00
KyryloKireiev
bf073fb68c refactor: [AXM-549] Change enrollments status API field name 2024-10-17 18:06:03 +03:00
KyryloKireiev
1eec8b80e4 fix: [AXM-549] Use more efficient query 2024-10-08 17:47:43 +03:00
Glib Glugovskiy
1b369b72bd Merge branch 'master' into kireiev/AXM-549/feat/upstream_PR_active_inactive_courses_API 2024-10-03 10:56:06 +03:00
Іван Нєдєльніцев
13e3024ae3 style: [FC-0047] fix code style issues 2024-09-06 17:40:26 +03:00
Іван Нєдєльніцев
9a0734b280 style: [FC-0047] add module docstrings 2024-09-05 15:30:04 +03:00
Ivan Niedielnitsev
28eb406f8d feat: [FC-0047] add settings for edx-ace push notifications
feat: [FC-0047] Add push notifications for user enroll

feat: [FC-0047] Add push notifications for user unenroll

feat: [FC-0047] Add push notifications for add course beta testers

feat: [FC-0047] Add push notifications for remove course beta testers

feat: [FC-0047] Add push notification event to discussions
2024-09-05 15:29:48 +03:00
Glib Glugovskiy
4b4fa5f162 Merge branch 'master' into kireiev/AXM-549/feat/upstream_PR_active_inactive_courses_API 2024-08-05 20:27:17 +03:00
jawad khan
b77b90a344 fix: Enable courseware access api for all types of course(expired, cl… (#35155)
* fix: Enable courseware access api for all types of course(expired, closed etc)
2024-07-24 01:40:41 +05:00
jawad khan
3589d964cb feat: Added mobile api for course enrollment and other details. (#35100)
* feat: Added mobile api for course enrollment and other details.
2024-07-17 13:19:10 +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
KyryloKireiev
1a7f55b01e refactor: [AXM-549] Refactor UserEnrollmentsStatus API 2024-06-21 19:37:02 +03:00
KyryloKireiev
e474abda4f style: [AXM-549] Remove unused import 2024-06-21 19:37:02 +03:00
KyryloKireiev
bd8b35d0d8 fix: [AXM-549] Added missing import 2024-06-21 19:37:02 +03:00
Kyrylo Kireiev
0d0503a716 feat: [AXM-200] Implement user's enrolments status API (#2530)
* feat: [AXM-24] Update structure for course enrollments API (#2515)

* feat: [AXM-24] Update structure for course enrollments API

* style: [AXM-24] Improve code style

* fix: [AXM-24] Fix student's latest enrollment filter

* feat: [AXM-47] Add course_status field to primary object (#2517)

* feat: [AXM-40] add courses progress to enrollment endpoint (#2519)

* fix: workaround for staticcollection introduced in e40a01c

* feat: [AXM-40] add courses progress to enrollment endpoint

* refactor: [AXM-40] add caching to improve performance

* refactor: [AXM-40] add progress only for primary course

* refactor: [AXM-40] refactor enrollment caching optimization

---------

Co-authored-by: Glib Glugovskiy <glib.glugovskiy@raccoongang.com>

* feat: [AXM-53] add assertions for primary course (#2522)

* feat: [AXM-53] add assertions for primary course

* test: [AXM-53] fix tests

* style: [AXM-53] change future_assignment default value to None

* refactor: [AXM-53] add some optimization for assignments collecting

* feat: [AXM-200] Implement user's enrolments status API

* style: [AXM-200] Improve code style

* refactor: [AXM-200] Divide get method into smaller methods

---------

Co-authored-by: NiedielnitsevIvan <81557788+NiedielnitsevIvan@users.noreply.github.com>
Co-authored-by: Glib Glugovskiy <glib.glugovskiy@raccoongang.com>
2024-06-21 19:37:02 +03:00
Kyle McCormick
11626148d9 refactor: switch from mock to unittest.mock (#34844)
As of Python 3.3, the 3rd-party `mock` package has been subsumed into the
standard `unittest.mock` package. Refactoring tests to use the latter will
allow us to drop `mock` as a dependency, which is currently coming in
transitively through requirements/edx/paver.in.

We don't actually drop the `mock` dependency in this PR. That will happen
naturally in:

* https://github.com/openedx/edx-platform/pull/34830
2024-05-22 13:52:24 -04:00
jawad khan
67ccd702f5 feat: Added upgrade deadline in blocks api (#34750) 2024-05-09 12:19:50 +05:00
Glib Glugovskiy
c37e9765ef feat(mobile_api): Add course access object to mobile course info API (#34273)
* feat: include access serializer into mobile info api view

* test: add tests for serializer and view methods

* test: move tests to common directory and update test case

* fix: cr fixes and use snake case for functions

* test: fix additional get call assertion

* feat: add required course access messages to mobile endpoint

* test: [AXM-229] Improve test coverage

* style: [AXM-229] Try to fix linters

* fix: remove redundant comment

* refactor: change names for the test files

---------

Co-authored-by: KyryloKireiev <kirillkireev888@gmail.com>
2024-04-25 13:13:43 +05:00
Moeez Zahid
fca51419f8 refactor: Increase size for mobile config singelton value (#34288)
Co-authored-by: Abdul  Moeez Zahid <abdul.moeez@025907584957.2tor.net>
2024-02-27 19:30:21 +05:00
jawad khan
79d692dc92 feat: Add course price in mobile enrollment api (#34255)
* feat: Add course price in mobile enrollment api
2024-02-19 20:49:33 +05:00
Glib Glugovskiy
cae4091579 docs: [FC-0031] Update docstring 2023-12-19 19:15:29 +02:00
KyryloKireiev
003f6d9bb4 refactor: [FC-0031] Use serializer instead of custom function 2023-12-19 19:15:29 +02:00
KyryloKireiev
81c992990a fix: [FC-0031] Add parameters description, refactor list method 2023-12-19 19:15:29 +02:00
KyryloKireiev
c4fe8d30e3 feat: [AXIM-26] Extended BlocksInCourseView API 2023-12-19 19:15:29 +02:00
Muhammad Adeel Tajamul
cf6a629ee7 fix: discussion tab should be None if discussion tab is disabled (#33861) 2023-12-11 15:06:37 +05:00
Glib Glugovskiy
3da85a994e fix: remove trailing whitespace failing quality check 2023-11-20 23:08:56 +02:00
Glib Glugovskiy
95fcb124dd docs: add docstring for the paginator property override 2023-11-20 22:40:28 +02:00
KyryloKireiev
ee4b92ca10 feat: [AXIM-6] Add DefaultPagination for UserCourseEnrollmentsList v3 2023-11-20 22:40:28 +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
64e91d4080 test: Update to an even longer password. 2023-10-12 10:31:13 -04:00
Feanil Patel
1e2ea85372 test: Update more tests that had short passwords. 2023-10-10 16:36:26 -04:00
Moeez Zahid
7ae64a5eb4 refactor: Add logging to mobile_api app (#33064) 2023-08-23 16:20:20 +05:00
Usama Sadiq
7710e60328 fix: fix middleware get_response parameter deprecation warning (#33067) 2023-08-22 15:52:30 +05:00
Moeez Zahid
9fd913bb03 fix: Add platform name to mobile config cache key (#32504) 2023-06-19 19:46:25 +05:00
Pooja Kulkarni
c452fb3204 refactor: rename descriptor -> block within lms/djangoapps/mobile_api
Co-authored-by: Agrendalath <piotr@surowiec.it>
2023-04-26 17:10:54 +02:00
Moeez Zahid
c8af0f607f Enable In-App purchases on edx-mobile app (#31512)
* feat: added mobile skus in course mode

* fix: changed api

---------

Co-authored-by: jawad-khan <jawadkhan444@gmail.com>
Co-authored-by: Robert Raposa <rraposa@edx.org>
2023-02-10 16:16:37 +05:00
0x29a
3a1011bed8 refactor: replace usages of XModuleMixin.system with XBlock.runtime 2023-01-30 18:15:24 +01:00
0x29a
fd191db332 refactor: rename module (or item) -> block within remaining lms
Also, removed `_iter_scorable_xmodules` method from `lms/djangoapps/grades/transformer.py` file.
2023-01-30 18:15:23 +01:00