Commit Graph

55 Commits

Author SHA1 Message Date
Sagirov Eugeniy
8f88422c4a test: prepare tests for removing support for children in Old Mongo 2022-10-28 11:43:20 -04:00
Usama Sadiq
4734f9f16e fix: bump pylint version (#31084) 2022-10-27 12:19:09 +05:00
Navin Karkera
a959c5d35f fix: preview mode navigation previous button (that uses legacy UI)
Legacy UI: Previous button should use prev_url if it in first
position. In studio UI, it should always use prev_url. To make this
possible we checking length of contents which is always zero for studio
and more than 0 for legacy UI.
2022-10-25 17:23:10 +02:00
Sagirov Eugeniy
3f3d0d25d8 feat!: Remove inheritance-related code from Old Mongo 2022-10-24 11:58:44 -04:00
Piotr Surowiec
39d9c2f748 Merge pull request #31159 from open-craft/maxim/clean-up-htmlsnippets
[BD-13] refactor: Clean up HTMLSnippet
2022-10-20 16:01:14 +02:00
Matt Hughes
b8fee69340 fix: remove noisy log 2022-10-18 15:28:50 -04:00
Maxim Beder
0919fc7dab refactor: add js_module_name attribute to MakoTemplateBlockBase
In the previous commit `js_module_name = None` was removed from
HTMLSnippet class, because it's not being used by this class, or the
classes that inherit from it. But `js_module_name` is used in
MakoTemplateBlockBase.

Not all classes that inherit from MakoTemplateBlockBase define this
attribute, since the same classes inherit from HTMLSnippet class, which
used to provide a fallback for this attribute. To prevent
`AttributeError`, defining the default value of `None` in
MakoTemplateBlockBase.
2022-10-17 19:25:50 +02:00
Maxim Beder
e0330cf418 refactor: clean up HTMLSnippet
Remove code that is no longer needed after conversion of all the
XModules to standard XBlocks.
2022-10-15 14:27:58 +02:00
Kristin Aoki
cb51735333 feat: add thumbnail field to video xblock fields 2022-10-12 15:40:39 -04:00
Muhammad Adeel Tajamul
e96102b2f1 feat: removed discussion sort options from advanced settings (#30963)
Co-authored-by: adeel.tajamul <adeel.tajamul@arbisoft.com>
2022-09-30 11:42:59 +05:00
Piotr Surowiec
fcb594d635 Merge pull request #30715 from open-craft/agrendalath/bd-13-deprecate_course_id
refactor: deprecate course_id from ModuleSystem [BD-13]
2022-09-26 14:23:11 +02:00
UsamaSadiq
897cb3617f refactor!: delete common/lib and related usages 2022-09-22 14:16:34 +05:00
Agrendalath
1afb32c775 fix: move service initialization from LMS runtime init to module render 2022-09-21 19:05:03 +02:00
Agrendalath
dd97c74fde refactor: deprecate course_id from ModuleSystem
This attribute is already deprecated for XBlocks in favour of directly
retrieving it like `block.scope_ids.usage_id.context_key`.

This commit also removes some redundant logging code which was omitted in the
Datadog removal in #19420.
2022-09-21 18:53:45 +02:00
Agrendalath
99042f6282 refactor: remove deprecated runtime.course_id from Timed Exams
We will use `context_key` instead.
2022-09-21 18:52:28 +02:00
Agrendalath
98bb30dcd8 refactor: remove deprecated runtime.course_id from VideoBlock
We will use `context_key` instead.
2022-09-21 18:52:27 +02:00
Agrendalath
086e6515ac refactor: use SandboxService while generating CAPA responses report 2022-09-21 18:52:27 +02:00
Agrendalath
668683559b refactor: deprecate static_url argument from ModuleSystem
This argument was officially used only by the ProblemBlock.
If you need to get the base URL for static assets in your XBlock, please use
`settings.STATIC_URL` directly, instead of `runtime.STATIC_URL`.
2022-09-21 18:28:44 +02:00
Sagirov Evgeniy
42246c858d feat!: remove code related to Old -> Split migration (#30955)
This commit removes code that was used to copy Old Mongo courses into
new Split Mongo courses. This includes both the migrate_to_split
management command, as well as the backend code that would be invoked
to re-run Old Mongo courses as Split courses using Studio (the UI for
this was already removed in b429e55c).

This is a part of the Old Mongo removal effort tracked in:
  https://github.com/openedx/public-engineering/issues/62
2022-09-19 10:51:40 -04:00
Sandeep Dubey
51b5e624b3 feat: upgrade TinyMCE v4.0.20 to TinyMCE v5.5.1 (#30335)
Co-authored-by: Arunmozhi <arunmozhi@opencraft.com>
2022-09-19 12:43:19 +02:00
Piotr Surowiec
baeb64d13e Merge pull request #30811 from open-craft/0x29a/bb6442/remove_field_data
refactor: remove `field_data` usage by all `DescriptorSystem` subclasses [BD-13]
2022-09-19 12:35:57 +02:00
Sarina Canelake
4a2f231302 fix: fix github url strings (org edx -> openedx) 2022-09-15 14:52:28 -04:00
Sagirov Evgeniy
b429e55cac feat!: remove Studio editing for Old Mongo Courses
This removes user-facing Studio edit support for Old Mongo courses
(courses that have a CourseKey of the format {org}/{course}/{run}).
This does not affect our normal courses, which have CourseKeys
starting with "course-v1:".

After this commit:

* Old Mongo courses will continue to appear on the Studio course
  listing page, but are not clickable.
* Any attempt to directly access an Old Mongo course in Studio via URL
  fail with a 404 error.
* Course certificates will still be available for Old Mongo courses.
* Old Mongo courses will continue to be returned by CourseOverviews
  and get_course_summaries() calls.

We decided against removing Old Mongo courses from the listing entirely
because that would require very expensive CourseOverviews query to
filter them out. Making that query more efficient would involve a
database migration to add appropriate indexing, which is something else
that we are looking to avoid. CourseOverviews are used everywhere in
the system, so we want to avoid changing how they work so that we can
minimize risk.

This is part of the Old Mongo Modulestore deprecation effort:
  https://github.com/openedx/public-engineering/issues/62
2022-09-14 10:53:33 -04:00
alangsto
92b60f11b2 feat: add lti proctoring provider option (#30950) 2022-09-08 13:53:23 -04:00
Kshitij Sobti
3cd3c60b59 feat: enable unit-level control over discussions by default (#30903)
This PR changes the default behaviour of the discussions experience by making the previous "unit-level
visibility" the default mechanism for configuring discussions.

Prior to this PR, under the new discussions configuration experience, all units would automatically get
assigned a discussion topic and have discussions enabled for them (other than units in graded or exam
subsections). However, if authors wanted they could enabled a custom visibility mode which would allow
toggling discussions on or off on a per-unit level.

This PR makes this custom visibility mode the standard behaviour (and eventually, only behaviour)
and enables discussion for all units by default. This replicates the behaviour that already existed,
however, now gives authors control over disabling discussions for individual units by default.

It also removes the ability to disable discussions for all units (while still keeping course-wide
discussions) enabled.
2022-09-07 16:41:17 +05:00
Navin Karkera
40180a688e [BD-38] fix: hide discussion xblock for openedx provider (#30845)
* fix: hide discussion xblock for openedx provider

* fix: test cases

* refactor: hide xblock is provider not legacy and add message in studio

* fix: lint issue

* refactor: update discussion block studio msg

* fix: test discussion xblock query number
2022-09-02 14:38:53 +05:00
Rebecca Graber
c1009b56f6 feat: emit COURSE_CATALOG_INFO_CHANGED signal on publish (#30805)
Implements https://github.com/openedx/edx-platform/issues/30682

Produce signal only once transaction for a course publish is
committed, and only for actual courses (not libraries).

- Use newer openedx-events version that has a fix for None datetime
  and that has CourseCatalogData without org, number.
- Add edx-event-bus-kafka -- specify recent version that drops
  confluent-kafka from explicit deps, fixes common auth settings, and has
  a multi-producer caching tweak.
- New functionality is behind toggle

As per https://github.com/openedx/openedx-events/issues/88 we're going to
try explicit dependencies on implementations for now, rather than solve
all the problems we'd encounter by using private dependencies.

Co-authored-by: Tim McCormack <tmccormack@edx.org>
Co-authored-by: Rebecca Graber <rgraber@edx.org>
2022-08-24 16:39:24 +00:00
Arunmozhi
6867d55364 feat: adds openedx-filter hook to the child blocks of VerticalBlock
This commit adds a openedx-filters hook to the VerticalBlock XBlock
before rendering of it's children. This allows Open edX plugins to
customize the presentation of specific blocks based on the context.
2022-08-20 13:09:10 +05:30
connorhaugh
dd1367823d Revert "feat: implement V2 libraries usage for library content block (#30615)" (#30872)
This reverts commit dcf1cc14b6.
2022-08-17 14:43:31 -04:00
Eugene Dyudyunov
dcf1cc14b6 feat: implement V2 libraries usage for library content block (#30615)
YT: https://youtrack.raccoongang.com/issue/EDX_BLND_CLI-87

- V2 libraries are available for selection in the Random Block edit modal;
- selected V2 library blocks are copied to the modulestore and saved as children of the Random Block;
- V2 library version validation works the same as for the V1 libraries (with possibility to update block with the latest version);
- filtering by problem type can't be done for V2 the same as for V1 because the v2 library problems are not divided by types;
- the problem type field is hidden for v2 libraries in the edit mode;
- unit tests added/updated.
2022-08-16 08:25:26 -04:00
Kristin Aoki
a210ffae38 feat: update template text for raw html editor 2022-08-15 11:12:53 -04:00
Leangseu Kim
719ddff238 fix: section.due datetime version issue 2022-08-11 13:53:11 -04:00
connorhaugh
6b6935b8f9 Revert "feat: add new template text for raw html editor" (#30843)
This reverts commit 95a13bff5d.
2022-08-10 15:17:20 -04:00
Kristin Aoki
95a13bff5d feat: add new template text for raw html editor 2022-08-09 14:42:31 -04:00
0x29a
62ad1ffcc7 refactor: remove deprecated field_data usages by MakoDescriptorSystem 2022-07-30 19:50:35 +02:00
0x29a
f1004fc34a refactor: remove deprecated field_data usages by InMemorySystem 2022-07-30 19:50:20 +02:00
0x29a
4f5279d214 refactor: remove deprecated field_data usages by ImportSystem 2022-07-30 19:50:07 +02:00
0x29a
7419b4c2db refactor: remove deprecated field_data usages by CachingDescriptorSystem 2022-07-30 19:49:48 +02:00
0x29a
803ad04ab0 refactor: remove deprecated field_data usages by DummySystem 2022-07-30 19:49:37 +02:00
Kyle McCormick
cd18f48ad7 docs: link to sub-project dissolution ADR in xmodule README (#30794)
Co-authored-by: Robert Raposa <rraposa@edx.org>
2022-07-28 12:32:58 -04:00
Mohammad Ahtasham ul Hassan
bd90ebde7b fix: unpin numpy (#30761) 2022-07-28 15:56:03 +05:00
Muhammad Soban Javed
d053bba952 Revert "Revert "refactor: move common/lib/capa/capa to xmodule/capa" (#30762)"
This reverts commit 4463ee751d.
2022-07-27 15:36:08 +05:00
Braden MacDonald
82ec7159a8 fix: disable Mongo collision detection when MySQL stores course indexes (#30746)
We have found that for many courses on edx.org, the "current version"
of the course that's stored in MongoDB doesn't match what's stored in
MySQL. Although this doesn't directly cause any problems as the
"current version" (course index) is not normally read from MongoDB,
it's not supposed to happen - and it can cause problems if some other
extra-platform components (like a pruner script) read the course
indexes out of MongoDB.

We still aren't sure what can cause MongoDB and MySQL to get out of
sync in the first place; this won't necessarily fix that issue. What
this does fix is a bug that seems to be: once they get out of sync,
they stay out of sync and mongo will stop receiving writes.

The Mongo code in most cases will only write a new record if the
"current" record's last_update matches the last_update value before
the change was made. e.g. last_update is "10am", user makes a change,
Mongo gets updated only if the current row's last_update is still
"10am". Otherwise it's considered a "collision" and silently ignored.

Once Mongo and MySQL somehow become out of sync, they may stay out of
sync because any new writes will have a last_update value read from
MySQL, which is newer than the value in MongoDB, so the MongoDB writes
will all be rejected as "collisions".

This should fix the issue by making mongo writes always match the MySQL
writes, instead of letting the Mongo code "decide on its own" when to
write course index updates or not.
2022-07-25 11:26:01 -04:00
Muhammad Soban Javed
4463ee751d Revert "refactor: move common/lib/capa/capa to xmodule/capa" (#30762) 2022-07-21 18:22:15 +05:00
Muhammad Soban Javed
06064b237b Merge pull request #30403 from openedx/iamsobanjaved/BOM-2582-move-common-lib-capa
refactor: move common/lib/capa/capa to xmodule/capa
2022-07-21 16:27:47 +05:00
Keith Grootboom
ed81774569 feat: added new setting CUSTOM_RESOURCE_TEMPLATES_DIRECTORY
This setting allows loading of Resource Templates from outside the
edx-platform codebase.

Operators will be able to add their own custom resource templates
without needing to fork the codebase.
2022-07-20 08:44:34 +02:00
Soban Javed
9eba9f983a refactor!: move common/lib/capa/capa to xmodule/capa
As part of dissolving our sub-projects in edx-platform, we are moving this package under the xmodule directory.
We have fixed all the occurences of import of this package and also fixed all documents related references.
This might break your platform if you have any reference of `import capa` or `from capa import` in your codebase or in any Xblock.

Ref: https://openedx.atlassian.net/browse/BOM-2582
2022-07-19 12:20:04 +05:00
0x29a
cf1a7c616a refactor: remove error_descriptor_class and NonStaffErrorBlock
It's safe to remove this because non-staff [1] users cannot access [2]
an `ErrorBlock`. We were able to reproduce this with and without this commit
with the following results:
1. Staff users were seeing the `ErrorBlock`.
2. Non-staff users were getting an empty `<div class="vert-mod"></div>`.

In theory, error blocks should be hidden in the Learning MFE because of this
option [3]. However, when we manually set `hide_access_error_blocks` to
`False`, we kept getting identical results (with and without this commit), so
it looks that the removal `NonStaffErrorBlock` was just omitted at some point.

[1] a4ec4c1b8e/lms/djangoapps/courseware/access.py (L419-L436)
[2] a4ec4c1b8e/lms/djangoapps/courseware/access.py (L150-L151)
[3] 92ca176fde/lms/djangoapps/courseware/views/views.py (L1547-L1551)
2022-06-30 15:53:39 +02:00
0x29a
0f858835f1 refactor: delete ModuleSystem's file_data property
There are many `field_data` usages in the platform. Let's categorize them and determine,
which are related to this change and in what way.

- ModuleSystem's argument. This is what we're removing.
- Runtime.field_data. Directly related, as Runtime is ModuleSystem's superclass.
  Analysis below this list is centered around this.
- XBlock.field_data. Not related anymore. Runtime.construct_xblock was passing
  runtime's field_data to the XBlock's constructor, but that was ~8 years ago.
- DescriptorSystem.field_data. Not related anymore. field_data has been removed
  from the constructor long time ago, but you still can see its ancestors
  instantiated with field_data=<value> here and there. It's important to note,
  that it has been added here in the first place, because field_data was required in Runtime.
- DummySystem, CachingDescriptorSystem, ImportSystem. Not related anymore.
  All these classes inherit MakoDescriptorSystem, which inherits DescriptorSystem itself.
  So, see the previous item.
- PreviewModuleSystem, TestModuleSystem, LmsModuleSystem — ModuleSystem's ancestors. Directly related.

Basing on that, the only necessary check is to search for ModuleSystem's ancestors using
`field_data` or `_deprecated_per_instance_field_data`. As there are no such cases, it's safe to remove `field_data`.

Co-authored-by: Paulo Viadanna <paulo@opencraft.com>
Co-authored-by: DubeySandeep <dubeysandeep.in@gmail.com>
2022-06-30 15:17:24 +02:00
Kshitij Sobti
8169aa99da fix: if pages and resources view is disabled, show all pages in studio (#30550)
In a previous PR #28686, the ability to see and enable/disable wiki and progress tabs was removed from studio along with the ability to re-order non-static tabs. The ability to toggle the Wiki tab was moved to the pages and resources section of the course authoring MFE. If that MFE is unavailable this means there is no way to show/hide the Wiki. This reverts some of the old changes if the pages and resources view is disabled.
2022-06-28 21:19:32 +05:00