Commit Graph

10423 Commits

Author SHA1 Message Date
Raymond Zhou
f3413fd767 fix: video page api error 2024-05-31 15:15:11 -04:00
Artur Gaspar
90fc5f8dbf feat: open new editors from non-unit Studio container page (#33575)
Make the edit button on a container page for a non-unit block
(i.e. an individual text, problem or video block) open the new
editor when the relevant flag is enabled.
2024-05-31 11:30:59 -04:00
Kristin Aoki
1ef4c0d7a2 fix: add missing end field (#34880)
* fix: add missing end field

* fix: lint and test errors
2024-05-31 09:42:53 -04:00
Kristin Aoki
38320f8433 feat: grading rest api for authoring api (#34854)
* feat: grading rest api for authoring api

* fix: doc string api path
2024-05-29 14:54:00 -04:00
Alison Langston
791e317085 feat: update timeout for course reindexing (#34866) 2024-05-28 15:31:05 -04:00
Feanil Patel
4085066fea Merge pull request #34417 from qasimgulzar/qasim/DEPR/git-issue-34342
[DEPR]: Remove Neo4J Support #34342
2024-05-28 10:25:33 -04:00
Muhammad Soban Javed
d8675f8a06 feat: add FrontendMonitoringMiddleware in lms and studio (#34823)
* feat: add FrontendMonitoringMiddleware in lms and studio

* chore: upgrade edx-django-utils to 5.14.1
2024-05-23 16:29:59 +05:00
Braden MacDonald
41fa96851f docs: fix minor typos in the meilisearch feature configuration (#34838) 2024-05-22 11:48:27 -07:00
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
David Ormsbee
be03938377 refactor: update to use Learning Core's new public API
This also bumps our openedx-learning dependency to 0.10.0 (the first
version with the new openedx_learning.api package).
2024-05-21 16:05:56 -04:00
Ahtisham Shahid
362899e797 fix: Added message to Course update notification in case of small text (#34819) 2024-05-21 13:31:41 +05:00
Jesper Hodge
e95d7e7e32 fix: libraries performance problem
This is an attempt to fix a performance problem on the libraries home page. When you go to studio home and click on the libraries tab, on prod it will be quick for admins but extremely slow for course instructors (> 12 seconds) and leads to timeouts. It grows with the number of libraries that are assigned to the instructor.

The Python code for the request to load libraries for a particular user goes through all existing libraries and then checks all of the user's roles for each library, which results in a complexity of O(l*r), l=libraries, r=roles. This PR improves the complexity to O(l).

The BulkRoleCache and RoleCache classes were using a python set to store all roles for a particular user. A user can have a large number of roles, and lookup speed of iterating through a set is slow (O(n)). Most roles don't have the same course id, however. So if you have the course id of the role you're looking for, we can use a dict of course ids that contain related roles. The number of roles per course id is negligible, so we arrive at a lookup speed of O(1) when looking up a user's roles that belong to a specific course id.

The BulkRoleCache now caches and stores user roles in a data structure like this:
    {
        user_id_1: {
            course_id_1: {role1, role2, role3},  # Set of roles associated with course_id_1
            course_id_2: {role4, role5, role6},  # Set of roles associated with course_id_2
            [ROLE_CACHE_UNGROUPED_ROLES_KEY]: {role7, role8}  # Set of roles not tied to any specific course or library. For example, Global Staff roles.
        },
        user_id_2: { ... }  # Similar structure for another user
    }

While this changes the data structure used to store roles under the hood and adds the new property `roles_by_course_id` to the RoleCache,
when initializing the RoleCache will store roles additionally in the previous data structure - as a flat set - in the `_roles` property accessible via `all_roles_set`. This establishes
backwards compatibility.

We are now storing roles twice in the RoleCache (in each of the two data structures), which means this takes twice as much memory, but only in the scope of a request.
2024-05-20 16:34:08 -04: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
David Ormsbee
4c0623bcbc fix: prevent setting user attributes from JWT in Studio
Open edX implements its a JwtAuthentication class in edx-drf-extensions
(in edx_rest_framework_extensions.auth.jwt.authentication). This class
updates the local User database entry to match certain values in the
token. It's used as a way to automatically provision and update users
with their LMS user information on other Open edX services like
ecommerce.

Since LMS and Studio keep the record of truth in its database tables,
they should *not* update their database user information based on the
JWT. Doing so would allow stale JWTs to incorrectly reset user values
after they had been changed in the LMS. This is done by having the
EDX_DRF_EXTENSIONS['JWT_PAYLOAD_USER_ATTRIBUTE_MAPPING'] setting be an
empty dictionary, and was set correctly for the LMS in its common.py env
settings module. Unfortunately, this was *not* being set for Studio.

This commit adds the same setting to Studio's common settings module.
Prior to this commit, it was possible for a stale JWT to reset user
attributes if the user hit a Studio API endpoint that used JWT for  auth
(e.g. endpoints used by the Course Authoring MFE). This opened up a
potential security issue where a global staff user (is_staff=True) that
had their global staff status removed (is_staff=False) could have up to
a one hour window in which they could use their stale-but-still-valid
global-staff JWT token to regain global staff status by calling a Studio
endpoint with their browser.
2024-05-17 10:01:10 -04:00
qasim.gulzar
48cdbce893 refactor: [DEPR]: Neo4J Support #34342 2024-05-17 18:55:16 +05:00
Raymond Zhou
0fd3bde79d fix: remove instructor info serializer validation (#34802) 2024-05-16 13:47:07 -04:00
Raymond Zhou
74a514518c fix: instructor info in course details api (#34760) 2024-05-13 12:47:22 -04:00
ABBOUD Moncef
3fa77ea44d feat: add a nontranslated status video field (#33939) 2024-05-13 09:58:01 -04: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
Glib Glugovskiy
4599e45b2e feat: emit passing status updated events for badging (#34749)
Introduce emission of the COURSE_PASSING_STATUS_UPDATED as well as CCX_COURSE_PASSING_STATUS_UPDATED events, that are groundwork for the new Credly integration and the future badging initiative.

Product GH ticket for tracking - openedx/platform-roadmap#280
2024-05-09 11:52:36 -04:00
Rômulo Penido
b42da7429f feat: Enable taxonomy/tagging feature in MFE by default (#34633)
* feat: make tagging feature enabled by default

* fix: use the correct flag for tagging enabled

* fix: make compatible with other changes from master

* fix: more compatibility fixes

* fix: show tag counts at all levels of the outline, not just units

* chore: typo

* test: fix counts in test suite now that tagging is on by default

---------

Co-authored-by: Braden MacDonald <braden@opencraft.com>
Co-authored-by: Yusuf Musleh <yusuf@opencraft.com>
2024-05-09 18:57:05 +05:30
Chris Chávez
6738faa8f7 feat: Avoid to close tag drawer when click outside (#34740) 2024-05-09 17:29:21 +05:30
Braden MacDonald
4c582e64bb feat: Always enable the "copy-paste units" functionality (#34742) 2024-05-09 17:20:56 +05:30
David Ormsbee
6308c968db refactor: always define CORS_ALLOW_HEADERS centrally
The LMS and Studio need to set values for CORS_ALLOW_HEADERS so that the
MFEs can work properly, since preflight requests will need to send over
extra headers. Prior to this commit, CORS_ALLOW_HEADERS was being
redefined in multiple places in edx-platform and again in Tutor's config
because it was only being conditionally set if ENABLE_CORS_HEADERS was
True (which was a policy setting). But CORS_ALLOW_HEADERS is application
logic in that the value is determined by what the view needs, and won't
vary by deployment.

By consolidating this to always be defined in the common.py files, we
make sure that deployment environments don't have to define it. An
example of where this bit us was when course import in the course
authoring MFE did not work because Tutor was using an outdated value for
this setting.

A followup to this would be to just rip out the ENABLE_CORS_HEADERS
setting entirely, and just always have it on. But that would benefit
from a little more discovery to make sure there's no weird use case that
still requires it to be False (maybe something in the test suite?).
2024-05-08 16:16:05 -04:00
Kaustav Banerjee
d43a2f73eb feat: default grade designations configurable from settings (#32406) 2024-05-08 01:14:03 +05:30
Yusuf Musleh
a3924f687b feat: Tag sections, subsections, and the whole course (#34690)
(In the legacy UI, if the 'new_studio_mfe.use_tagging_taxonomy_list_page' waffle flag is enabled)
2024-05-07 10:29:35 -07:00
Kyle D. McCormick
21a1235a28 revert: revert: build: finish replacing paver assets
This reverts commit 4c0284b87d.
2024-05-07 08:40:40 -04:00
Kyle McCormick
4c0284b87d Revert "build: finish replacing paver assets (#34554)" (#34700)
Reverts #34554, which causes compilation of edX.org's
legacy comprehensive theme to be skipped in their deployment pipeline.
We have not determined the precise cause yet, but it seems like the
compile_sass management command is not correctly getting the
list of comprehensive theme directories from Django settings.
2024-05-06 12:57:51 -04:00
Maria Grimaldi
b792222772 fix: add support to Group Configuration view for Teams partitions (#34643) 2024-05-06 11:46:02 -04:00
Kyle McCormick
3f0f7ce705 build: finish replacing paver assets (#34554)
Together, these changes make it so that all features of the Paver-based
asset compilation system are supported with drop-in Paver-free
replacements. The remaining Paver asset functions are trivial wrappers,
which can be comfortably deleted before Sumac.

* Turn `./manage.py ... compile_sass` into a simple wrapper around `npm
  run compile-sass`
* Turn `paver webpack` into a simple wrapper around `npm run webpack`
* Turn `pavelib.assets:collect_assets` into a simple wrapper around
  `./manage.py ... collectstatic`
* Add/improve deprecation warnings for all Paver asset commands.
* Load defaults for asset-related Django settings from environment
  variables. This allows the build to work without Python. For the
  settings which will be removed in Sumac, I've added deprecation
  warnings.
* Change EDX_PLATFORM_THEME_DIRS env var to COMPREHENSIVE_THEME_DIRS.
  This simplifies the migration instructions, because all the new env
  vars now match their corresponding Django settings. This amends an
  ADR, but it should not be a breaking change because the  env var was
  recently added (since Quince) and nobody should be using it yet.
* Future-proof the static assets ADR with links. The linked pages will
  be kept up-to-date even if the ADR isn't.

Part of: https://github.com/openedx/edx-platform/issues/34467
2024-05-06 08:29:45 -04:00
XnpioChV
b9da8969e6 fix: Update tag counts when changes are saved in the tag drawer
* fix: courseAuthoringUrl on message listener
2024-05-03 11:26:47 -04:00
Syed Sajjad Hussain Shah
2ce25b3eb6 feat: autogenerate username on registration (#34562)
* feat: autogenerate username on registration

---------

Co-authored-by: Attiya Ishaque <atiya.ishaq@arbisoft.com>
Co-authored-by: Blue <ahtesham-quraish@users.noreply.github.com>
2024-05-02 08:58:37 +05:00
Glib Glugovskiy
f9caa8ee48 feat: update path for textbook page on course-authoring mfe redirect 2024-04-30 20:31:08 +03:00
Navin Karkera
61b8961cdf fix: auto enroll users when added as staff (#32561)
The course team management section under Instructor > Membership tab
allows users to be added a role even if are not enrolled in the course.
This is behaviour does not match the help text displayed in the section.

This PR updates modify_access api to enrolls user if they are not enrolled
after adding them to a role as well as changes the help text to reflect
actual changes.
2024-04-26 13:16:32 -04: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
ruzniaievdm
5967ddea37 fix: provide with can_paste_component in serializers (#34521) 2024-04-24 11:25:26 -04:00
Muhammad Anas
7ef3674833 fix: blake2b feature flag name (#34574) 2024-04-23 12:55:11 +00:00
Muhammad Anas
aea7fcee45 feat: added feature flag to enable blake2b hashing 2024-04-22 14:09:41 -04:00
Saad Yousaf
164c8ab835 fix: fix course_update event content param 2024-04-22 13:15:31 +05:00
Kyle D. McCormick
38d350f48c docs: document XBLOCK_MIXINS and XBLOCK_EXTRA_MIXINS 2024-04-17 09:43:12 -04:00
ruzniaievdm
a9db690900 feat: refactoring xblock actions (#34452) 2024-04-12 11:17:54 -04:00
connorhaugh
df3c38ce2e feat: add heartbeat to authoring api (#34449)
* feat: add heartbeat to authoring api
2024-04-10 10:28:30 -04:00
ruzniaievdm
a8586e5114 feat: display error notifications on the Unit page (#34450) 2024-04-09 09:52:35 -04:00
Pooja Kulkarni
3c7e16255a feat: add new endpoint for cloning course (#31794)
Co-authored-by: Maxim Beder <maxim@opencraft.com>
2024-04-09 15:05:10 +05:30
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
Maria Grimaldi
e3dfbf2847 fix: fix typo in share embed link editor (#34470) 2024-04-04 14:09:11 -04: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
c810a1b3e5 Merge branch 'master' into xblock2 2024-04-04 15:16:55 +05:00
Brian Mesick
704c2e58a1 Merge pull request #34454 from qasimgulzar/qasim/DEPR/34342-warning
temp: adding DeprecationWarning to remove neo4j.
2024-04-03 11:16:00 -04:00