Commit Graph

4383 Commits

Author SHA1 Message Date
Awais Qureshi
fe57074dab feat!: Remove django-admin default login (#29876)
* feat!: Remove django-admin default login
2022-03-01 17:38:36 +05:00
Carlos Muniz
37bf73ca50 refactor: Replace videosequence & problemset (#29905)
`videosequence` and `problemset` have been replaced with `sequential`.

`problemset` and `videosequence` are old-but-not-entirely-unused aliases to the `sequential` block type (in Studio-speak, "Subsection").
Since [these block types have been removed from the 6 courses that used them](https://openedx.atlassian.net/browse/DEPR-151?focusedCommentId=588197), this ticket removes the support for the `problemset` and `videosequence` block-types.

For more information, see ticket: [DEPR-151](https://openedx.atlassian.net/browse/DEPR-151)
2022-02-16 10:21:31 -05:00
Michael Terry
e81c4fe49d Merge pull request #29911 from openedx/mikix/more-old-mongo-test-cleanup
test: more Old Mongo removal from tests
2022-02-11 15:10:45 -05:00
Michael Terry
b905de757b test: more Old Mongo removal from tests
Convert more tests from MONGO_AMNESTY to SPLIT modulestores.

This is in preparation for just wholesale denying access to Old
Mongo, so I either converted tests to split or just deleted some
test variants that were Old Mongo specific. (e.g. ddt lines)
2022-02-11 14:50:30 -05:00
ha-D
a4b36346c9 feat: options for excluding courses from search
Adds two new fields to the indexed course data:
- invitation_only
- catalog_visibility

Also adds two new settings:
`SEARCH_SKIP_INVITATION_ONLY_FILTERING`
`SEARCH_SKIP_SHOW_IN_CATALOG_FILTERING`

These settings can be used to filter out courses in the search results
based on their catalog visibility or based on whether they are
invitation-only courses.
2022-02-08 10:19:43 -08:00
Michael Terry
cb1bb7fa64 test: switch default test store to the split store
It's long past time that the default test modulestore was Split,
instead of Old Mongo. This commit switches the default store and
fixes some tests that now fail:
- Tests that didn't expect MFE to be enabled (because we don't
  enable MFE for Old Mongo) - opt out of MFE for those
- Tests that hardcoded old key string formats
- Lots of other random little differences

In many places, I didn't spend much time trying to figure out how to
properly fix the test, and instead just set the modulestore to Old
Mongo.

For those tests that I didn't spend time investigating, I've set
the modulestore to TEST_DATA_MONGO_AMNESTY_MODULESTORE - search for
that string to find further work.
2022-02-04 14:32:50 -05:00
Jillian Vogel
2173a98ef8 refactor: deprecates ModuleSystem properties for code sandboxing and cache
* Deprecates ModuleSystem can_execute_unsafe_code, get_python_lib_zip and cache properties
* Adds a new CacheService and SandboxService to provide the deprecated property
* Adds tests for the added CacheService and SandboxService
* Updates the ModuleSystemShim tests in Lms and Studio
2022-01-25 14:42:39 +10:30
Simon Chen
895cc10c1b fix: do not validate proctoring_provider if proctoring is disabled (#29803)
Co-authored-by: Simon Chen <schen@edx-c02fw0guml85.lan>
2022-01-21 12:45:43 -05:00
Kshitij Sobti
8fa962b1c8 feat: Add Studio UI to edit discussions toggle [TNL-7349] (#29720)
Adds a UI in studio to toggle discussions for a units if a course is using a discussion provider that supports it and per-unit discussion control is enabled.

Co-authored-by: Kshitij Sobti <kshitij@opencraft.com

Co-authored-by: Agrendalath <piotr@surowiec.it>
2022-01-19 11:21:32 +05:00
SaadYousaf
2c6989feab fix: correct studio sequence navigation bar with correct Next and Previous button actions 2022-01-12 16:20:05 +05:00
Jawayria
7f5b4a6a47 chore: removed 'wrong-import-order' from disabled imports (#29365)
* chore: removed 'wrong-import-order' from disabled imports
2022-01-06 19:14:51 +05:00
connorhaugh
4d834b977f feat: add flags to studio for editors work (#29536)
Description
In order to support ongoing editor work we need to open blocks in the course_authoring MFE from studio. We are gating that rollout behind a flag. This work does that for each of the new blocks, as well as provides urls to do so.

Supporting information
List of flags:
new_core_editors.use_new_text_editor
new_core_editors.use_new_video_editor
new_core_editors.use_new_problem_editor

Documentation of those flags:
Planned Removal Work: https://openedx.atlassian.net/browse/TNL-9370
2021-12-21 10:55:23 -05:00
Jillian Vogel
1974bacadd refactor: deprecates runtime.xqueue in favor of the XQueueService
* Deprecates ModuleSystem.xqueue property
* Adds new XQueueService to provide the deprecated property values to the LMS runtime
  (Studio does not need the XQueueService.)
* Adds tests for new service and updates the ModuleSystemShim tests in LMS and Studio
* Fixes existing tests.
2021-12-20 15:41:42 +01:00
Jillian Vogel
e378e42bfa refactor: deprecate user-related ModuleSystem attributes
Deprecates these ModuleSystem attributes in favor of the user service:

* user_location
* get_real_user
* get_user_role

Related changes:

* Stores the user location into DjangoXBlockUserService's optional attribute as request_country_code
* Uses the student model's user_by_anonymous_it to fetch the (cached) real user
* Updates affected tests
2021-12-20 15:41:25 +01:00
Julia Eskew
05ff94a993 feat: Change the text of the Studio button to add an HTML component
to read "Text" and display a text icon instead of a "</>" icon.
2021-12-16 11:59:10 -05:00
Jawayria
c320d5cd1b fix: replace 'django.conf.url()' with 'django.urls.re_path()' 2021-12-14 19:53:24 +05:00
Jawayria
770230c366 Merge pull request #29419 from edx/jawayria/bom-2606-26
chore: Applied lint-amnesty on cms/djangoapps/contentstore/views
2021-12-13 14:47:20 +05:00
Jawayria
e8ba3bb6d3 Merge pull request #29420 from edx/jawayria/bom-2606-27
chore: Applied lint-amnesty on cms/djangoapps/contentstore
2021-12-13 12:47:04 +05:00
Jawayria
e8e2c9d3b0 Merge pull request #29422 from edx/jawayria/bom-2606-23
chore: Applied lint-amnesty on cms/djangoapps/contentstore
2021-12-13 12:46:40 +05:00
Jawayria
59df46ab52 Merge pull request #29423 from edx/jawayria/bom-2606-24
chore: Applied lint-amnesty on cms/djangoapps/contentstore/tests
2021-12-13 12:46:16 +05:00
Jawayria
4fdadbe147 Merge pull request #29424 from edx/jawayria/bom-2606-25
chore: Applied lint-amnesty on cms/djangoapps/contentstore/views
2021-12-13 12:45:56 +05:00
Jawayria
d2e2a39008 chore: Applied lint-amnesty on cms/djangoapps/contentstore/views 2021-12-10 19:21:28 +05:00
Jawayria
0e63c20f64 chore: Applied lint-amnesty on cms/djangoapps/contentstore 2021-12-10 19:20:37 +05:00
Jawayria
83ee27abaf chore: Applied lint-amnesty on cms/djangoapps/contentstore 2021-12-10 19:17:29 +05:00
Jawayria
c42e356f95 chore: Applied lint-amnesty on cms/djangoapps/contentstore/tests 2021-12-10 19:16:43 +05:00
Jawayria
02ee9ae2cc chore: Applied lint-amnesty on cms/djangoapps/contentstore/views 2021-12-10 19:15:29 +05:00
Jawayria
59631c4825 chore: Applied lint-amnesty on cms/djangoapps 2021-12-10 19:14:36 +05:00
Alex Bender
40cf9d654e fix: import+export management commands 2021-12-09 10:01:34 -05:00
edX requirements bot
bb20b17428 Python Requirements Update (#29516)
* chore: Updating Python Requirements

* fix: fix pylint issues

Co-authored-by: Mohammad Ahtasham ul Hassan <mohammad.ahtasham@arbisoft.com>
2021-12-08 14:13:27 +05:00
Jillian Vogel
ad5ad72273 [BD-13] Deprecate ModuleSystem.render_template (fixed) (#29354)
* refactor: deprecates ModuleSystem.render_template

in favor of the added MakoSystem render_template method.

Related changes:
* Adds the MakoService to the StudioEditModuleRuntime,
  PreviewModuleSystem, LmsModuleSystem, and XBlockRuntime
* MakoService constructor takes a `namespace_prefix` string, so that the
  CMS PreviewModuleSystem can render to LMS templates, without needing
  the special render_from_lms helper method.
* ModuleSystem.render_template becomes a read-only property, so the
  constructor calls and test module systems are updated accordingly.
* Adds tests for the MakoService and module system shims.

(cherry picked from commit 457f959356)

* refactor: use MakoService.render_template to remove deprecation warnings

from block code.

(cherry picked from commit 8d62d337f5)

* refactor: use MakoService.render_template to remove deprecation warnings

from test code.

(cherry picked from commit 26b43465a4)

* test: Adds a test to verify the bug introduced by the previous changes

The AuthoringMixin is automatically added to all XBlocks (see
settings.XBLOCK_MIXINS), and AuthoringMixin.visibility_view expects the
"mako" service.

This test verifies the bug by testing the PureXBlock, which does not
require the "mako" service, and so fails when the visibility_view is
rendered.

* fix: AuthoringMixin needs mako service

which fixes the visibility_view for XBlocks which don't explicitly
require the mako service.

Also removes the unneeded class property _services_requested from
AuthoringMixin and StudioEditableBlock. This property is better provided
by the XBlockMixin class.
2021-11-29 14:42:52 -05:00
Kshitij Sobti
e8e8f4acbe feat!: Change the way tabs are ordered [BD-38] [TNL-9174] [BB-5076] (#29262)
* feat!: Change the way tabs are ordered
The change imposes a new ordering for tabs based on their new priority. When reordering tabs, this ordering will be maintained.

* fix: Apply suggestions from code review

Co-authored-by: Farhaan Bukhsh <farhaan@opencraft.com>

* fix: review feedback

Co-authored-by: Farhaan Bukhsh <farhaan@opencraft.com>
2021-11-22 11:17:30 +05:00
Ahtisham Shahid
78e115a05c fix: updated cache policy for import_status endpoint (#29342)
* fix: updated cache policy for import_status endpoint
2021-11-17 19:40:17 +05:00
Justin Lapierre
f6f3a79a15 Revert "[BD-13] Deprecate ModuleSystem.render_template" 2021-11-16 15:16:08 -05:00
Piotr Surowiec
4bf829dcbd fix: do not remove comments from XML during course import (#28557)
This is a follow-up to edx#1087, which reverted this change.
According to the PR comments, parsing strings with XML comments inside them was
causing errors. This does not seem to be the case anymore - these strings are
just hidden when the block is rendered, but they are not breaking XBlocks.
This also handles (ignores) the comments that could be added directly to the
LibraryContentBlock in the XML export by users.
2021-11-16 12:42:08 -05:00
Ahtisham Shahid
814efed637 feat: added logging in import status view (#29330)
* feat: added logging in import status view
2021-11-16 22:23:27 +05:00
Kaustav Banerjee
75919473f3 feat: Hide discussion block if non-legacy discussion provider is selected (#29259) 2021-11-16 11:43:06 +05:00
Kshitij Sobti
285e2c4f29 feat: Adds a new discussion topic configuration mechanism [BD-38] [TNL-8623] [BB-4968] (#29082)
* feat: Adds a new discussion topic configuration mechanism

The new discussion configuration system links discussion topics directly to the course structure. This change adds a new task that sends a discussion update signal if there are any changes to the course. This signal includes all the context needed to update the configuration of the course.

The handler for this new event will create a new entry for each unit that needs a topic in the database. In the future this will be used to see the topics in the course.

* fix: add support for marking a provider as supporting LTI

* fix: review feedback
2021-11-12 19:08:43 +05:00
Ned Batchelder
d9dd10dc97 style: code cleanups from Steven Burch (#29292)
* chore: update deprecated import from collections

* chore: remove outdated imports from markdown library

as it hasn't been supported since 2.0.3 and we're on 3.x.
This was deprecated at least as early as 2012!

* docs: add docstring and remove lint-amnesty to markdown plugin

* chore: remove deprecated etree import

* style: remove unnecessary-comprehension for sets

* style: resolve a number of amnestied pylint complaints

Co-authored-by: stvn <stvn@mit.edu>
2021-11-10 07:11:57 -08:00
Jillian Vogel
26b43465a4 refactor: use MakoService.render_template to remove deprecation warnings
from test code.
2021-11-09 14:03:54 +10:30
Jillian Vogel
8d62d337f5 refactor: use MakoService.render_template to remove deprecation warnings
from block code.
2021-11-09 14:03:54 +10:30
Jillian Vogel
457f959356 refactor: deprecates ModuleSystem.render_template
in favor of the added MakoSystem render_template method.

Related changes:
* Adds the MakoService to the StudioEditModuleRuntime,
  PreviewModuleSystem, LmsModuleSystem, and XBlockRuntime
* MakoService constructor takes a `namespace_prefix` string, so that the
  CMS PreviewModuleSystem can render to LMS templates, without needing
  the special render_from_lms helper method.
* ModuleSystem.render_template becomes a read-only property, so the
  constructor calls and test module systems are updated accordingly.
* Adds tests for the MakoService and module system shims.
2021-11-09 14:03:50 +10:30
David Ormsbee
15eca3ba59 Merge pull request #29190 from open-craft/jill/BD-13-user-service-fix
[FAL-2457] Let ModuleSystem use UserService
2021-11-08 09:18:10 -05:00
Farhaan Bukhsh
cfe75e95b9 feat: Add discussion_enabled for Unit (#28864)
For each unit discussion_enabled flag is added
so that each unit can be made discussable when needed.

Signed-off-by: Farhaan Bukhsh <farhaan@opencraft.com>
2021-11-08 16:17:07 +05:00
Jillian Vogel
cf1064616c refactor: deprecate ModuleSystem user attributes in favor of user service
The following ModuleSystem attributes are deprecated by this change, and should be pulled directly from the user service instead:

* anonymous_student_id
* seed
* user_id
* user_is_staff

Related changes:

* Removes the `user` and `anonymous_student_id` parameters from the ModuleService constructor.
* Stores anonymous_user_id in XBlockDjangoUserService's opt_attr
* Pulls out constants used by DjangoXBlockUserService opt_attr so they can be used in the platform code.
* LmsModuleSystem uses the user service created in wrapper function for runtime.publish to avoid requiring the user
  service to be "needed" by all XBlocks.
* LmsModuleSystem no longer checks for instances of XModuleDescriptor when deciding what kind of anonymous_user_id to
  provide:  all XModules are XBlocks, so this check is unnecessary.
* XBlockRuntime returns a user service when requested
* Adds tests for deprecated ModuleSystem attributes and changes to XBlockDjangoUserService.

(cherry picked from commit c41e7fb93a)
2021-11-02 18:24:06 +10:30
Kshitij Sobti
79cd0b1ef8 feat: Adds discussions settings for new discusions experience [BD-38] [TNL-8621] [BB-4854] (#29131)
* feat: Adds discussions settings for new discusions experience
This commit adds new discussions settings for the new discussions experience. These are stored in the course so they can be a part of course import/export flow.
These are also added to the discussions configuraiton API to allow MFEs to update the settings.
The discussions API is currently available via LMS, however that means it cannot save changes to the modulestore. This also adds the API to the studio config so it can now also be accessed from studio and be used to save course settings.

* fix: tests
2021-10-28 11:56:17 +05:00
Agrendalath
e633cc9c24 feat: support adding custom editors to Studio
This:
1. Introduces a variable for the Course Outline view in Studio.
   A custom theme can override it to add new editors.
2. Exports a function for creating new editor modals.
   A custom theme can use it to create editors without adding boilerplate code.
3. Adds a pluggable override for XBlock fields that are passed to the Studio.
   Without this, custom editors in Studio cannot retrieve values of XBlock fields.
2021-10-27 13:35:19 -04:00
David Ormsbee
5d0132305d Revert "feat: Adds discussions settings for new discusions experience (#28749)"
This reverts commit bb0c03123c.
2021-10-27 10:40:12 -04:00
Kshitij Sobti
bb0c03123c feat: Adds discussions settings for new discusions experience (#28749)
This commit adds new discussions settings for the new discussions experience. These are stored in the course so they can be a part of course import/export flow.
These are also added to the discussions configuraiton API to allow MFEs to update the settings.
The discussions API is currently available via LMS, however that means it cannot save changes to the modulestore. This also adds the API to the studio config so it can now also be accessed from studio and be used to save course settings.
2021-10-27 15:41:27 +05:00
Braden MacDonald
6c85668099 feat: write split modulestore's course indexes to Django/MySQL
Split modulestore persists data in three MongoDB "collections": course_index (list of courses and the current version of each), structure (outline of the courses, and some XBlock fields), and definition (other XBlock fields). While "structure" and "definition" data can get very large, which is one of the reasons MongoDB was chosen for modulestore, the course index data is very small.

This commit starts writing course indexes (active_versions) to both MySQL and Mongo, but continues to read from MongoDB only.

By moving course index data to MySQL / a django model, we get these advantages:
* Full history of changes to the course index data is now preserved
* Includes a django admin view to inspect the list of courses and libraries
* It's much easier to "reset" a corrupted course to a known working state, by using the simple-history revert tools from the django admin.
* The remaining MongoDB collections (structure and definition) are essentially just used as key-value stores of large JSON data structures. This paves the way for future changes that allow migrating courses one at a time from MongoDB to S3, and thus eliminating any use of MongoDB by split modulestore, simplifying the stack.
2021-10-26 10:06:52 -07:00
M. Zulqarnain
e54fb5f76e feat: New codemods on CMS (#28768) 2021-10-25 12:59:54 +05:00