Commit Graph

339 Commits

Author SHA1 Message Date
Deborah Kaplan
68b052620a Merge branch 'master' into bleach#33209 2024-06-10 11:27:12 -04:00
ayesha waris
8b4adaf4bd fix: fixed creating post based on discussion restrictions settings (#34872) 2024-06-06 16:52:04 +05:00
Irtaza Akram
f7229e0aad chore: replace bleach with nh3 2024-05-28 13:02:16 +05:00
Emad Rad
4529041643 chore: cleanup
- rst heading definitions
- indirect hyperlinks and code-blocks for better readability
2024-05-25 18:08:25 +03:30
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
Braden MacDonald
749e18bcee fix: don't call signal handlers like XBLOCK_UPDATED before commit (#34800)
Co-authored-by: Yusuf Musleh <yusuf@opencraft.com>
2024-05-22 10:29:22 -07:00
Maria Grimaldi
33b8137763 refactor: rename minimum partition ID constant to be more generic (#34529)
Rename MINIMUM_STATIC_PARTITION_ID to MINIMUM_UNUSED_PARTITION_ID
so it's not confusing when used to generate IDs for static or dynamic
partitions.
2024-05-20 14:38:58 -04:00
Tim McCormack
20c082c33b feat: Remove direct New Relic references (use configured telemetry) (#34781)
Now that edx-django-utils can report to other telemetry backends, we need
to remove the direct newrelic references.
2024-05-13 17:10:46 +00:00
Kyle McCormick
15caa9746f refactor: Completely remove Blockstore (#34739)
Blockstore and all of its (experimental) functionality has been replaced with
openedx-learning, aka "Learning Core". This commit uninstalls the now-unused
openedx-blockstore package and removes all dangling references to it.

Note: This also removes the `copy_library_from_v1_to_v2` management command,
which has been broken ever since we switched from Blockstore to Learning Core.

Part of this DEPR: https://github.com/openedx/public-engineering/issues/238
2024-05-13 09:48:18 -04:00
Rodrigo Martin
61b2870dff feat(AU-1950): Match video CC to unit translation language (#34667)
* feat(AU-1950): Match video CC to unit translation language

* feat(AU-1950): Update doc string

* fix: make dest_lang optional param
2024-05-06 11:32:55 -03:00
Maria Grimaldi
809ffc3743 feat: connect teams with content groups using dynamic partition generator (#33788)
Implements the connection from the teams feature to the content groups feature. This implementation uses the dynamic partition generator extension point to associate content groups with the users that belong to a Team.

This implementation was heavily inspired by the enrollment tracks dynamic partitions.
2024-04-25 13:02:49 -04:00
Feanil Patel
6fb59639af fix: Remove deprecated getargspec call.
This function was removed by python 3.11 so update to the alternate
call that is the current recommended replacement.

https://docs.python.org/3.11/library/inspect.html#inspect.getfullargspec
2024-04-18 13:28:31 -04:00
Feanil Patel
87b9c759f0 fix: Provide a sequence to random.sample
The sample function used to automatically convert sets to sequences but
that is no longer supported starting in 3.11 so we have to do it
manually.

Reference: https://docs.python.org/3/library/random.html#random.sample
2024-04-18 13:28:30 -04:00
Kyle D. McCormick
3447cbcb90 chore: tweak tests to work with XBlock==3.0.0 2024-04-17 09:43:12 -04:00
Kyle D. McCormick
3c5e1f5769 chore: remove reference to deprecated HierarchyMixin
This has been a no-op for a long time anyway, since HierarchyMixin
has been explicitly mixed into XBlock for as long as I remember.

Ref: https://github.com/openedx/XBlock/issues/714
2024-04-17 09:43:12 -04:00
Stanislav Lunyachek
cfcd526d2b fix: Space around techers images on course about page 2024-04-10 23:14:01 +03:00
Chris Chávez
ddb407a3f2 feat: handle tags when importing/exporting courses (#34356) 2024-04-08 11:39:46 -07:00
Irtaza Akram
a1f08d85bd Merge pull request #34398 from openedx/xblock2
upgrade xblock==2.0
References:
- https://github.com/openedx/public-engineering/issues/15
- https://github.com/openedx/XBlock/pull/680
2024-04-08 14:30:38 +05:00
Bryann Valderrama
85620ec73c feat: add grading method support for problems with multiple attempts (#33911)
A new field in the Problem settings for choosing a Grading Method. Currently, the only Grading Method is the Last Score. From now on, when turning the feature flag on, the new grading methods available for configuration in Studio are:
- Last Score (Default): The last score made is taken for grading.
- First Score: The first score made is taken for grading.
- Highest Score: The highest score made is taken for grading.
- Average Score: The average of all scores made is taken for grading.
2024-04-04 14:04:25 -04:00
Irtaza Akram
d9458ceab8 fix: remove print statements 2024-04-04 16:15:56 +05:00
Irtaza Akram
49f5a4f1e3 fix: pylint and unit test 2024-04-04 16:06:26 +05:00
Irtaza Akram
682a80addd fix: review changes 2024-04-03 16:03:56 +05:00
Irtaza Akram
acc86dd3fd fix: review changes 2024-04-02 14:19:34 +05:00
Irtaza Akram
3faa773bb9 feat: add support for xblock 2 2024-04-01 16:02:06 +05:00
Kristin Aoki
9f734a7a5e feat: update youtube transcript fetch to allow all languages (#34436)
* feat: allow all languages

* feat: add youtube transcript import functions as drf
2024-03-29 08:28:18 -04:00
Kristin Aoki
6c54c8fd15 fix: infinite load for library content block view (#34412)
* fix: hide view button when block is not configured

* fix: remove script for load timer if no children or library

* fix: remove print message

* fix: NoneType error is tests
2024-03-25 11:04:16 -04:00
Maria Grimaldi
794c6781fa feat: return navigation disabled as sequence metadata (#34049)
Return navigation disabled as sequence metadata when Hide From TOC
is enabled, so the student cannot navigate to another sequences in
the course outline.
https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3853975595/Feature+Enhancement+Proposal+Hide+Sections+from+course+outline
2024-03-12 11:21:16 -04:00
ruzniaievdm
cd5c4c992b feat: [FC-0044] XBlock's children API as DRF (#34055)
* feat: XBlock's children API as DRF

* fix: 500 error appears if user adds a Content Experiment

* fix: wrap into try/except block getting icon for xblock (#2509)

* fix: wrap into try/except block getting icon for xblock

* fix: revision after review
2024-03-12 11:07:32 -04:00
IrfanUddinAhmad
8ea609f464 fix: removed waffle switch around oep-50 filter 2024-03-11 15:14:27 +05:00
Rômulo Penido
cb6801dbfd feat: paste tags when pasting xblocks with tag data (#34270) 2024-03-08 12:03:43 -08:00
Raymond Zhou
b4552850c5 fix: show answer should show correct answers (#34335) 2024-03-07 16:27:48 -05:00
David Ormsbee
8bb2f31ced docs: add pruning-related warning messages in MongoDB connection
We migrated the source of truth for what the active draft and published
versions of course and v1 library content are to the
SplitModulestoreCourseIndex Django model. But the contentpruning
code (structures.py) that was developed in tubular and will be moved to
edx-platform is not aware of this newer model, and still only pulls its
source of truth from MongoDB. So we *must* continue to do writes to
MongoDB, or the pruning code will start pruning live versions.

The longer term fix for this is to make the pruning code aware of
SplitModulestoreCourseIndex, which will be easier once it's moved into
edx-platform.
2024-03-04 10:06:20 -05:00
Maria Grimaldi
f544a4825d feat: make hide from TOC a visibility section setting (#33952)
Exposes the hide_from_toc xblock attribute so course authors can configure it as a section visibility option in Studio. Before this change, the Hide from TOC functionality was mainly used by OLX components. Hence, it wasn't available for configuration through the Studio UI. Still, its implementation existed in the platform and could be used by setting the attribute: hide_from_toc=true as part of the OLX definition.
Ref: https://openedx.atlassian.net/wiki/spaces/OEPM/pages/3853975595/Feature+Enhancement+Proposal+Hide+Sections+from+course+outline
2024-02-29 11:13:33 -04:00
David Ormsbee
86f1e5e8aa feat!: Switch v2 libraries to Learning Core data models (#34066)
This moves the Content Libraries V2 backend from Blockstore [1] over to
Learning Core [2] For high-level overview and rationale of this move, see
the Blockstore DEPR [3]. There are several follow-up tasks [4], most notably
adding support for static assets in libraries.

BREAKING CHANGE: Existing V2 libraries, backed by Blockstore, will stop
working. They will continue to be listed in Studio, but their content
will be unavailable. They need to be deleted (via Django admin) or manually
migrated to Learning Core. We do not expect production sites to be in
this situation, as the feature has never left "experimental" status.

[1] https://github.com/openedx-unsupported/blockstore
[2] https://github.com/openedx/openedx-learning/
[3] https://github.com/openedx/public-engineering/issues/238
[4] https://github.com/openedx/edx-platform/issues/34283
2024-02-22 16:38:05 +00:00
Yusuf Musleh
6e0bc66a77 feat: Serialize tag data in OLX for blocks (#34145) 2024-02-14 10:30:23 -08:00
salmannawaz
f76b6b4e10 Remove bok-choy reference (#34216)
* chore: remove bok-choy references
2024-02-14 09:42:08 -05:00
Régis Behmo
4daf452620 fix!: infinite growth of cache when auto eviction is disabled
See discussion here: https://github.com/overhangio/tutor/pull/984

This is a breaking change that will explicitely set the timeout of
course structure cache entries to 1 week, instead of being unlimited. If
you wish to revert to the former behaviour, you should set
`course_structure_cache["TIMEOUT"] = None`.

The course structure cache keys were previously set with an explicit
timeout of `None` which was overriding the cache default timeout of 2h.
This was OK in environments where the cache is configured with a maximum
memory limit and an automatic key eviction strategy. But in others (such
as Tutor), the course structure cache could grow infinitely.

It was agreed that course structure cache keys should be long-lived but
should respect the default cache structure timeout. Thus, we set here
the TTL to 1 week.

We can also configure Tutor to use a cache eviction policy. But that
means we need to set a `maxmemory` value in Redis. It's not possible to
set a value that will be appropriate for everyone:
- if it's higher than the total memory (e.g: in small instances), server
  will crash before the cache is filled.
- if it's too low (e.g: in large instances), the whole platform will abruptly
  slow down as many cache entries are suddenly evicted.

That question of whether Tutor should define a cache eviction policy is
still under discussion, but it can be resolved independently of this
change.
2024-02-14 08:28:37 -05:00
Lewis M. Kabui
4ee11d35c5 chore: Use preferred collection method delete_one (#34214)
`remove` method of Collection objects has been deprecated in favour
of either `delete_one` or `delete_many`.

This change will address 36 deprecation warnings that are generated from
test runs.

Co-authored-by: Lewis Kabui <lewisemm@users.noreply.github.com>
2024-02-14 15:09:41 +05:00
Paulo Viadanna
7d0139469a fix: youtube race condition when GTM loads (#33649) 2024-02-06 09:38:15 +10:30
Kyle D. McCormick
e8b60aef60 fix: move BlockKey and derived_key to avoid cyclical import
After we merged this PR: https://github.com/openedx/edx-platform/pull/33920
this error began popping up in logs:

    Unable to load XBlock 'staffgradedxblock'
    ....
    ImportError: cannot import name 'get_course_blocks' from
    partially initialized module 'lms.djangoapps.course_blocks.api'
    (most likely due to a circular import) ...

The root cause was the new imports of `derived_key` and `BlockKey` into
xmodule/library_content_block.py. Those new imports come from
xmodule/modulestore/store_utilities.py, which runs
`XBlock.load_classes()` at the module level, which fails because we are
still in the process of loading xmodule/library_content_block.

As a solution, we move both `derived_key` and `BlockKey` to
xmodule/util/keys.py. We could potentially move that file to opaque-keys
eventually, depending on how well we think that those concepts generalize.

Also:

* We rename the function from derived_key to derive_key, as
  functions should be verbs.
* We combine the first to parameters of derive_key (a source ContextKey
  and a source BlockKey) into a single parameter (a source UsageKey). In
  my opinion, this makes the function call easier to understand.
2024-01-16 09:37:40 -05:00
Omar Al-Ithawi
a5251cc705 feat: atlas pull for XBlock translations 2024-01-12 12:49:46 +03:00
connorhaugh
2b47b8a379 feat: make course -> lib import synchronous (#34030)
* feat: make course -> lib import synchronous

---------

Co-authored-by: Kyle McCormick <kyle@axim.org>
2024-01-09 15:54:02 -05:00
connorhaugh
efaef4510e fix: protect video transcript handler from scraper (#34017)
Web scrapers do annoying stuff like visit urls they shouldn't know about and cause xblock handlers to break.
I tested this by:
Making sure video transcripts worked as normal while logged in
making sure that I got no 500s in my logs while attempting to view it logged out.
2024-01-08 18:14:03 -05:00
Feanil Patel
5ec8737856 chore: Remove old datadog related settings.
Datadog was removed 6+ years ago but some settings and related keys got
left behind.  Get rid of them since we don't need them and also to
prevent people from assuming it's okay to hardcode datadog settings into
our codebase.
2023-12-14 12:17:37 -05:00
Kyle McCormick
140f85853d feat!: remove Content Libraries V2 index (#33888)
BREAKING CHANGE: Removes all code, tests, and settings related to
indexing of V2 (blockstore-backed) content libraries in elasticsearch.
This includes indexing of top-level library metadata as well as indexing
of library block metadata. Operators who enabled the experimental
Library Authoring MFE *and* the experimental ENABLE_CONTENT_LIBRARY_INDEX
feature may notice that sorting, filtering, and searching of V2
libraries and their blocks may now be slower and/or less powerful.
The ENABLE_CONTENT_LIBRARY_INDEX feature was already disabled by
default, so most/all operators (including edx.org) should not notice
any difference.

Removed settings include:

* FEATURES['ENABLE_CONTENT_LIBRARY_INDEX']
* ENABLE_ELASTICSEARCH_FOR_TESTS
* TEST_ELASTICSEARCH_USE_SSL
* TEST_ELASTICSEARCH_HOST
* TEST_ELASTICSEARCH_PORT

For rationale, see the updated "Status" section of:
./openedx/core/djangoapps/content_libraries/docs/decisions/0001-index-libraries-in-elasticsearch.rst
2023-12-07 14:57:31 -05:00
Brandon Bodine
ce2621642f fix: lint 2023-11-29 11:34:55 -07:00
Rodrigo Martin
d7482735c3 fix: hide feedback widget by default 2023-11-29 11:34:55 -07:00
Rodrigo Martin
8d02b8808f feat: rename 'video_uuid' to 'video_id' in AI translation request (#33787) 2023-11-28 20:56:42 -03:00
Awais Qureshi
9998dc58fe Upgrade pillow (#33769)
* build: upgrading pillow.
2023-11-27 13:45:59 +05:00
David Ormsbee
119bb46151 docs: create ADR for Wasm-based safe code execution (#33705) 2023-11-22 09:28:43 -05:00