Commit Graph

123 Commits

Author SHA1 Message Date
Rômulo Penido
9451cfca26 feat: add API to return list of downstream blocks for an upstream [FC-0076] (#36253)
Adds the API for listing downstream contexts and parents for a given publishable entity.
2025-02-25 13:55:02 -05:00
Bryann Valderrama
a2bb8c9458 refactor!: remove ENABLE_HOME_PAGE_COURSE_API_V2 feature toggle (#36181) 2025-02-24 16:42:06 +01:00
Chris Chávez
b6489e718c feat: Video editor supports transcripts [FC-0076] (#36058)
* Add error handler on save video to avoid creating sjson
* Support transcripts without edx_video_id in definition_to_xml
* When copying a video from a library to a course: Create a new edx_video_id
* Save transcripts as static assets in a video in a library when adding a new transcript.
* Delete transcripts as static assets in a video in a library when deleting transcripts.
* Support download transcript in a video in a library.
* Support replace transcript in a video in a library.
* Support updating transcripts in video in a library.
* Refactor the code of downloading YouTube transcripts to enable this feature in libraries.
* Support copy from a library to a course and a course to a library.
2025-02-21 13:33:13 -05:00
Navin Karkera
a1d0826a2a feat: entity link view and api (#36190)
Adds api for listing upstream entity links for a given course.
2025-02-18 15:34:00 +00:00
Daniel Valenzuela
36c16d6952 fix: static assets used in problem bank and library content block (#36173)
Static assets were not being copied into the course when using library content via Problem Bank or "Add Library Content" workflows.
2025-02-07 10:30:05 -08:00
Raymond Zhou
02fc9c928f 2u/course optimizer (#35887) 2025-02-06 12:47:17 -05:00
Navin Karkera
5e51e2d5b7 fix: swagger docs ref_name conflicts (#36189)
* fix: swagger docs ref_name conflicts

* fix: swagger auto doc errors

* chore: bumps openedx-learning==0.18.2

---------

Co-authored-by: Jillian Vogel <jill@opencraft.com>
2025-01-30 20:32:18 +05:30
Jillian
b96a3bf249 fix: allow_to_create_new_org checks org autocreate [FC-0076] (#36094)
Updates the StudioHome API's allow_to_create_new_org to require both organization-creation permissions and ORGANIZATION_AUTOCREATE to be enabled. It also adds the list of "allowed organizations for libraries" to the Studio Home API so that the Authoring MFE can use it.
2025-01-15 17:32:37 +00:00
Muhammad Arslan
f6f72290b7 build: Remove unused imports 2025-01-14 14:03:00 +05:00
Muhammad Arslan
838977a8f3 feat!: Remove DEPR waffle switch: ENABLE_GLOBAL_STAFF_OPTIMIZATION 2025-01-14 14:02:37 +05:00
Rômulo Penido
8d4909a999 fix: content libraries permissions
This PR changes the permissions for content libraries so that only
people who can create courses should be allowed to create new content
libraries.
2024-12-06 09:18:04 -05:00
Maria Grimaldi
1c835eb643 fix: return empty list when no courses are found for request (#35942)
This change addresses an issue reported while testing Sumac, where the API V2 is on by default in the authoring MFE: openedx/wg-build-test-release#428. It fails when retrieving an empty list of courses with the queryparams api/contentstore/v2/home/courses?page=1&order=display_name. When this was implemented, the course authoring MFE rendered the empty lists only with page=1 query param (didn't do any filtering/ordering by default), which was later changed to page=1&order=display_name which now ordered by default.

This issue occurs because all the filtering and ordering are done under the assumption that course_overviews is always a query set. However, that's only true when there are courses available and CourseOverview.get_all_courses is used. When not, an empty list is returned instead, raising a 500 error in Studio.
2024-12-05 15:52:57 +01:00
Jesper Hodge
38e5745e06 feat: add course optimizer waffle flag (#35884)
Description
Add a waffle flag to toggle on or off the new Course Optimizer feature per course.

Impact
Course Author

Context
Course Optimizer is a much-requested feature that has been aligned with the OpenEdx community. The only component for now is a broken link checker that will return a list of all broken links in a course to the frontend. There will be a new page for this that is a bit similar to the export page.

This PR only deals with adding a waffle flag.

Supporting information
Internal Ticket (2U):
https://2u-internal.atlassian.net/browse/TNL-11808
2024-11-20 20:51:46 +00:00
Sagirov Evgeniy
f730276263 feat: Add API endpoint to manage course waffle flags (#35622)
Co-authored-by: Sagirov Eugeniy <evhenyj.sahyrov@raccoongang.com>
2024-11-04 15:13:37 -03:00
Kristin Aoki
e13d66d1e4 feat: support unit preview in learning MFE (#35747)
* feat: update preview url to direct to mfe

* fix: use url builder instead of string formatter

* fix: url redirect for never published units

* fix: remove 404 error when  not a preview or staff

* feat: update sequence metadata to allow draft branch
2024-11-01 11:03:06 -04:00
Kristin Aoki
afd1394112 Revert "feat: update preview url to direct to mfe (#35687)" (#35732)
This reverts commit 2373dd02f9.
2024-10-28 17:26:29 +00:00
Kristin Aoki
2373dd02f9 feat: update preview url to direct to mfe (#35687)
* feat: update preview url to direct to mfe

* fix: use url builder instead of string formatter

* fix: url redirect for never published units
2024-10-28 10:31:53 -04:00
Navin Karkera
e2a9a37d68 feat: show alert while editing v2 library content [FC-0062] (#35700)
Adds warning alert in edit modal for library v2 content in both legacy and new
MFE editors. For the Libraries Relaunch Beta.

Part of: https://github.com/openedx/frontend-app-authoring/issues/1340

Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
2024-10-23 16:03:26 +00:00
Navin Karkera
7e8fb4393e feat: adds Library Content (v2) button to Studio Unit page (#35670)
Requires that v2 libraries are enabled.
2024-10-21 10:32:54 -07:00
Jillian
96811d6452 feat: adds waffle flags for legacy libraries v1 and new libraries v2 (#35576)
* refactor: rename CourseHomeSerializer to StudioHomeSerializer

to better reflect how this serializer/API is used in the Authoring MFE

* feat: adds waffle flags for legacy libraries v1 and new libraries v2 in new Studio Home

These waffle flags replace the MFE env flag LIBRARY_MODE.

* refactor: use contentstore.toggles.libraries_v1_enabled()

and ENABLE_CONTENT_LIBRARIES feature toggle where possible.

ENABLE_CONTENT_LIBRARIES has been incorporated into both the
libraries_v1_enabled() and libraries_v2_enabled() toggles:
FEATURES['ENABLE_CONTENT_LIBRARIES'] must be true for either version of
libraries to be "enabled".
2024-10-18 09:43:01 -07:00
Kyle McCormick
795d039581 feat: Upstream Sync with Content Library Blocks (#34925)
This introdues the idea of "upstream" and "downstream" content,
where downstreams (like course components) can pull content updates from
upstreams (like learning core-backed content library blocks). This
supports the upcoming Content Libraries Relaunch Beta for Sumac.
New features include:

* A new XBlockMixin: UpstreamSyncMixin.
* A new CMS Python API: cms.lib.xblock.upstream_sync
* A new CMS JSON API: /api/contentstore/v2/downstreams
* A temporary, very basic UI for syncing from Content Library blocks

Implements:
https://github.com/kdmccormick/edx-platform/blob/kdmccormick/upstream-proto/docs/decisions/0020-upstream-block.rst

Co-authored-by: Braden MacDonald <braden@opencraft.com>
2024-10-17 16:02:26 +00:00
Kyle McCormick
2bbd8ecd18 feat!: Remove outdated Libraries Relaunch cruft (#35644)
The V2 libraries project had a few past iterations which were never
launched. This commit cleans up pieces from those which we don't need
for the real Libraries Relaunch MVP in Sumac:

* Remove ENABLE_LIBRARY_AUTHORING_MICROFRONTEND,
  LIBRARY_AUTHORING_FRONTEND_URL, and
  REDIRECT_TO_LIBRARY_AUTHORING_MICROFRONTEND, all of which are obsolete
  now that library authoring has been merged into
  https://github.com/openedx/frontend-app-authoring.
  More details on the new Content Libraries configuration settings are
  here: https://github.com/openedx/frontend-app-authoring/issues/1334

* Remove dangling support for syncing V2 (learning core-backed) library
  content using the LibraryContentBlock. This code was all based on an
  older understanding of V2 Content Libraries, where the libraries were
  smaller and versioned as a whole rather then versioned by-item.
  Reference to V2 libraries will be done on a per-block basis using
  the upstream/downstream system, described here:
  https://github.com/openedx/edx-platform/blob/master/docs/decisions/0020-upstream-downstream.rst
  It's important that we remove this support now so that OLX course
  authors don't stuble upon it and use it, which would be buggy and
  complicate future migrations.

* Remove the "mode" parameter from LibraryContentBlock. The only
  supported mode was and is "random". We will not be adding any further
  modes. Going forward for V2, we will have an ItemBank block for
  randomizing items (regardless of source), which can be synthesized
  with upstream referenced as described above. Existing
  LibraryContentBlocks will be migrated.

* Finally, some renamings:

  * LibraryContentBlock -> LegacyLibraryContentBlock
  * LibraryToolsService -> LegacyLibraryToolsService
  * LibrarySummary -> LegacyLibrarySummary

  Module names and the old OLX tag (library_content) are unchanged.

Closes: https://github.com/openedx/frontend-app-authoring/issues/1115
2024-10-15 11:32:01 -04:00
Deborah Kaplan
8c923bea24 feat!: removes deprecated v1 certificate behavior (#35562)
* feat!: removes deprecated v1 certificate behavior

this removes the long-deprecated v1  certificate behavior. This removes
the old-style date selection behavior  (ie., not a choice between
*Immediately upon passing*, *End date of course*, *A date after the course
end date*), which is no longer reliably maintained or supported in
Studio or Credentials.

FIXES: #35399
2024-10-02 12:06:57 -04:00
Peter Pinch
fe80a1cdcd Merge pull request #35406 from open-craft/cef/set-links-for-course-authoring-alert
feat: set links for CourseAuthoring discussion alert
2024-09-26 11:32:12 -04:00
Demid
448edd7e5f feat: add can_access_advanced_settings to studio home (#35426) 2024-09-12 12:36:35 -04:00
Zachary Hancock
4b827bf9be feat: show error on courses with unknown proctoring providers (#35445) 2024-09-10 09:02:13 -04:00
cef
73364712ba feat: set links for CourseAuthoring discussion alert 2024-09-09 08:42:36 -05: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
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
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
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
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
Kaustav Banerjee
d43a2f73eb feat: default grade designations configurable from settings (#32406) 2024-05-08 01:14:03 +05:30
ruzniaievdm
5967ddea37 fix: provide with can_paste_component in serializers (#34521) 2024-04-24 11:25:26 -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
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
ruzniaievdm
6d13b77495 feat: [FC-0044] group configurations API DRF (#34389) 2024-03-25 10:02:34 -04:00
ruzniaievdm
85dd7f35e3 feat: [FC-0044] certificates API DRF (#34339)
* feat: [FC-0044] certificates API DRF

* fix: remove unused import from previous commits
2024-03-22 10:46:34 -04:00
ruzniaievdm
3ecc4bf6a0 feat: [FC-0044] textbooks API DRF (#34388)
* feat: [FC-0044] textbooks API DRF

* fix: resolve discussions
2024-03-21 13:39:03 -04:00
Maria Grimaldi
45178e0ced feat: add paginated HomePageCoursesV2 view with filtering & ordering (#34173) 2024-03-20 11:31:59 -04:00
ruzniaievdm
1bcf25f22b feat: manage Tags on block level (#34361) 2024-03-18 16:09:47 -04:00
ruzniaievdm
334348d65f feat: Manage access API (#2500) (#34360)
* feat: [AXIMST-418] Manage access API

* fix: tests and linter

---------

Co-authored-by: monteri <36768631+monteri@users.noreply.github.com>
2024-03-18 12:58:11 -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
ruzniaievdm
844db29d64 feat: add sequence_ids to container response (#34337)
* feat: add sequence_ids to container response

* fix: PR comments fix

* fix: update

---------

Co-authored-by: monteri <36768631+monteri@users.noreply.github.com>
2024-03-12 10:27:23 -04: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
Awais Ansari
5007418803 feat: add discussion configuration redirect in unit settings (#34266)
* feat: add discussion configuration redirect in unit settings

* test: fix test course index file test cases after adding discussion redirection
2024-02-22 16:29:36 +05:00
Navin Karkera
6edc0c2dd9 feat: add discussion settings to course index api (#34174) 2024-02-05 09:13:11 -05:00