Commit Graph

5060 Commits

Author SHA1 Message Date
Feanil Patel
908aca4409 fix: Remove unused bad validation for images.
The `CourseRunImageField` is a subclass of the DRF
`serializers.ImageField` serializer and that class ignores the
`default_validators` and actually just uses Django's image validation
which is already correct and does in fact validate that the image content
is correct not just that the image extension is correct.

The DRF code that does the validation:
https://github.com/encode/django-rest-framework/blob/main/rest_framework/fields.py#L1621-L1628

Which actually just calls the Django Image Validators.

The Django Field definition:
https://github.com/django/django/blob/main/django/forms/fields.py#L712

And you can see that in the
[`to_python`](https://github.com/django/django/blob/main/django/forms/fields.py#L721)
function of that class it actually checks the image content.

This function is never actually called and so it's just misleading.
2026-01-12 12:58:21 -05:00
Irtaza Akram
474dc71f0d chore: remove legacy problem studio view (#37795)
* fix: remove legacy problem studio view and resource templates
2026-01-08 13:07:15 +05:00
Muhammad Farhan Khan
0b628353ef refactor: move editor_saved to VideoConfigService (#37829)
refactor: move editor_saved to VideoConfigService (#37829)
* This moves edx-platform-specific logic out of the VideoBlock,
in preparation for the VideoBlock extraction
2026-01-08 11:50:08 +05:00
Irtaza Akram
33cc1a94ba chore: upstream ProblemBlock exceptions and shared utilities to XBlock (#37806)
* fix: add support for xblock 5.3.0
2026-01-07 13:30:53 +05:00
Ahtisham Shahid
9d2bbb1797 refactor: removed all references to CourseNotificationPreference (#37768) 2025-12-29 15:11:56 +05:00
Rômulo Penido
e26a3fb7e6 fix: add course name on collection description on import (#37817)
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
2025-12-24 18:25:09 +00:00
Navin Karkera
a37528d5ad feat: allow specifying custom page size for course list api (#37815) 2025-12-24 11:56:49 -05:00
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 Farhan Khan
f93322aae8 chore: remove unused copy_or_rename_transcript method
Merge pull request #37779 from openedx/farhan/remove-legace-code
2025-12-22 12:58:16 +05:00
David Ormsbee
f899c7907a fix: allow library creation by course creators
Prior to this, if ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES
was enabled, we would not return the orgs that someone had course
creator rights on, even if ENABLE_CREATOR_GROUP was enabled. (For the
moment, we are conflating "can create courses" with "can create
libraries" for a given org, even though we should probably eventually
split those apart.)
2025-12-18 22:56:33 -05:00
Kyle McCormick
91e521ef51 fix: Various fixes to modulestore_migrator (#37711)
For legacy library_content references in courses, this PR:
- **Removes the spurious sync after updating a reference to a migrated
  library**, so that users don't need to "update" their content _after_
  updating their reference, _unless_ there were real content edits that
  happened since they last synced. We do this by correctly associating a
  DraftChangeLogRecord with the ModulestoreBlockSource migration artifact,
  and then comparing that version information before offering a sync.
  (related issue:
  https://github.com/openedx/frontend-app-authoring/issues/2626).
- **Prompts users to update a reference to a migrated library with higher
  priority than prompting them to sync legacy content updates for that
  reference**, so that users don't end up needing to accept legacy content
  updates in order to get a to a point where they can update to V2 content.
- **Ensures the library references in courses always follow the correct
  migration,** as defined by the data `forwarded` fields in the data model,
  which are populated based on the REST API spec and the stated product UI
  requirements.

* For the migration itself, this PR:

- **Allows non-admins to migrate libraries**, fixing:
  https://github.com/openedx/edx-platform/issues/37774
- **When triggered via the UI, ensures the migration uses nice title-based
  target slugs instead of ugly source-hash-based slugs.** We've had this as an
  option for a long time, but preserve_url_slugs defaulted to True instead of
  False in the REST API serializer, so we weren't taking advantage of it.
- **Unifies logic between single-source and bulk migration**. These were
  implement as two separate code paths, with drift in their implementations. In
  particular, the collection update-vs-create-new logic was completely
  different for single-souce vs. bulk.
- **When using the Skip or Update strategies for repeats, it consistently
  follows mappings established by the latest successful migration** rather than
  following mappings across arbitrary previous migrations.
- **We log unexpected exceptions more often**, although there is so much more
  room for improvement here.
- **Adds more validation to the REST API** so that client mistakes more often
  become 400s with validation messages rather than 500s.

For developers, this PR:
- Adds unit tests to the REST API 
- Ensures that all migration business logic now goes through a general-purpose
  Python API.
- Ensures that the data model (specifically `forwarded`, and
  `change_log_record`) is now populated and respected.
- Adds more type annotations.
2025-12-18 23:49:36 +00:00
Navin Karkera
781feb1883 feat: suppress user task email after importing content in libraries (#37771) 2025-12-18 11:15:32 -05:00
Navin Karkera
ca78895edf chore: add end date to course outline api (#37727)
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
2025-12-17 17:22:05 +00:00
farhan
386dfe3e99 chore: remove unused copy_or_rename_transcript method 2025-12-17 21:04:15 +05:00
Jesus Balderrama
2637cc6b0f feat(numericalInput): endpoint added to validate a numerical input (#37677)
To be used in the visual Problem editor to validate numeric input. 

Part of: https://github.com/openedx/frontend-app-authoring/issues/1680
2025-12-16 17:23:31 -05:00
Chris Chávez
a032955243 feat: New states for library info icon in components in Unit page (#37735)
- Adds `upstream_name` to the `UpstreamLink` dataclass.
- Add new states to library info icon in components in Unit page
2025-12-16 19:18:24 +00:00
Feanil Patel
05d0d0936d Merge commit from fork
fix: CourseLimitedStaffRole should not be able to access studio.
2025-12-16 11:56:16 -05:00
Usama Sadiq
e1747f3844 build: add support for Python 3.12 (#37160)
* build: add support for Python 3.12
2025-12-15 12:12:29 +05:00
Navin Karkera
a3cc78a377 fix: handle PluginMissingError while migrating legacy blocks to libraries v2 (#37732)
Unhandled exception while migration legacy xblocks into new library stops the migration process abruptly causing following issues:

* Components not being collected into Collections for successful migrations
* Data being corrupted for already migrated blocks most likely due to incomplete transaction.
2025-12-12 16:47:02 +00:00
Feanil Patel
f2bb6cb2e6 fix: CourseLimitedStaffRole should not be able to access studio.
We previously fixed this when the CourseLimitedStaffRole was applied to
a course but did not handle the case where the role is applied to a user
for a whole org.  The underlying issue is that the CourseLimitedStaffRole
is a subclass of the CourseStaffRole and much of the system assumes that
subclesses are for giving more access not less access.

To prevent that from happening for the case of the CourseLimitedStaffRole,
when we do CourseStaffRole access checks, we use the strict_role_checking
context manager to ensure that we're not accidentally granting the
limited_staff role too much access.
2025-12-11 17:15:53 -05:00
Emad Rad
6a046ebe50 chore: fixed typos 2025-12-11 11:46:44 -05:00
David Ormsbee
dcd2258db4 fix: don't send emails on library backup/restore
There is no way to resume either the backup or restore library actions,
i.e. if you navigate away from it, you have to do it again. This is a
limitation of the current UI because we wanted to get something quick
and simple in for Ulmo, but it also reflects the fact that library
backup/restore should be much faster than course import/export has
historically been.

In any case, sending an email for a 5-10 second task is unnecessary and
distracting, so this commit suppresses the email.

Note: I'm using local imports to get around the fact that the
content_libraries public API is used by content_libraries/tasks.py
which defines the tasks. I can't import from content_libraries/tasks.py
directly, because that would violate import linter rules forbidding
other apps from importing things outside of api.py. This isn't ideal,
but it keeps the fix small and it keeps the logic in the
content_libraries app.
2025-12-05 12:24:00 -05:00
Muhammad Farhan Khan
b57e2ac1ea chore: move get_transcript method to video service (#37635)
https://github.com/openedx/public-engineering/issues/445
2025-12-05 17:53:10 +05:00
Chris Chávez
828d10400e feat: Add new fields in modulestore migratior serializers [FC-0112] (#37653)
`target_collection` and `task_uuid` added to migration serializers
2025-12-04 21:48:24 +00:00
Navin Karkera
562978990a feat: store information for failed block migrations (#37691)
* Updates `ModulestoreBlockMigration` table to allow storing `null` values in `target` field for blocks that failed to migrate/import.
* Adds `unsupported_reason` field to store reason for failure.
* Add number of children blocks in failed block `unsupported_reason` field. 
* Fixes issue with blocks like `openassessment` where `url_name` field is not included in its olx during serialization.
2025-11-27 12:39:20 -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
Feanil Patel
b1f01ed8fa feat!: Drop the legacy Tabs UI (#37557)
This change drops the legacy studio custom pages UI aka. the tab edit
page.

This work is part of https://github.com/openedx/edx-platform/issues/36108

BREAKING CHANGE: The 'legacy_studio.custom_pages' waffle flag has been
removed and the code will work as if this flag is permanently set to
False.

Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-11-20 23:36:10 +00:00
Feanil Patel
d929cdb7fa feat!: Drop the legacy studio updates page. (#37544)
Remove the legacy studio updates page and its related artifacts. They
have been replaced by API and a new UI in the authoring MFE.

This cleanup is a part of https://github.com/openedx/edx-platform/issues/36108

BREAKING CHANGE: The 'legacy_studio.updates' waffle flag will no longer
be respected. The system will behave as if the flag is set to false
permanently.
2025-11-20 23:00:13 +00:00
Feanil Patel
5d0d60d426 feat!: Drop support for the legacy textbooks page. (#37545)
The legacy textbooks page has been replaced with an authoring MFE
equivalent.  We don't need to keep the old one around.

This work is part of https://github.com/openedx/edx-platform/issues/36108

BREAKING CHANGE: With this change the `legacy_studio.textbooks` waffle
flag will no longer be respected and the system will behave as if the
flag is always set to False.
2025-11-20 17:56:11 -05:00
Feanil Patel
1253831c52 Merge pull request #37561 from kiran1415/kiran/remove-unused-task-code
fix: removed unused task code
2025-11-20 11:17:13 -05:00
Chris Chávez
b9e5683b67 fix: Publish components/container in legacy libraries migration (#37644)
- Fix the issue described in https://github.com/openedx/frontend-app-authoring/issues/2626
- Publish components and containers after migrate
2025-11-18 17:20:28 +00:00
Muhammad Farhan Khan
f51343c871 refactor: move transcripts_utils from xmodule to video-config (#37600)
As part of the ongoing effort to deprecate and eventually remove xmodule,
we’ve started gradually migrating the necessary code files from xmodule
to more appropriate locations within the codebase.

Ticket: https://github.com/openedx/public-engineering/issues/445

Also: this tweaks importlinter ignores & add follow-up issue links

Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-11-14 18:26:35 +00:00
Chris Chávez
fcf03cc710 feat: get migrations info REST-API added [FC-0112] (#37558)
- Adds the get migrations info REST-API.
- Add missing title to CourseDetails population.
2025-11-14 17:38:40 +00:00
Muhammad Farhan Khan
7b953a5310 refactor: Introduce VideoConfig service, move video sharing methods in it
refactor: Introduce VideoConfig service, move video sharing methods in it
2025-11-11 17:59:36 +05:00
farhan
0cd62bf786 refactor: Introduce VideoConfig service, move video sharing methods in it 2025-11-11 12:55:02 +05:00
Kiran Chauhan
9fc8104051 Merge branch 'master' into kiran/remove-unused-task-code 2025-11-08 16:26:59 +05:30
Rômulo Penido
5ef6be4610 feat: add library migration list endpoint [FC-0112] (#37567)
This PR adds the `/api/modulestore_migrator/v1/library/:libraryId/migrations/courses/` endpoint, which returns all course migrations for a target library.
2025-11-07 11:01:35 -05:00
Navin Karkera
f2f0d87e9e fix: mark container as ready to sync if any child block is deleted
Before this fix, if only a component is deleted, then its parent blocks
were not marked as ready to sync.
2025-11-05 10:36:44 +05:30
Kiran Chauhan
3beddb6773 Merge branch 'master' into kiran/remove-unused-task-code 2025-11-04 00:14:30 +05:30
Tobias Macey
2179109bc2 Merge branch 'master' into arslan/fix-validation-api 2025-10-30 14:20:33 -04:00
Kyle McCormick
ec1d9593d9 fix: Document modulestore_migrator API and remove extra endpoints (#37565)
The OpenAPI docs (at /api-docs) for the modulestore_migrator app were missing
some info, had duplicated info, and had some incorrect info. This brings them
up to a state where they're accurate and should have all the info needed for
someone to integrate with the API. For example:

* We move the viewset class docstrings, which have the info needed for someone
  to POST correctly, into the actual POST handler method docstring. That way,
  they show up under that POST API endpoint rather than the GET API endpoint.
* We fix the target keys to be v2 keys instead of v1 keys.  We add detail on
  all the different migration options and why a user would want to specify
  them.
* We fix the docs for `parameters` field to explain that they are always
  a _list_ of parameter objects, even for non-bulk migration tasks.

This also removes confusing & unnecessary endpoints:

* POST /api/modulestore_migrator/v1/bulk_migration/cancel
* DELETE /api/modulestore_migrator/v1/migrations/<uuid>

Finally, it sorts this endpoint to be newest-first:

* POST /api/modulestore_migrator/v1/migrations

Fixes: https://github.com/openedx/edx-platform/issues/37566
2025-10-30 15:06:46 +00:00
Michael Roytman
1c44ca034e Merge pull request #37571 from edx/michaelroytman/COSMO2-729-exam-due-dates-self-paced
fix: incorrect LTI exam due dates for self-paced courses
2025-10-30 08:55:45 -04:00
Arslan Ashraf
b9d6a8c788 test: add test 2025-10-30 16:26:07 +05:00
Navin Karkera
2db3183958 feat: replace is_modified with downstream_customized field in upstream entity api and models (#37563)
This helps the caller to differentiate between the kind of local edits the downstream has and use it accordingly.
2025-10-29 22:22:01 +00:00
Michael Roytman
2c82f230c9 fix: incorrect LTI exam due dates for self-paced courses
These changes fix a bug in how LTI-based exam due dates are computed and written to the exams service. Prior to this change, an LTI exam due date was computed irrespective of the course pacing type. In certain cases, this caused incorrect due dates to be written to the exams service for LTI-based exams.

For example, if a course team initially develops a course as an instructor-paced course and sets a due date on an exam subsection, that subsection due date is written to the modulestore. If the course team subsequently changes that course pacing type to self-paced, then that due date remains in the modulestore to allow course teams to switch pacing types without erasing due dates. The impact of this is that, when the course is published, the exam subsection due date is written to the exams service as the due date, even though there are no static due dates in a self-paced course. Frequently, these due dates are in the past (e.g. for course reruns), so learners automatically cannot access exams. Even if the due date is manually corrected in the exams service, every course publish reverts the due date to the incorrect due date.

This change computes the due date of LTI-based exams as...
* the exam subsection due date if the course is instructor-paced, if the subsection has a due date; else None
* the course end date if the course is self-paced, if the course has an end date; else None

In order to correct any incorrect due dates, course teams should republish their courses.
2025-10-29 16:43:07 -04:00
Kyle McCormick
834cb9482d refactor: rename ModuleStore runtimes now that XModules are gone (#35523)
* Consolidates and renames the runtime used as a base for all the others:
  * Before: `xmodule.x_module:DescriptorSystem` and
            `xmodule.mako_block:MakoDescriptorSystem`.
  * After:  `xmodule.x_module:ModuleStoreRuntime`.

* Co-locates and renames the runtimes for importing course OLX:
  * Before: `xmodule.x_module:XMLParsingSystem` and
            `xmodule.modulestore.xml:ImportSystem`.
  * After:  `xmodule.modulestore.xml:XMLParsingModuleStoreRuntime` and
            `xmodule.modulestore.xml:XMLImportingModuleStoreRuntime`.
  * Note: I would have liked to consolidate these, but it would have
          involved nontrivial test refactoring.

* Renames the stub Old Mongo runtime:
  * Before: `xmodule.modulestore.mongo.base:CachingDescriptorSystem`.
  * After: `xmodule.modulestore.mongo.base:OldModuleStoreRuntime`.

* Renames the Split Mongo runtime, the which is what runs courses in LMS and CMS:
  * Before: `xmodule.modulestore.split_mongo.caching_descriptor_system:CachingDescriptorSystem`.
  * After: `xmodule.modulestore.split_mongo.runtime:SplitModuleStoreRuntime`.

* Renames some of the dummy runtimes used only in unit tests.
2025-10-29 15:46:07 -04:00
Arslan Ashraf
3602540bb3 fix: validation API for certificates 2025-10-29 14:13:44 +05:00
kiran1415
ce6255d1b8 fix: quality check failed : blank line 2025-10-28 09:14:43 +05:30
kiran1415
db947f10f0 fix: removed unused task code 2025-10-28 07:45:11 +05:30
Navin Karkera
8aaae4604a fix: index and entity link sync issues on parent block deletion (#37541)
Meilisearch index documents were not synced properly when any block with children blocks like units, subsections, sections etc. were being deleted as the `XBLOCK_DELETED` is only triggered for the deleted block.
This PR fixes it by deleting all index documents that contain the deleted block in its `breadcrumbs` field as only blocks that are children of this block will have it its breadcrumbs field.

Similarly, the entity links that store links between course and library blocks was not synced properly due to children `ContainerLinks` not being deleted.
2025-10-27 13:44:36 -05:00