Commit Graph

549 Commits

Author SHA1 Message Date
salmannawaz
d20b87b180 Discussion service to enable permission and access provider (#37912)
* chore: discussion service to enable permission and access provider
2026-02-11 19:37:16 +05:00
Navin Karkera
8ca70db552 refactor: xblock api upstream info and course details api (#37971)
- Returns top parent key instead of boolean in upstream info api
- Adds edited_on raw time in course outline api
- Adds has_changes to course details api
2026-02-09 23:09:06 +00:00
Peter Pinch
4df49fa87e Merge pull request #37955 from mitodl/marslan/9962-library-v1-legacy-problem
fix: blank_common.yaml added back to support library_v1 problems
2026-01-29 08:39:45 -05:00
Irtaza Akram
8b5a22ea3a fix: deprecate enable_grading_method_in_problems (#37811) 2026-01-29 12:11:51 +05:00
Muhammad Arslan Abdul Rauf
f3df14725e fix: blank_common.yaml added back to support library_v1 problems 2026-01-28 18:03:33 +05:00
Pradeep
56cdab958a feat: upgrade hls.js to version 1.6.15 and update related imports & refs (#37936) 2026-01-27 11:55:03 -05:00
Irtaza Akram
5b1951228e refactor: Move score_render to lms/grades (#37884)
* fix: move score_render to lms
2026-01-21 17:13:33 +05:00
Irtaza Akram
592153fe06 fix: replace sandbox class reference (#37876) 2026-01-21 17:13:14 +05:00
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
M. Tayyab Tahir Qureshi
a6c3c3236d chore: make the tests run for both BuiltIn and Extracted LTI Blocks (#36020) 2026-01-19 16:07:06 +05:00
Muhammad Arslan Abdul Rauf
0b7a543164 test: update tests related to deleting draft xblock 2026-01-14 21:41:30 -05:00
Muhammad Arslan Abdul Rauf
3815286acb fix: try deleting the XBlock from draft-branch if not in published 2026-01-14 21:41:30 -05:00
salmannawaz
af55715eba chore: convert mako template into django template 2026-01-12 11:57:34 +05:00
Tarun Tak
f841763640 chore: use zoneinfo instead of pytz 2026-01-09 11:43:33 -05:00
Muhammad Arslan
7e72ec2778 fix: race condition in shared runtime services (#37825)
There is a singleton SplitMongoModuleStore instance that is returned
whenever we call the ubiquitous modulestore() function (wrapped in a
MixedModuleStore). During initialization, SplitMongoModuleStore sets
up a small handful of XBlock runtime services that are intended to be
shared globally: i18n, fs, cache.

When we get an individual block back from the store using get_item(),
SplitMongoModuleStore creates a SplitModuleStoreRuntime using
SplitMongoModuleStore.create_runtime(). These runtimes are intended to
be modified on a per-item, and later per-user basis (using
prepare_runtime_for_user()).

Prior to this commit, the create_runtime() method was assigning the
globally shared SplitMongoModuleStore.services dict directly to the
newly instantiated SplitModuleStoreRuntime. This meant that even though
each block had its own _services dict, they were all in fact pointing
to the same underlying object. This exposed us to a risk of multiple
threads contaminating each other's SplitModuleStoreRuntime services
when deployed under load in multithreaded mode. We believe this led to
a race condition that caused student submissions to be mis-scored in
some cases.

This commit makes a copy of the SplitMongoModuleStore.services dict for
each SplitModuleStoreRuntime. The baseline global services are still
shared, but other per-item and per-user services are now better
isolated from each other.

This commit also includes a small modification to the PartitionService,
which up until this point had relied on the (incorrect) shared instance
behavior. The details are provided in the comments in the
PartitionService __init__().

It's worth noting that the historical rationale for having a singleton
ModuleStore instance is that the ModuleStore used to be extremely
expensive to initialize. This was because at one point, the init
process required reading entire XML-based courses into memory, or
pre-computing complex field inheritance caches. This is no longer the
case, and SplitMongoModuleStore initialization is in the 1-2 ms range,
with most of that being for PyMongo's connection setup. We should try
to fully remove the global singleton in the Verawood release cycle in
order to make this kind of bug less likely.
2026-01-08 10:33:04 -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
d29b0473f4 fix: align pylint fixes in edx-platform Problem XBlock with extracted xblocks-contrib/problem (#37758)
* fix: pylint issues for problem xblock
2026-01-07 16:39:11 +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
Irtaza Akram
fd33d80fb7 fix: autoformat problem block template files using djlint (#37760) 2026-01-06 17:55:30 +05:00
Irtaza Akram
87bf1003b7 fix: remove settings.DEBUG from problem block (#37812)
* fix: remove settings.DEBUG from problem block
2026-01-06 17:51:50 +05:00
David Ormsbee
1d9ca333cf fix: correct upstream field for migrated libraries (#37804)
This is to fix an issue in the following common migration situation:

1. An existing course references content in a legacy content library.
2. The legacy content library is migrated to the new library system.
3. The user clicks on "Update reference" from the Randomized Content
   Block in the course.

This action is supposed to update the children of the
LibraryContentBlock (usually ProblemBlocks) so that the "upstream"
attribute is set to point at the UsageKeys of the content in the new
libraries they were migrated to. What was happening instead was that the
upstream entries for these child blocks were left blank, breaking the
upstream/sync connection and making it so that the courses did not
receive any updates from the migrated libraries.

There were two issues:

1. get_forwarding_for_blocks() was being called with the child UsageKeys
   in the course, when it should have been called with the v1 library
   usage keys instead (since those are the things being forwarded).
2. We were checking that the target_key was a v2 Library key, but really
   the upstream target_key is supposed to be a LibraryUsageLocatorV2,
   i.e. the key of the specific piece of content, not the library it
   ended up in.

Note on testing:

Although there were unit tests for the migration of legacy content
libraries, there were not any unit tests for the migration of legacy
library *blocks*.

This commit adds a minimal test, which would have caught the bug we're
fixing. It would be good to add more comprehensive testing unit testing
for this part of the migration flow.

---------

Co-authored-by: Kyle McCormick <kyle@axim.org>
2026-01-05 16:35:31 -05:00
Irtaza Akram
50a0691a8a fix: depr enable_xblock_xml_validation (#37810) 2026-01-05 13:35:29 +05:00
salmannawaz
b2376c5f7c chore: use html block base for about, statictab,courseinfo blocks 2026-01-01 16:42:58 +05:00
Muhammad Farhan Khan
b94ccde7b4 refactor: Update VideoConfigService get_transcript method (#37809)
Update VideoConfigService get_transcript method
Update method for the bumper videos
2025-12-30 11:59:48 +05:00
Muhammad Farhan Khan
360a97fdd3 refactor: Move available_translations into VideoConfigService (#37808)
This moves edx-platform-specific logic out of the VideoBlock,
in preparation for the VideoBlock extraction:
openedx#36282
2025-12-26 18:56:57 +05:00
farhan
3c9e1a90de refactor: Move upload/delete transcript int video_config service
This moves edx-platform-specific logic out of the VideoBlock,
in preparation for the VideoBlock extraction:
https://github.com/openedx/edx-platform/issues/36282
2025-12-23 20:44:14 +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
277481f741 chore: remove unused/legacy translation method from video block
Remove unused/legacy translation method from video block
2025-12-22 17:57:52 +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
farhan
2688000c07 chore: more cleanup 2025-12-17 16:20:53 +05:00
farhan
1208d6c1f6 chore: remove unused/legacy translation method from video block 2025-12-17 14:06:32 +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
M. Tayyab Tahir Qureshi
24cb3cf9f5 refactor: enable the Extracted Annotatable, Poll XBlocks
Enabled the Extracted Annotatable, Poll XBlocks 

---------

Co-authored-by: farhan <farhan.khan@arbisoft.com>
2025-12-16 18:22:57 +05:00
Leonardo Beroes
70ea641c99 feat: Improve robust score rendering with event-based architecture
This commit implements a comprehensive solution for test score integration in the
enhancement system along with improvements to the score rendering mechanism. Key
changes include:

- Add event handler for rendering blocks with edx-submissions scores
- Implement event-based mechanism to render XBlocks with scoring data
- Create signal handlers in handlers.py to process external grader scores
- Develop specialized XBlock loader for rendering without HTTP requests
- Add queue_key propagation across the submission pipeline
- Register submission URLs in LMS routing configuration
- Add complete docstrings to score render module for better code maintainability
- Add ADR for XBlock rendering with external grader integration
- Add openedx-events fork branch as a dependency in testing.in
- Upgrade edx submission dependency

These changes support the migration from traditional XQueue callback HTTP requests
to a more robust event-based architecture, improving performance and reliability
when processing submission scores. The included ADR documents the architectural
decision and implementation approach for this significant improvement to the
external grading workflow.
2025-12-15 09:01:40 -05:00
Irtaza Akram
99c6e901d9 Convert Problem Block Mako Templates to Django Templates (#37570)
* fix: convert mako to django templates for problem block

* fix: pylint issues
2025-12-09 19:29:06 +05:00
Irtaza Akram
c3e85426cb Autoformat Problem XBlock Source Files for Consistency (2/2) (#37487)
* fix: run prettier on problem block code

* fix: codeql issues
2025-12-08 20:01:42 +05:00
Irtaza Akram
1945b12769 Autoformat Problem XBlock Source Files for Consistency (1/2) (#37476)
* fix: run formatter black and isort

* fix: linting, pydocstyle, xsslint and security issues
2025-12-05 18:31:45 +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
Stanislav Lunyachek
0d6c8339b1 fix: Video Xblock - position dropdown menus relative to control bar height 2025-12-03 14:22:40 -03:00
Muhammad Faraz Maqsood
0481d9a0b1 fix: accessibility issue on video transcripts (#37587)
This commit fixes accessibility issue for video transcripts as when a
video component's SRT file has an empty line, the transcript has an
empty link that is still interactive.

Empty links should not be interactive and should be hidden from
keyboard users as it takes extra click for them when an empty line
occurs in the transcript.

Co-authored-by: Muhammad Faraz  Maqsood <faraz.maqsood@A006-01130.local>
2025-11-26 11:17:48 -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
Muhammad Waleed
7671c08573 feat: Add user email replacement in HTML block data rendering (#37580) 2025-11-24 18:50:54 +05:00
salmannawaz
d516736482 refactor: Convert BuiltIn Video Block's html from mako to django template (#37509)
Closes: https://github.com/openedx/public-engineering/issues/427
2025-11-18 10:59:11 -05:00
Muhammad Farhan Khan
a50ab7d75f chore: Move waffle flags, configs (used in video block) to video service
Merge pull request #37631 from openedx/farhan/add-waffle-flags
2025-11-17 17:52:29 +05: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
farhan
0cd62bf786 refactor: Introduce VideoConfig service, move video sharing methods in it 2025-11-11 12:55:02 +05:00
salmannawaz
7f0375b6b9 Remove branding related code from video xblock. (#37491)
* chore: remove branding related code from video_block class as it is stop being used, we have plan to remove the specialized VIDEO_CDN_URL in the next phase as after removing URL nothing will reference the branding code so we're removing it first.
2025-11-01 09:22:45 +05:00
Navin Karkera
72dac75710 fix: lgeacy library block child.save fails in production instance while migrating (#37573)
The child.save() call while migrating legacy library block to library version 2 fails with `InvalidScopeError` due to presence of `LmsFieldData` in` _bound_field_data` field. Removing this call does not seem to have any adverse affect.
2025-10-30 14:53:55 +00:00
Kyle McCormick
b033b337a2 docs: Fix types in OldModuleStoreRuntime comments
Just a small find+replace mistake from 
834cb9482d
2025-10-29 15:49:29 -04:00