Commit Graph

509 Commits

Author SHA1 Message Date
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
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
Nathan Sprenkle
6b0af90664 feat: add a default audio codec for the HLS video player (#37525)
This seems to reduce instances of audio garbling when switching levels during HLS video streaming.
2025-10-29 15:24:33 -04:00
Muhammad Anas
4afff6ef5c feat: shift progress calculation to backend, add never_but_include_grade (#37399)
This commit migrates the data calculation logic for the GradeSummary
table, which was previously in the frontend-app-learning.

This commit also introduces a new visibility option for assignment
scores: “Never show individual assessment results, but show overall
assessment results after the due date.”

With this option, learners cannot see question-level correctness or
scores at any time. However, once the due date has passed, they can
view their overall score in the total grades section on the Progress
page.

These two changes are coupled with each other because it compromises
the integrity of this data to do the score hiding logic on the front
end.

The corresponding frontend PR is: openedx/frontend-app-learning#1797
2025-10-22 10:15:42 -04:00
Ihor Romaniuk
900706b1e5 fix: improve styling of headers+lists in LMS+Studio (#34867) 2025-10-20 17:26:03 -07:00
Chris Chávez
3f5ac6ddbc fix: Update on_commit_changes_to of modulestore to check MySQL transaction [FC-0097] (#37485)
- `handle_update_xblock_upstream_link` is called asynchronously with celery. In `update_upstream_downstream_link_handler`, the xblock has the updated version, but when calling `handle_update_xblock_upstream_link` inside Celery, the xblock is outdated in a previous version, which is why the error occurs. This happens because `on_commit_changes_to` is executed before the MySQL transaction ends.
- Added `ImmediateOnCommitMixin` to be used in tests that need to call `on_commit_changes_to`. See https://github.com/openedx/edx-platform/pull/37485#issuecomment-3412979170  for more info
2025-10-20 17:02:04 -05:00
Navin Karkera
744cc87ffb feat: follow migrated legacy library content block (#37405)
* feat: show item bank ui for migrated legacy library content

* feat: migrate legacy content block to item bank block on view in studio

* fix: duplicate and copy issues

* refactor: migration location and add tests

* fix: lint issues

* fix: item bank and library content children view add button functionality

Newly added blocks from library in children view page of item bank block
and migrated library content block were not displayed automatically.

* fix: lint issues

* fix: lint issues

* feat: only migrate if same version of library is migrated

* refactor: migrate block on request

* fix: component reload on migration

* fix: tests

* refactor: comments and message wordings

* refactor: update alert text

* docs: add context

* fix: component links not being created on migrating legacy blocks

* fix: api docs and types

* refactor: use inheritance and specific parent method call

* fix: imports

* fix: api typing

* fix: upstream_version check

* refactor: rename variables

* refactor: parsing entity keys to usage_keys
2025-10-20 11:20:37 +05:30
Kyle McCormick
d91676fcb4 fix: Don't look for a custom Python ZIP in Content Libs V2 (#37500)
Python-evaluated problems were failing to render because they were trying to
invoke `course_id.make_asset_key` in order to obtain the asset key of the
custom Python ZIP file. Learning Core assets work differently (no asset keys,
etc.), and, furthermore, we haven't really thought though how and whether we
want to support custom Python ZIPs in libraries.

So, this fix punts on supporting Python ZIP files in libraries for now, but
enables rendering of advanced CAPA problems which don't rely on a ZIP. This
brings us to parity with Legacy Libraries, which didn't support assets at all
and thus didn't support Python ZIPs either.

Fixes: https://github.com/openedx/edx-platform/issues/37447
2025-10-17 17:29:26 -04:00
Feanil Patel
940e9e63d5 docs: Apply suggestion from @kdmccormick
Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-10-16 15:01:36 -04:00
Feanil Patel
e50d1cc83b feat: Drop the unused edit view template.
And update the studio-view function to raise a NotImplementedError since
we now rely on the authoring environment to provide the edit view of
this block.

Unfortunately, a copy of the template lives in the lms and relies on the
the underlying JS and CSS to render a tiny-mce editor in the instructor
dashboard. This means we can't remove the CSS and JS until we've dropped
the usage of it in the instructor dash.  The good news is, that the work
to replace the instructor dash is in progress so those assets should get
cleaned up soon.

The places where the JS and CSS is still being used are:

* lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html
* lms/djangoapps/instructor/views/instructor_dashboard.py
2025-10-16 15:01:36 -04:00
Feanil Patel
fc374e7dfa Merge pull request #37474 from openedx/fix-assert-dict-contains-subset-depr
fix: replace deprecated assertDictContainsSubset()
2025-10-14 13:42:51 -04:00
usamasadiq
8aa2970c51 fix: fix pycodestyle error 2025-10-13 22:53:37 +05:00
Muhammad Farhan Khan
19c9a340f9 chore: move sharing_sites module into video_configuration app 2025-10-13 18:45:59 +05:00
usamasadiq
8a2c451439 fix: replace deprecated assertDictContainsSubset() 2025-10-12 11:10:36 +05:00
farhan
dc074d57cd chore: Move sharing_sites into video_configuration app
- https://github.com/openedx/edx-platform/issues/37456
2025-10-10 17:25:39 +05:00
Navin Karkera
09e86e24b2 refactor!: use String field instead of Dict field to store top_level_downstream_parent_key (#37448)
* refactor!: use String field instead of Dict field to store top_level_downstream_parent_key

Since this is a new field no production instance should have this field
yet. Developers need to delete their old courses as this change will
raise error in all course pages.

* chore: add `top_level_parent` field in ComponentLink and ContainerLink admin

* refactor: use ":" as separator

* refactor: block key parsing and tests
2025-10-09 22:03:23 +05:30
Muhammad Farhan Khan
5c759f1e13 refactor: Update and migrate Video Block JS files into xmodule/assets
- Move Video Block JS files from xmodule/js/src/video/ to xmodule/assets/video/public/js/ 
- Update JavaScript files from  RequireJS to ES6 import/export
- test: Enable and fix Karma Js tests for Video XBlock (#37351)

---------

Co-authored-by: salmannawaz <salman.nawaz@arbisoft.com>
2025-10-07 19:01:50 +05:00
Kyle McCormick
0c77083e3a revert: fix: support parsing the pointer-tag OLX for external XBlocks (#37426)
This reverts commit d382721cf8,
which seems to break edx-platform's ability to load the content of externally-
defined xblocks (e.g. lti_consumer) from course exports.
2025-10-03 15:57:26 -04:00
M. Tayyab Tahir Qureshi
d382721cf8 fix: support parsing the pointer-tag OLX for external XBlocks (#37133)
Previously, the built-in XBlocks (problem, video, etc) could be parsed
from pointer tag syntax, but externally-defined XBlocks (drag-and-drop,
ORA, etc.) could only be parsed from inline syntax. This is because the
built-in blocks have special parsing logic, defined in XmlMixin,
which is not available to external blocks.

This PR shifts the pointer tag parsing "up a level" such that the parent
blocks parse the pointer tag, regardless of whether the child is built-in
or external:
* vertical (aka unit)
* split_test (aka content experiment)
* itembank (aka problem bank)
* library_content (aka randomized legacy library)

The following parent blocks still lack support for external pointer-tag children;
we will fix this in a follow-up PR:
* randomize
* all externally defined container blocks

Part of: https://github.com/openedx/XBlock/issues/823
2025-10-03 11:54:30 -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
ihor-romaniuk
763a83779c fix: add missing styles 2025-09-17 15:43:18 -03:00
ihor-romaniuk
30f23f30dc fix: visual and progress score display enhancement 2025-09-17 15:43:18 -03:00
ihor-romaniuk
5972b40b2f fix: styles for share video functionality of the video xblock 2025-09-17 14:31:12 -03:00
Navin Karkera
a11086ffac feat: allow editing imported text blocks (#37124)
* feat: allow editing html block imported from upstream

The modified field is left untouched in future sync while storing the
upstream values in hidden fields to allow authors to revert to upstream
version at any point.

* fix: sync downstream_customized field for copy-pasted modified block

* test: add more tests

* fix: lint issues

* test: copy paste

* feat: skip sync if html data is modified

* feat: update upstream fields only when modified

* refactor: use version_synced field to skip sync

* feat: edit title inplace for library source components

* fixup! feat: edit title inplace for library source components

* fix: edit title button style

* fix: test case

* fix: lint issue

* refactor: don't show different icon for modified upstream blocks

* Revert "refactor: use version_synced field to skip sync"

This reverts commit 8b784fff2f49b43702c952e7f955bd4048e8cc69.

* feat: only skip sync for modified blocks if updated as part of container

* refactor: update sync behaviour when synced individually and as part of parent

* feat: include ready to sync children info in downstream link get api

* test: fix failing tests

* fix: lint issues

* feat: new tests and update api to allow overriding modified fields in sync

* test: api changes

* refactor: edit options should be visible for individual imports

* docs: update api docs

* chore: remove old comments
2025-09-17 14:50:24 +05:30
Devasia Joseph
acbf50a7dd feat: add custom attributes to moniter export course task (#37314) 2025-09-03 10:13:21 +05:00
Mubbshar Anwar
4a27f9cbb5 fix: fix timezone for Django 5.2 (#37293) 2025-08-28 11:16:51 +05:00
Muhammad Anas
620f0ae0db fix: intermittent "utils attribute not found" issue in webpack_loader (#37109) 2025-08-26 11:12:48 -04:00
kshitij.sobti
0fbfc1cf54 feat: Use dropdown for units when more then 15
When dealing with subsections that have a lot of units, show a dropdown for
unit selection to simplify navigation.
2025-08-21 17:42:02 +05:30
Irtaza Akram
35adeafafd fix: Allow tests for Extracted & Builtin Annotatable XBlock (#36246)
Test Annotatable XBlock in both built-in and extracted modes to keep them in sync.

Related to: https://github.com/openedx/edx-platform/issues/34841
2025-08-15 11:44:04 -04:00
Irtaza Akram
bbfdce0f9a fix: Allow tests for Extracted & Builtin HTML XBlock (#36399)
Test HTML XBlock in both built-in and extracted modes to keep them in sync.

Related to: https://github.com/openedx/edx-platform/issues/36283
2025-08-15 11:42:30 -04:00
Chris Chávez
ec72dc7998 feat: Add top-level parent logic to Upstream/Dowstream links [FC-0097] (#37076)
- Adds the `top_level_parent_usage_key` to the `EntityLinkBase`
- This field is used to save the top-level parent of a component or container when it is imported into a course. Example: A unit with components imported into a course. The unit is the top-level parent of the components.
- Updates the `DownstreamListView` to return the top-level parents instead of downstream child, if this parent exists.
- Each time containers with children were synchronized, a new downstream block was created for each child instead of updating the existing one. This occurred because the `upstream_key` was incorrectly validated as an `Opaquekey` against a list of key strings. This was fixed by converting the `upstream_key` to a string before the verification. (see 34cd5a4781 and 29647831dc)
- Which edX user roles will this change impact?  "Course Author", "Developer".
2025-08-14 17:36:30 +00:00
Irtaza Akram
472801b774 fix: add resourcetemplate to xblock_mixins (#37184)
Add ResourceTemplates to XBLOCK_MIXINS so it’s applied to all CMS XBlocks at
runtime instead of being directly inherited. This keeps the Studio-only feature
in edx-platform (where it belongs), while still making it available to built-in
and extracted XBlocks.

When we extract built-in blocks from the platform, they will not be able to
inherit ResourcesTemplates directly; they will get it from XBLOCK_MIXINS. So,
we also needed to update a few template-related tests to use the mixed block
class (or an instance of it) rather than the unmixed base class, because the
unmixed base classes will soon be extracted and thus lack ResourceTemplates.

Related to https://github.com/openedx/edx-platform/issues/34827
2025-08-12 09:04:34 -04:00
salmannawaz
983cdf9274 Test PR | Enable Extracted Poll XBlock (#36566)
* chore: poll xblock extracted code enable PR
2025-08-12 16:17:10 +05:00
Muhammad Farhan Khan
4a9fc77ecb test: Allow for Extracted Word Cloud Block | Fix Test Cases (#35983)
Run tests for both the built-in and extracted WordCloud block.
The tests are mostly compatible with both versions of the block,
except for a few places where the XBlock framework and the
built-in XModule system differ which we've had to handle using
conditionals.

This moves us closer to enabling the extracted WordCloud block
by default and eventually removing the built-in block.

Part of: https://github.com/openedx/edx-platform/issues/34840
2025-08-08 11:22:26 -04:00
Taylor Payne
16d96565e3 refactor: move production defaults to common modules (#37045)
In the effort to simplify settings in edx-platform, as discussed in ADR 22 -
Settings Simplification, this PR brings some of the production defaults defined
in `lms/envs/production.py` and `cms/envs/production.py` up to
`openedx/envs/common.py` or `lms/envs/common.py` and `cms/envs/common.py` as
appropriate.

Bringing these defaults up from the `production.py` settings modules caused
changes in the rendered settings of the `test.py` modules, and so I have
settings to the `test.py` modules to bring the rendered settings back in line
with what is has been. I have not deeply looked at which settings are needed
for tests to pass or not, but just the differences between the rendered
settings between `master` and this branch.

ADR 22: https://github.com/openedx/edx-platform/blob/master/docs/decisions/0022-settings-simplification.rst
Fixes https://github.com/openedx/edx-platform/issues/36892.
2025-08-04 17:06:16 -04:00
Muhammad Qasim Gulzar
9bf923784f fix: Improve error for missing (Translate)CustomTagBlock template #35829 (#37013)
Fixes: https://github.com/openedx/edx-platform/issues/35829
2025-07-23 10:00:30 -04:00
Ram Chandra Bhavirisetty
c9912b2661 feat: remove mongodb_proxy in favor of MongoDB's built-in retryReads (#37011)
This PR removes the usage of the custom `mongodb_proxy` package from
edx-platform, replacing it with MongoDB's built-in retry functionality via
`retryReads=True`.

Changes:

* Removed all references to `mongodb_proxy.MongoProxy` from connection logic.
* Updated `connect_to_mongodb()` to always use `retryReads=True`.
* Uninstalled `openedx-mongodbproxy` from edx-platform requirements.

Fixes: https://github.com/openedx/edx-platform/issues/35210
2025-07-21 13:52:55 -04:00
Daniel Wong
89ae9e9571 fix: use import_string instead of get_storage_class to import the view class 2025-07-04 16:10:42 -06:00
Farhaan Bukhsh
2fe8b7a0c5 fix: Fixes auto_advance feature for video XBlock (#35200)
Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2025-06-24 03:26:00 -07:00
Muhammad Faraz Maqsood
b2c9dddb84 feat: get language from request user's preferences and sort according to it 2025-06-19 14:43:31 +05:00
Muhammad Faraz Maqsood
f86ea5cb07 fix: bson size error due to mongo aggregate func
fix below bson_obj document size error due to mongo aggregate function by calculating the count and using find instead of aggregate.
```
raise OperationFailure(errmsg, code, response, max_wire_version)
pymongo.errors.OperationFailure: BSONObj size: 19117457 (0x123B591) is invalid. Size must be between 0 and 16793600(16MB) First element: _id: null, full error: {'ok': 0.0, 'errmsg': 'BSONObj size: 19117457 (0x123B591) is invalid. Size must be between 0 and 16793600(16MB) First element: _id: null', 'code': 10334, 'codeName': 'BSONObjectTooLarge', '$clusterTime': {'clusterTime': Timestamp(1750073176, 2), 'signature': {'hash': b'\xd7\xdd\xf4\x7f\xe4\xcea\xa1\xa7P\xba\xab\xcb\x12\x7f1A$(\xb4', 'keyId': 7471973240714297345}}, 'operationTime': Timestamp(1750073176, 2)}
```
2025-06-19 14:43:31 +05:00