53 Commits

Author SHA1 Message Date
Navin Karkera
32b7f27c46 feat: api to bulk update legacy library references (#37789)
Adds API to fetch all legacy library content blocks that are ready to be updated to use library v2 and convert to item banks.
Also adds API to update all the references via a user celery task and to fetch its status.
2025-12-22 12:49:43 -05:00
Muhammad Labeeb
8ad4d42e3b feat!: Remove proctortrack references; add requires_escalation_email and show_review_rules options (#37576)
BREAKING CHANGE: All references to the hardcoded 'proctortrack' string have
been removed from the codebase,  as well as the `studio.show_review_rules`
waffle flag. These were used to determine whether an escalation email is
required and whether review rules should be shown. These decisions are now made
based on the value of 'requires_escalation_email' (default False) and 'show_review_rules'
(default True) config items in the PROCTORING_BACKENDS entry.

Additionally:
* The proctoring info api will now return the list of providers which require an escalation
   email so that frontend-app-learning does not need to use a hardcoded check agaist
   the provider name 'proctortrack'.
* Removed translation commands, mock variables and user facing strings that contained
  'proctortrack'.
* Updated all test cases that were using proctortrack to use fake providers names.

Part of: https://github.com/openedx/edx-platform/issues/36329
2025-11-25 09:37:32 -05:00
Arslan Ashraf
b9d6a8c788 test: add test 2025-10-30 16:26:07 +05:00
Daniel Wong
6c495ad283 fix: certificates_enabled flag now correctly returns its boolean value 2025-06-02 12:53:21 -06:00
Navin Karkera
5e51e2d5b7 fix: swagger docs ref_name conflicts (#36189)
* fix: swagger docs ref_name conflicts

* fix: swagger auto doc errors

* chore: bumps openedx-learning==0.18.2

---------

Co-authored-by: Jillian Vogel <jill@opencraft.com>
2025-01-30 20:32:18 +05:30
David Ormsbee
d018675968 perf: reduce ORM queries needed for video quality info
The CourseQualityView used to call edx-val's get_video_for_course(),
which would return a fully serialized data structure that included all
encodings and inefficiently serialized them with many n+1 queries. This
is tolerable in a paginated web view, but not when pulling all of a
large courses's videos at once.

Making this change collapsed the number of queries for a large sample
MIT course from over 3000 down to 1.
2025-01-21 12:06:40 -05:00
Feanil Patel
ff4d084e8b fix: Update to adjust for new scipy.stats.mode behavior.
Previously the default for the `keepdims` parameter was True, but as of
SciPy 1.11.0 it is false. This is actually the behavior we want here
since we only care about the mode value and not other values.

https://docs.scipy.org/doc/scipy/release/1.11.0-notes.html#expired-deprecations
2024-06-11 11:30:22 -04:00
Kshitij Sobti
c3c0adf978 feat: add support for zip files to course and library import code (#34191)
Co-authored-by: Rodrigo Ferreira de Souza <rodfersou@gmail.com>
2024-03-08 18:51:35 +01:00
Jesper Hodge
96f1397872 Refactor rename contentstore xblock services (#32581)
This PR addresses the renaming of the contentstore/xblock_services folder to contentstore/xblock_storage_handlers as a follow-up to PR #32282. The renaming is done to prevent naming conflicts with xblock runtime services and to make the purpose of the files more understandable. The file xblock_service.py has been renamed to view_handlers.py to better reflect its functionality.

Justification and Future Refactoring Outlook:
The xblock_storage_handlers folder contains service methods that implement the business logic for view endpoints located in contentstore/views/block.py. It is renamed to xblock_storage_handlers to reflect its responsibility of handling storage-related operations of xblocks, such as creation, retrieval, and deletion.

The view_handlers.py file includes business methods called by the view endpoints. These methods, such as handle_xblock, delete_orphans, etc., interact with the required modulestore methods, handle any errors, and aggregate and serialize data for the response.

The term 'handler' in the context of 'view_handlers.py' represents methods that facilitate business logic for view endpoints. It is critical to note the distinction between these 'handler methods' and the xblock_handler method. The xblock_handler is a view endpoint itself, residing in contentstore/views/block.py, and is well known in this context. Although its name might suggest otherwise, it is not a handler in the sense of the 'handler methods' we've defined in 'view_handlers.py'. To maintain consistency with existing naming conventions, it remains as xblock_handler.
2023-07-05 11:24:24 -04:00
Jesper Hodge
a6c57811cd feat add xblock api endpoint (#32282)
* feat: add xblock endpoint for updating an xblock

fix: remove debugger

feat: make function call more generic

refactor: just use request.json for request data as before

refactor: extract method

fix: revert wrong method change

fix: refactor correct method

feat: use handle_xblock method so that we can do more than update xblocks

fix: usage_key_string defaults to None

add all CRUD operations

fix usage key parameter

refactor: create /views folder

refactor: move xblock view functions to xblock_services

fix: tests

fix: tests

refactor: move xblock API endpoint to contentstore

* docs: add explanatory comment to new xblock_service

* feat: add feature flag for enabling content editing api

* feat: raise 404 if studio content api is disabled

* tests: test xblock endpoint

* test: make all post tests work

* test: check that xblock_handler receives correct args

* refactor: create util mixin for course factories with staff

* refactor: extract course staff authorization tests

* refactor: extract tests to api view testcase class

* test: add get tests

* test: fix tests

* test: fix tests

* test: fix tests

* test: add all crud tests

* fix: refactor to fix tests

* fix: merge conflict

* fix: merge conflict

* fix: tests after merge

* fix: json request decorator

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: new test files

* fix: lint

* fix: lint and apply PR suggestions

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: lint
2023-06-15 14:17:49 -04:00
Arunmozhi
d417a7561f refactor: rename ItemFactory to BlockFactory 2023-01-23 14:47:47 +01:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Simon Chen
895cc10c1b fix: do not validate proctoring_provider if proctoring is disabled (#29803)
Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
2022-01-21 12:45:43 -05:00
Jawayria
7f5b4a6a47 chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
2022-01-06 19:14:51 +05:00
Jawayria
c320d5cd1b fix: replace 'django.conf.url()' with 'django.urls.re_path()' 2021-12-14 19:53:24 +05:00
Jawayria
0e63c20f64 chore: Applied lint-amnesty on cms/djangoapps/contentstore 2021-12-10 19:20:37 +05:00
Ned Batchelder
d9dd10dc97 style: code cleanups from Steven Burch (#29292)
* chore: update deprecated import from collections

* chore: remove outdated imports from markdown library

as it hasn't been supported since 2.0.3 and we're on 3.x.
This was deprecated at least as early as 2012!

* docs: add docstring and remove lint-amnesty to markdown plugin

* chore: remove deprecated etree import

* style: remove unnecessary-comprehension for sets

* style: resolve a number of amnestied pylint complaints

Co-authored-by: stvn <stvn@mit.edu>
2021-11-10 07:11:57 -08:00
Bianca Severino
5420c37441 feat: include proctoring escalation email in
course validation
2021-05-05 10:10:21 -04:00
stvn
2fa36fb0cf refactor: Move StaffFactory helper to common/ 2021-04-14 07:26:39 -07:00
Awais Jibran
49296005db Adding some minor changes to logs (#27127) 2021-03-24 17:25:04 +05:00
AsadAzam
1593b40702 Improved logging for import (#27024)
* Improved logging for import

* Refactored code

* Refactored code

* Refactored code

* Refactored code

* Refactored code

* refactored code

* Refactored code

* Updating log

Co-authored-by: Awais Jibran <awaisdar001@gmail.com>
2021-03-18 12:40:38 +05:00
M. Zulqarnain
5562944e87 BOM-2369 (A): pyupgrade on api,contentstore and cms_user_tasks apps under CMS (#26676)
* pyupgrade on cms api,contentstore and cms_user_tasks apps
2021-03-04 15:06:07 +05:00
Michael Terry
74887aa216 feat: turn on schedule creation by default
This commit removes several waffle toggles that have been enabled
on edx.org for years. It's time to remove the rollout gating for
these features and enable them by default.

This doesn't directly change any behavior. But it does create new
database objects by default now and allows for enabling other
schedule based features more easily.

Specifically, the following toggles were affected.

schedules.create_schedules_for_course
- Waffle flag removed as always-enabled
- We now always create a schedule when an enrollment is created

schedules.send_updates_for_course
- Waffle flag removed as always-enabled
- Course update emails are sent as long as the ScheduleConfig
  allows it.
- This is not a change in default behavior, because ScheduleConfig
  is off by default.

dynamic_pacing.studio_course_update
- Waffle switch removed as always-enabled
- Course teams can now always edit course updates directly in Studio

ScheduleConfig.create_schedules
ScheduleConfig.hold_back_ratio
- Model fields for rolling out the schedules feature
- Schedules are now always created
- This commit only removes references to these fields, they still
  exist in the database. A future commit will remove them entirely

This commit also adds a new has_highlights field to CourseOverview.
This is used to cache whether a course has highlights, used to
decide which course update email behavior they get. Previously every
enrollment had to dig into the modulestore to determine that.
2021-02-23 12:34:02 -05:00
usamasadiq
7bbde8f0f5 Applied pylint-amnesty 2021-02-08 13:00:22 +05:00
Kyle McCormick
151bd13666 Use full names for common.djangoapps imports; warn when using old style (#25477)
* Generate common/djangoapps import shims for LMS
* Generate common/djangoapps import shims for Studio
* Stop appending project root to sys.path
* Stop appending common/djangoapps to sys.path
* Import from common.djangoapps.course_action_state instead of course_action_state
* Import from common.djangoapps.course_modes instead of course_modes
* Import from common.djangoapps.database_fixups instead of database_fixups
* Import from common.djangoapps.edxmako instead of edxmako
* Import from common.djangoapps.entitlements instead of entitlements
* Import from common.djangoapps.pipline_mako instead of pipeline_mako
* Import from common.djangoapps.static_replace instead of static_replace
* Import from common.djangoapps.student instead of student
* Import from common.djangoapps.terrain instead of terrain
* Import from common.djangoapps.third_party_auth instead of third_party_auth
* Import from common.djangoapps.track instead of track
* Import from common.djangoapps.util instead of util
* Import from common.djangoapps.xblock_django instead of xblock_django
* Add empty common/djangoapps/__init__.py to fix pytest collection
* Fix pylint formatting violations
* Exclude import_shims/ directory tree from linting
2020-11-10 07:02:01 -05:00
Kyle McCormick
538dbf696b Import CMS code using fully qualified module names
or, using proper the proper Python 3 relative imports
(e.g., 'from .views import x') which are standard and
unambiguous.
2020-10-19 09:34:31 -04:00
Aarif
98af9ce418 remove useless-supression warnings 2020-05-01 19:42:15 +05:00
Awais Qureshi
0f002bafb8 BOM-1399
checking django-wiki and fixing deprecation warnings.
2020-03-16 14:37:18 +05:00
Feanil Patel
9cf2f9f298 Run 2to3 -f future . -w
This will remove imports from __future__ that are no longer needed.

https://docs.python.org/3.5/library/2to3.html#2to3fixer-future
2019-12-30 10:35:30 -05:00
Ayub khan
cbba8d8455 BOM-363
python 3 compatibility
2019-09-04 14:49:36 +05:00
Awais Qureshi
158e406290 Merge pull request #20995 from edx/awais786/INCR-339
INCR-339
2019-07-12 14:52:47 +05:00
arbisoft
32e89b48bc Fixing python-modernize issues. 2019-07-09 16:25:08 +05:00
arbisoft
5f9721a42c Fixing python-modernize issues. 2019-07-09 16:00:41 +05:00
Matthew Piatetsky
7df30938c4 fix unicode strings in cms/ 2019-02-04 13:01:51 -05:00
asadazam93
e451324ed3 Added enable quality waffle flag 2019-01-08 17:14:41 +05:00
noraiz-anwar
3b7918b07a Add basic pagination in video upload page 2019-01-04 23:06:57 +05:00
Alex Dusenbery
0d51f90568 Move gradebook course info API into LMS 2018-11-29 13:05:42 -05:00
Alex Dusenbery
009074ec4b Add an /api/courses/v1/grading endpoint to get assignment type and subsection info about a course. 2018-11-26 10:12:12 -05:00
asadazam93
75f0211b0d Add waffle flag to disable quality for course-v1:HarvardX+SW12.1x+2016 2018-11-09 18:35:11 +05:00
asadazam93
3b5e0eb5c0 Add time logs 2018-11-01 15:43:13 +05:00
Nimisha Asthagiri
700a902b68 Cleanup and remove deprecated RequestCache Django app
ARCH-223
2018-09-12 14:39:11 -04:00
Awais Jibran
3bb34faa8f Fix edge checklist 500 error
EDUCATOR-3355
2018-09-10 16:30:13 +05:00
Michael Roytman
6083a11a5e add has_grading_policy to course validation API 2018-08-02 12:17:58 -04:00
Sanford Student
5f96420dd3 add validation of ORAs 2018-07-26 15:24:23 -04:00
Michael Roytman
14b59d6434 add condition for existence of course end date to graded_only option 2018-07-13 10:24:47 -04:00
Michael Roytman
92c816966d change course_validation endpoint to support option to get data for only graded assignments and add ability to scroll to elements on the course outline page 2018-07-12 11:03:55 -04:00
Nimisha Asthagiri
8db2dd47dd Course Validation and Course Quality APIs 2018-06-13 20:33:45 -04:00
Eric Fischer
247bb50ed2 s/django.core.urlresolvers/django.urls/g
Django 1.10 deprecation fix for Hackathon XIX
Addresses PLAT-1397
2018-06-05 13:59:09 -04:00
Douglas Hall
c6ec5edbf7 Add API documentation with django-rest-swagger. 2018-05-08 14:38:33 -04:00
Eric Fischer
e18448e27d Silence deprecation warnings
https://docs.djangoproject.com/en/1.11/releases/1.10/#using-user-is-authenticated-and-user-is-anonymous-as-methods
2018-05-02 10:03:50 -04:00