diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 5e217a7c09e7..b1cc84c1ab69 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -22,7 +22,7 @@ openedx/core/djangoapps/user_authn/ @openedx/com openedx/core/djangoapps/verified_track_content/ @openedx/committers-openedx-platform-2u-infinity openedx/features/course_experience/ # The Aximprovements team is working on extracting all built-in XBlocks -# to the external repository (xblocks-contrib). They need to be notified +# to the external repository (xblocks-core). They need to be notified # about any changes within xmodule to stay aligned with this effort. # Ticket: https://github.com/openedx/edx-platform/issues/34827 xmodule/ @farhan @irtazaakram @salman2013 diff --git a/cms/djangoapps/contentstore/rest_api/v2/views/utils.py b/cms/djangoapps/contentstore/rest_api/v2/views/utils.py index 840ba2c0e0b0..50c39a6a33de 100644 --- a/cms/djangoapps/contentstore/rest_api/v2/views/utils.py +++ b/cms/djangoapps/contentstore/rest_api/v2/views/utils.py @@ -4,7 +4,7 @@ from rest_framework import permissions from rest_framework.generics import GenericAPIView from rest_framework.response import Response -from xblocks_contrib.problem.capa.inputtypes import preview_numeric_input +from xblock_problem.capa.inputtypes import preview_numeric_input from cms.djangoapps.contentstore.rest_api.v2.serializers.utils import NumericalInputValidationRequestSerializer diff --git a/cms/djangoapps/contentstore/tests/test_transcripts_utils.py b/cms/djangoapps/contentstore/tests/test_transcripts_utils.py index f9cc996717ee..b325f0e48a0c 100644 --- a/cms/djangoapps/contentstore/tests/test_transcripts_utils.py +++ b/cms/djangoapps/contentstore/tests/test_transcripts_utils.py @@ -15,7 +15,7 @@ from django.conf import settings from django.test.utils import override_settings from django.utils import translation -from xblocks_contrib.video.exceptions import TranscriptsGenerationException +from xblock_video.exceptions import TranscriptsGenerationException from cms.djangoapps.contentstore.tests.utils import setup_caption_responses from common.djangoapps.student.tests.factories import UserFactory diff --git a/cms/djangoapps/contentstore/transcript_storage_handlers.py b/cms/djangoapps/contentstore/transcript_storage_handlers.py index 0c8dc37faa0e..9a2fba67f960 100644 --- a/cms/djangoapps/contentstore/transcript_storage_handlers.py +++ b/cms/djangoapps/contentstore/transcript_storage_handlers.py @@ -19,7 +19,7 @@ ) from edxval.api import delete_video_transcript as delete_video_transcript_source_function from opaque_keys.edx.keys import CourseKey -from xblocks_contrib.video.exceptions import TranscriptsGenerationException +from xblock_video.exceptions import TranscriptsGenerationException from common.djangoapps.util.json_request import JsonResponse from openedx.core.djangoapps.video_config.models import VideoTranscriptEnabledFlag diff --git a/cms/djangoapps/contentstore/views/transcripts_ajax.py b/cms/djangoapps/contentstore/views/transcripts_ajax.py index f3c11a517802..ebad3d6c7f9a 100644 --- a/cms/djangoapps/contentstore/views/transcripts_ajax.py +++ b/cms/djangoapps/contentstore/views/transcripts_ajax.py @@ -21,7 +21,7 @@ from opaque_keys import InvalidKeyError from opaque_keys.edx.keys import UsageKey, UsageKeyV2 from opaque_keys.edx.locator import LibraryLocatorV2 -from xblocks_contrib.video.exceptions import TranscriptsGenerationException +from xblock_video.exceptions import TranscriptsGenerationException from cms.djangoapps.contentstore.video_storage_handlers import TranscriptProvider from common.djangoapps.student.auth import has_course_author_access diff --git a/lms/djangoapps/ccx/tests/test_views.py b/lms/djangoapps/ccx/tests/test_views.py index 324caad27d7e..32cd1f77658c 100644 --- a/lms/djangoapps/ccx/tests/test_views.py +++ b/lms/djangoapps/ccx/tests/test_views.py @@ -19,7 +19,7 @@ from edx_django_utils.cache import RequestCache from opaque_keys.edx.keys import CourseKey from pytz import UTC -from xblocks_contrib.problem.capa.tests.response_xml_factory import StringResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import StringResponseXMLFactory from common.djangoapps.edxmako.shortcuts import render_to_response from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed diff --git a/lms/djangoapps/courseware/block_render.py b/lms/djangoapps/courseware/block_render.py index eb62390c4ca6..eb6b65f493f9 100644 --- a/lms/djangoapps/courseware/block_render.py +++ b/lms/djangoapps/courseware/block_render.py @@ -40,7 +40,7 @@ from xblock.exceptions import NoSuchHandlerError, NoSuchViewError, NotFoundError, ProcessingError from xblock.reference.plugins import FSService from xblock.runtime import KvsFieldData -from xblocks_contrib.video.exceptions import TranscriptNotFoundError +from xblock_video.exceptions import TranscriptNotFoundError from common.djangoapps.edxmako.services import MakoService from common.djangoapps.static_replace.services import ReplaceURLService diff --git a/lms/djangoapps/courseware/tests/test_block_render.py b/lms/djangoapps/courseware/tests/test_block_render.py index 25d56ef60de7..bab037797ecd 100644 --- a/lms/djangoapps/courseware/tests/test_block_render.py +++ b/lms/djangoapps/courseware/tests/test_block_render.py @@ -51,7 +51,7 @@ Mixologist, # pylint: disable=wrong-import-order ) from xblock.test.tools import TestRuntime # pylint: disable=wrong-import-order -from xblocks_contrib.problem.capa.tests.response_xml_factory import ( +from xblock_problem.capa.tests.response_xml_factory import ( OptionResponseXMLFactory, # pylint: disable=reimported ) diff --git a/lms/djangoapps/courseware/tests/test_entrance_exam.py b/lms/djangoapps/courseware/tests/test_entrance_exam.py index a386f8cff527..f48d34f89a8a 100644 --- a/lms/djangoapps/courseware/tests/test_entrance_exam.py +++ b/lms/djangoapps/courseware/tests/test_entrance_exam.py @@ -7,7 +7,7 @@ from django.test import override_settings from django.urls import reverse from milestones.tests.utils import MilestonesTestCaseMixin -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import ( diff --git a/lms/djangoapps/courseware/tests/test_masquerade.py b/lms/djangoapps/courseware/tests/test_masquerade.py index 2a3d3be67615..a280ec354da5 100644 --- a/lms/djangoapps/courseware/tests/test_masquerade.py +++ b/lms/djangoapps/courseware/tests/test_masquerade.py @@ -16,7 +16,7 @@ from django.urls import reverse from pytz import UTC from xblock.runtime import DictKeyValueStore -from xblocks_contrib.problem.capa.tests.response_xml_factory import OptionResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import OptionResponseXMLFactory from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import StaffFactory, UserFactory diff --git a/lms/djangoapps/courseware/tests/test_submitting_problems.py b/lms/djangoapps/courseware/tests/test_submitting_problems.py index e15107d93422..751da2d610ca 100644 --- a/lms/djangoapps/courseware/tests/test_submitting_problems.py +++ b/lms/djangoapps/courseware/tests/test_submitting_problems.py @@ -21,14 +21,14 @@ from django.urls import reverse from django.utils.timezone import now from submissions import api as submissions_api -from xblocks_contrib.problem.capa.tests.response_xml_factory import ( +from xblock_problem.capa.tests.response_xml_factory import ( CodeResponseXMLFactory, CustomResponseXMLFactory, OptionResponseXMLFactory, SchematicResponseXMLFactory, ) -from xblocks_contrib.problem.capa.tests.test_util import UseUnsafeCodejail -from xblocks_contrib.problem.capa.xqueue_interface import XQueueInterface +from xblock_problem.capa.tests.test_util import UseUnsafeCodejail +from xblock_problem.capa.xqueue_interface import XQueueInterface from common.djangoapps.course_modes.models import CourseMode from common.djangoapps.student.models import CourseEnrollment, anonymous_id_for_user diff --git a/lms/djangoapps/courseware/tests/test_video_handlers.py b/lms/djangoapps/courseware/tests/test_video_handlers.py index 9422bcc16354..95d8bc607e4c 100644 --- a/lms/djangoapps/courseware/tests/test_video_handlers.py +++ b/lms/djangoapps/courseware/tests/test_video_handlers.py @@ -512,7 +512,7 @@ def test_download_transcript_not_exist(self): assert response.status == '404 Not Found' @patch( - 'xblocks_contrib.video.video_handlers.get_transcript', + 'xblock_video.video_handlers.get_transcript', return_value=('Subs!', 'test_filename.srt', 'application/x-subrip; charset=utf-8') ) def test_download_srt_exist(self, __): # noqa: PT019 @@ -523,7 +523,7 @@ def test_download_srt_exist(self, __): # noqa: PT019 assert response.headers['Content-Language'] == 'en' @patch( - 'xblocks_contrib.video.video_handlers.get_transcript', + 'xblock_video.video_handlers.get_transcript', return_value=('Subs!', 'txt', 'text/plain; charset=utf-8') ) def test_download_txt_exist(self, __): # noqa: PT019 diff --git a/lms/djangoapps/courseware/tests/test_video_mongo.py b/lms/djangoapps/courseware/tests/test_video_mongo.py index 19925684a525..b04e56f05a3d 100644 --- a/lms/djangoapps/courseware/tests/test_video_mongo.py +++ b/lms/djangoapps/courseware/tests/test_video_mongo.py @@ -36,7 +36,7 @@ from fs.path import combine from lxml import etree from path import Path as path -from xblocks_contrib.video import bumper_utils +from xblock_video import bumper_utils from common.djangoapps.xblock_django.constants import ATTR_KEY_REQUEST_COUNTRY_CODE from common.test.utils import assert_dict_contains_subset @@ -2326,7 +2326,7 @@ class TestVideoWithBumper(TestVideo): # pylint: disable=test-inherits-tests CATEGORY = "video" METADATA = {} - @patch('xblocks_contrib.video.bumper_utils.get_bumper_settings') + @patch('xblock_video.bumper_utils.get_bumper_settings') def test_is_bumper_enabled(self, get_bumper_settings): """ Check that bumper is (not)shown if ENABLE_VIDEO_BUMPER is (False)True @@ -2344,8 +2344,8 @@ def test_is_bumper_enabled(self, get_bumper_settings): assert not bumper_utils.is_bumper_enabled(self.block) @patch('xblock.utils.resources.ResourceLoader.render_django_template', side_effect=mock_render_template) - @patch('xblocks_contrib.video.bumper_utils.is_bumper_enabled') - @patch('xblocks_contrib.video.bumper_utils.get_bumper_settings') + @patch('xblock_video.bumper_utils.is_bumper_enabled') + @patch('xblock_video.bumper_utils.get_bumper_settings') @patch('edxval.api.get_urls_for_profiles') def test_bumper_metadata( self, get_url_for_profiles, get_bumper_settings, is_bumper_enabled, mock_render_django_template diff --git a/lms/djangoapps/courseware/tests/test_views.py b/lms/djangoapps/courseware/tests/test_views.py index d93da9d5cc92..f6d1692b1135 100644 --- a/lms/djangoapps/courseware/tests/test_views.py +++ b/lms/djangoapps/courseware/tests/test_views.py @@ -35,7 +35,7 @@ from xblock.core import XBlock from xblock.fields import Scope, String from xblock.scorable import ShowCorrectness -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory import lms.djangoapps.courseware.views.views as views from common.djangoapps.course_modes.models import CourseMode @@ -2027,7 +2027,7 @@ def test_user_with_out_passing_grades(self): def test_user_with_passing_grade(self, mock_is_course_passed): # pylint: disable=unused-argument # If user has above passing grading then json will return cert generating message and # status valid code - with patch('xblocks_contrib.problem.capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_send_to_queue: + with patch('xblock_problem.capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_send_to_queue: mock_send_to_queue.return_value = (0, "Successfully queued") resp = self.client.post(self.url) diff --git a/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py b/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py index d92700ffcb2c..6e825855fccf 100644 --- a/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py +++ b/lms/djangoapps/grades/rest_api/v1/tests/test_grading_policy_view.py @@ -8,7 +8,7 @@ import ddt from django.urls import reverse from pytz import UTC -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from common.djangoapps.student.tests.factories import GlobalStaffFactory, StaffFactory, UserFactory from openedx.core.djangoapps.oauth_dispatch.tests.factories import AccessTokenFactory, ApplicationFactory diff --git a/lms/djangoapps/grades/tests/base.py b/lms/djangoapps/grades/tests/base.py index 2000ccb1f26b..b7ae0adb63fe 100644 --- a/lms/djangoapps/grades/tests/base.py +++ b/lms/djangoapps/grades/tests/base.py @@ -4,7 +4,7 @@ from crum import set_current_request -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import UserFactory diff --git a/lms/djangoapps/grades/tests/integration/test_access.py b/lms/djangoapps/grades/tests/integration/test_access.py index fd28ef5102d6..8e6f9bfcbd3d 100644 --- a/lms/djangoapps/grades/tests/integration/test_access.py +++ b/lms/djangoapps/grades/tests/integration/test_access.py @@ -4,7 +4,7 @@ from crum import set_current_request -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import UserFactory diff --git a/lms/djangoapps/grades/tests/integration/test_events.py b/lms/djangoapps/grades/tests/integration/test_events.py index ecd89a721665..5705ccd32fff 100644 --- a/lms/djangoapps/grades/tests/integration/test_events.py +++ b/lms/djangoapps/grades/tests/integration/test_events.py @@ -6,7 +6,7 @@ import ddt from crum import set_current_request -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory import openedx.core.djangoapps.content.block_structure.api as bs_api from common.djangoapps.student.models import CourseEnrollment diff --git a/lms/djangoapps/grades/tests/integration/test_problems.py b/lms/djangoapps/grades/tests/integration/test_problems.py index 8a892e7f4090..9f33c3a998fa 100644 --- a/lms/djangoapps/grades/tests/integration/test_problems.py +++ b/lms/djangoapps/grades/tests/integration/test_problems.py @@ -6,7 +6,7 @@ import pytz from crum import set_current_request from django.test.utils import override_settings -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from common.djangoapps.student.models import CourseEnrollment from common.djangoapps.student.tests.factories import UserFactory diff --git a/lms/djangoapps/instructor/tests/test_enrollment.py b/lms/djangoapps/instructor/tests/test_enrollment.py index 090195302717..400da53799f7 100644 --- a/lms/djangoapps/instructor/tests/test_enrollment.py +++ b/lms/djangoapps/instructor/tests/test_enrollment.py @@ -17,7 +17,7 @@ from django.utils.translation import override as override_language from opaque_keys.edx.locator import CourseLocator from submissions import api as sub_api -from xblocks_contrib.problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import MultipleChoiceResponseXMLFactory from common.djangoapps.student.models import CourseEnrollment, CourseEnrollmentAllowed, anonymous_id_for_user from common.djangoapps.student.roles import CourseCcxCoachRole diff --git a/lms/djangoapps/instructor/tests/test_spoc_gradebook.py b/lms/djangoapps/instructor/tests/test_spoc_gradebook.py index 1b77cd72a59c..d417c045583a 100644 --- a/lms/djangoapps/instructor/tests/test_spoc_gradebook.py +++ b/lms/djangoapps/instructor/tests/test_spoc_gradebook.py @@ -2,7 +2,7 @@ Tests of the instructor dashboard spoc gradebook """ from django.urls import reverse -from xblocks_contrib.problem.capa.tests.response_xml_factory import StringResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import StringResponseXMLFactory from common.djangoapps.student.tests.factories import AdminFactory, CourseEnrollmentFactory, UserFactory from lms.djangoapps.courseware.tests.factories import StudentModuleFactory diff --git a/lms/djangoapps/instructor_task/tasks_helper/module_state.py b/lms/djangoapps/instructor_task/tasks_helper/module_state.py index 328245bf4428..e4c295250719 100644 --- a/lms/djangoapps/instructor_task/tasks_helper/module_state.py +++ b/lms/djangoapps/instructor_task/tasks_helper/module_state.py @@ -10,7 +10,7 @@ from django.utils.translation import gettext_noop from opaque_keys.edx.keys import UsageKey from xblock.scorable import Score -from xblocks_contrib.problem.capa.responsetypes import LoncapaProblemError, ResponseError, StudentInputError +from xblock_problem.capa.responsetypes import LoncapaProblemError, ResponseError, StudentInputError from common.djangoapps.student.models import get_user_by_username_or_email from common.djangoapps.track.event_transaction_utils import create_new_event_transaction_id, set_event_transaction_type diff --git a/lms/djangoapps/instructor_task/tests/test_base.py b/lms/djangoapps/instructor_task/tests/test_base.py index 3e1c4d6b06bd..9d48c6ea5caa 100644 --- a/lms/djangoapps/instructor_task/tests/test_base.py +++ b/lms/djangoapps/instructor_task/tests/test_base.py @@ -19,7 +19,7 @@ from django.urls import reverse from opaque_keys.edx.keys import CourseKey from opaque_keys.edx.locations import Location -from xblocks_contrib.problem.capa.tests.response_xml_factory import OptionResponseXMLFactory +from xblock_problem.capa.tests.response_xml_factory import OptionResponseXMLFactory from common.djangoapps.student.tests.factories import CourseEnrollmentFactory, UserFactory from lms.djangoapps.courseware.model_data import StudentModule diff --git a/lms/djangoapps/instructor_task/tests/test_integration.py b/lms/djangoapps/instructor_task/tests/test_integration.py index 5a170754ac2f..6bc6a12639e9 100644 --- a/lms/djangoapps/instructor_task/tests/test_integration.py +++ b/lms/djangoapps/instructor_task/tests/test_integration.py @@ -19,9 +19,9 @@ from django.contrib.auth.models import User # pylint: disable=imported-auth-user from django.test.utils import override_settings from django.urls import reverse -from xblocks_contrib.problem.capa.responsetypes import StudentInputError -from xblocks_contrib.problem.capa.tests.response_xml_factory import CodeResponseXMLFactory, CustomResponseXMLFactory -from xblocks_contrib.problem.capa.tests.test_util import UseUnsafeCodejail +from xblock_problem.capa.responsetypes import StudentInputError +from xblock_problem.capa.tests.response_xml_factory import CodeResponseXMLFactory, CustomResponseXMLFactory +from xblock_problem.capa.tests.test_util import UseUnsafeCodejail from common.test.utils import assert_dict_contains_subset from lms.djangoapps.courseware.model_data import StudentModule @@ -277,7 +277,7 @@ def test_rescoring_failure(self): expected_message = "bad things happened" with patch( - "xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.get_grade_from_current_answers" + "xblock_problem.capa.capa_problem.LoncapaProblem.get_grade_from_current_answers" ) as mock_rescore: mock_rescore.side_effect = ZeroDivisionError(expected_message) instructor_task = self.submit_rescore_all_student_answers('instructor', problem_url_name) @@ -299,7 +299,7 @@ def test_rescoring_bad_unicode_input(self): # return an input error as if it were a numerical response, with an embedded unicode character: expected_message = "Could not interpret '2/3\u03a9' as a number" with patch( - "xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.get_grade_from_current_answers" + "xblock_problem.capa.capa_problem.LoncapaProblem.get_grade_from_current_answers" ) as mock_rescore: mock_rescore.side_effect = StudentInputError(expected_message) instructor_task = self.submit_rescore_all_student_answers('instructor', problem_url_name) @@ -339,7 +339,7 @@ def test_rescoring_code_problem(self): problem_url_name = 'H1P2' self.define_code_response_problem(problem_url_name) # we fully create the CodeResponse problem, but just pretend that we're queuing it: - with patch('xblocks_contrib.problem.capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_send_to_queue: + with patch('xblock_problem.capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_send_to_queue: mock_send_to_queue.return_value = (0, "Successfully queued") self.submit_student_answer('u1', problem_url_name, ["answer1", "answer2"]) diff --git a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py index 6a20da1ee434..4c806e71bdd0 100644 --- a/lms/djangoapps/instructor_task/tests/test_tasks_helper.py +++ b/lms/djangoapps/instructor_task/tests/test_tasks_helper.py @@ -23,7 +23,7 @@ from edx_django_utils.cache import RequestCache from freezegun import freeze_time from pytz import UTC -from xblocks_contrib.problem.capa.tests.response_xml_factory import ( +from xblock_problem.capa.tests.response_xml_factory import ( MultipleChoiceResponseXMLFactory, # pylint: disable=wrong-import-order ) @@ -2635,7 +2635,7 @@ def assertCertificatesGenerated(self, task_input, expected_results): with patch('lms.djangoapps.instructor_task.tasks_helper.runner._get_current_task') as mock_current_task: mock_current_task.return_value = current_task - with patch('xblocks_contrib.problem.capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_queue: + with patch('xblock_problem.capa.xqueue_interface.XQueueInterface.send_to_queue') as mock_queue: mock_queue.return_value = (0, "Successfully queued") result = generate_students_certificates( None, None, self.course.id, task_input, 'certificates generated' diff --git a/openedx/core/djangoapps/content/block_structure/tasks.py b/openedx/core/djangoapps/content/block_structure/tasks.py index 4490650fe06e..3fa65576c607 100644 --- a/openedx/core/djangoapps/content/block_structure/tasks.py +++ b/openedx/core/djangoapps/content/block_structure/tasks.py @@ -11,7 +11,7 @@ from edxval.api import ValInternalError from lxml.etree import XMLSyntaxError from opaque_keys.edx.keys import CourseKey -from xblocks_contrib.problem.capa.responsetypes import LoncapaProblemError +from xblock_problem.capa.responsetypes import LoncapaProblemError from openedx.core.djangoapps.content.block_structure import api from xmodule.modulestore.exceptions import ItemNotFoundError # pylint: disable=wrong-import-order diff --git a/openedx/core/djangoapps/discussions/services.py b/openedx/core/djangoapps/discussions/services.py index db3b774cc638..e161518ff456 100644 --- a/openedx/core/djangoapps/discussions/services.py +++ b/openedx/core/djangoapps/discussions/services.py @@ -3,7 +3,7 @@ This service provides discussion-related configuration and feature flags that are specific to the edx-platform implementation -for the extracted discussion block in xblocks-contrib repository. +for the extracted discussion block in xblocks-core repository. """ from django.conf import settings diff --git a/openedx/core/djangoapps/video_config/services.py b/openedx/core/djangoapps/video_config/services.py index 519b9054074b..65d47c47e162 100644 --- a/openedx/core/djangoapps/video_config/services.py +++ b/openedx/core/djangoapps/video_config/services.py @@ -3,7 +3,7 @@ This service provides video-related configuration and feature flags that are specific to the edx-platform implementation -for the extracted video block in xblocks-contrib repository. +for the extracted video block in xblocks-core repository. """ import logging @@ -16,7 +16,7 @@ from opaque_keys.edx.keys import CourseKey, UsageKey from opaque_keys.edx.locator import LibraryLocatorV2 from organizations.api import get_course_organization -from xblocks_contrib.video.exceptions import TranscriptNotFoundError +from xblock_video.exceptions import TranscriptNotFoundError from openedx.core.djangoapps.content_libraries.api import ( add_library_block_static_asset_file, diff --git a/openedx/core/djangoapps/video_config/transcripts_utils.py b/openedx/core/djangoapps/video_config/transcripts_utils.py index e253641b7188..392341670e43 100644 --- a/openedx/core/djangoapps/video_config/transcripts_utils.py +++ b/openedx/core/djangoapps/video_config/transcripts_utils.py @@ -22,8 +22,8 @@ from opaque_keys.edx.locator import LibraryLocatorV2 from pysrt import SubRipFile, SubRipItem, SubRipTime from pysrt.srtexc import Error -from xblocks_contrib.video.bumper_utils import get_bumper_settings -from xblocks_contrib.video.exceptions import TranscriptsGenerationException +from xblock_video.bumper_utils import get_bumper_settings +from xblock_video.exceptions import TranscriptsGenerationException from openedx.core.djangoapps.xblock.api import get_component_from_usage_key from xmodule.contentstore.content import StaticContent diff --git a/openedx/envs/common.py b/openedx/envs/common.py index f7734120b79a..b9c3e984bd08 100644 --- a/openedx/envs/common.py +++ b/openedx/envs/common.py @@ -2079,7 +2079,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_WORD_CLOUD_BLOCK # .. toggle_default: True # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted Word Cloud XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted Word Cloud XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_creation_date: 2024-11-10 # .. toggle_target_removal_date: 2026-04-10 @@ -2088,7 +2088,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_ANNOTATABLE_BLOCK # .. toggle_default: True # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted annotatable XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted annotatable XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_creation_date: 2024-11-10 # .. toggle_target_removal_date: 2026-04-10 @@ -2097,7 +2097,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_POLL_QUESTION_BLOCK # .. toggle_default: True # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted poll question XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted poll question XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_creation_date: 2024-11-10 # .. toggle_target_removal_date: 2026-04-10 @@ -2106,7 +2106,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_LTI_BLOCK # .. toggle_default: True # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted LTI XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted LTI XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_creation_date: 2024-11-10 # .. toggle_target_removal_date: 2026-04-10 @@ -2115,7 +2115,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_HTML_BLOCK # .. toggle_default: True # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted HTML XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted HTML XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_creation_date: 2024-11-10 # .. toggle_target_removal_date: 2026-04-10 @@ -2124,7 +2124,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_DISCUSSION_BLOCK # .. toggle_default: False # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted Discussion XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted Discussion XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done. # .. toggle_creation_date: 2024-11-10 @@ -2134,7 +2134,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_PROBLEM_BLOCK # .. toggle_default: False # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted Problem XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted Problem XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_warning: Not production-ready until relevant subtask https://github.com/openedx/edx-platform/issues/34827 is done. # .. toggle_creation_date: 2024-11-10 @@ -2144,7 +2144,7 @@ def add_optional_apps(optional_apps, installed_apps): # .. toggle_name: USE_EXTRACTED_VIDEO_BLOCK # .. toggle_default: True # .. toggle_implementation: DjangoSetting -# .. toggle_description: Enables the use of the extracted Video XBlock, which has been shifted to the 'openedx/xblocks-contrib' repo. +# .. toggle_description: Enables the use of the extracted Video XBlock, which has been shifted to the 'openedx/xblocks-core' repo. # .. toggle_use_cases: temporary # .. toggle_creation_date: 2024-11-10 # .. toggle_target_removal_date: 2026-04-10 diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index a02051a1943b..725cd6175260 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -1311,7 +1311,7 @@ xblock-google-drive==0.8.2 # via -r requirements/edx/bundled.in xblock-poll==1.16.1 # via -r requirements/edx/bundled.in -xblocks-contrib==0.17.0 +xblocks-core @ git+https://github.com/openedx/xblocks-core.git@kdmccormick/xblocks-core # via -r requirements/edx/bundled.in xmlsec==1.3.14 # via diff --git a/requirements/edx/bundled.in b/requirements/edx/bundled.in index 426dc5de3f94..d835288029e0 100644 --- a/requirements/edx/bundled.in +++ b/requirements/edx/bundled.in @@ -39,7 +39,7 @@ ora2>=4.5.0 # Open Response Assessment XBlock xblock-poll # Xblock for polling users xblock-drag-and-drop-v2 # Drag and Drop XBlock xblock-google-drive # XBlock for google docs and calendar -xblocks-contrib # Package having multiple core XBlocks, https://github.com/openedx/xblocks-contrib?tab=readme-ov-file#xblocks-being-moved-here +xblocks-core # Package having multiple core XBlocks, https://github.com/openedx/xblocks-core?tab=readme-ov-file#xblocks-being-moved-here ## Integrated Channels diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index 12d2fa586a07..cc398851099b 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -2319,7 +2319,7 @@ xblock-poll==1.16.1 # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt -xblocks-contrib==0.17.0 +xblocks-core @ git+https://github.com/openedx/xblocks-core.git@kdmccormick/xblocks-core # via # -r requirements/edx/doc.txt # -r requirements/edx/testing.txt diff --git a/requirements/edx/doc.txt b/requirements/edx/doc.txt index 9bd0bfdd7a16..bf057ff5b396 100644 --- a/requirements/edx/doc.txt +++ b/requirements/edx/doc.txt @@ -1651,7 +1651,7 @@ xblock-google-drive==0.8.2 # via -r requirements/edx/base.txt xblock-poll==1.16.1 # via -r requirements/edx/base.txt -xblocks-contrib==0.17.0 +xblocks-core @ git+https://github.com/openedx/xblocks-core.git@kdmccormick/xblocks-core # via -r requirements/edx/base.txt xmlsec==1.3.14 # via diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index ef101a0fdbfb..efdf4fdc3d32 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -1730,7 +1730,7 @@ xblock-google-drive==0.8.2 # via -r requirements/edx/base.txt xblock-poll==1.16.1 # via -r requirements/edx/base.txt -xblocks-contrib==0.17.0 +xblocks-core @ git+https://github.com/openedx/xblocks-core.git@kdmccormick/xblocks-core # via -r requirements/edx/base.txt xmlsec==1.3.14 # via diff --git a/xmodule/annotatable_block.py b/xmodule/annotatable_block.py index 2d2347d851a4..ef939e8eb8d1 100644 --- a/xmodule/annotatable_block.py +++ b/xmodule/annotatable_block.py @@ -9,7 +9,7 @@ from web_fragments.fragment import Fragment from xblock.core import XBlock from xblock.fields import Scope, String -from xblocks_contrib.annotatable import AnnotatableBlock as _ExtractedAnnotatableBlock +from xblock_annotatable import AnnotatableBlock as _ExtractedAnnotatableBlock from openedx.core.djangolib.markup import HTML, Text from xmodule.editing_block import EditingMixin @@ -39,7 +39,7 @@ class _BuiltInAnnotatableBlock( .. deprecated:: 2026-03 This built-in annotatable block is deprecated. Please use the extracted ``AnnotatableBlock`` - from ``xblocks_contrib.annotatable`` instead. + from ``xblock_annotatable`` instead. """ is_extracted = False @@ -221,7 +221,7 @@ def reset_class(): warnings.warn( "The built-in `xmodule.annotatable_block` AnnotatableBlock implementation is deprecated. " "To fix this warning, enable `USE_EXTRACTED_ANNOTATABLE_BLOCK` (set it to True) to use " - "`xblocks_contrib.annotatable.AnnotatableBlock` instead. " + "`xblock_annotatable.AnnotatableBlock` instead. " "Support for the built-in implementation, and the `USE_EXTRACTED_ANNOTATABLE_BLOCK` setting, " "will be removed in Willow.", DeprecationWarning, diff --git a/xmodule/capa/safe_exec/remote_exec.py b/xmodule/capa/safe_exec/remote_exec.py index a700dfe5a199..d78ed05129ab 100644 --- a/xmodule/capa/safe_exec/remote_exec.py +++ b/xmodule/capa/safe_exec/remote_exec.py @@ -10,11 +10,11 @@ warnings.warn( "The 'xmodule.capa.safe_exec.remote_exec' module is deprecated and has been moved. " "Please update your CODE_JAIL_REST_SERVICE_REMOTE_EXEC setting to use " - "'xblocks_contrib.problem.capa.safe_exec.remote_exec.send_safe_exec_request_v0'. " + "'xblock_problem.capa.safe_exec.remote_exec.send_safe_exec_request_v0'. " "This stub will be removed in a future release.", DeprecationWarning, stacklevel=2, ) # Wildcard import to expose send_safe_exec_request_v0 and any other attributes -from xblocks_contrib.problem.capa.safe_exec.remote_exec import * # noqa: F403 +from xblock_problem.capa.safe_exec.remote_exec import * # noqa: F403 diff --git a/xmodule/capa_block.py b/xmodule/capa_block.py index 958ca1354142..46615d437d24 100644 --- a/xmodule/capa_block.py +++ b/xmodule/capa_block.py @@ -43,12 +43,12 @@ ) from xblock.progress import Progress from xblock.scorable import ScorableXBlockMixin, Score, ShowCorrectness -from xblocks_contrib.problem import ProblemBlock as _ExtractedProblemBlock -from xblocks_contrib.problem.capa import responsetypes -from xblocks_contrib.problem.capa.capa_problem import LoncapaProblem, LoncapaSystem -from xblocks_contrib.problem.capa.inputtypes import Status -from xblocks_contrib.problem.capa.responsetypes import LoncapaProblemError, ResponseError, StudentInputError -from xblocks_contrib.problem.capa.util import convert_files_to_filenames, get_inner_html_from_xpath +from xblock_problem import ProblemBlock as _ExtractedProblemBlock +from xblock_problem.capa import responsetypes +from xblock_problem.capa.capa_problem import LoncapaProblem, LoncapaSystem +from xblock_problem.capa.inputtypes import Status +from xblock_problem.capa.responsetypes import LoncapaProblemError, ResponseError, StudentInputError +from xblock_problem.capa.util import convert_files_to_filenames, get_inner_html_from_xpath from common.djangoapps.xblock_django.constants import ( ATTR_KEY_DEPRECATED_ANONYMOUS_USER_ID, @@ -156,7 +156,7 @@ class _BuiltInProblemBlock( # pylint: disable=too-many-public-methods,too-many- An XBlock representing a "problem". A problem contains zero or more respondable items, such as multiple choice, - numeric response, true/false, etc. See xblocks_contrib/problem/capa/responsetypes.py + numeric response, true/false, etc. In xblocks-core, see xblock_problem/capa/responsetypes.py for the full ensemble. The rendering logic of a problem is largely encapsulated within diff --git a/xmodule/discussion_block.py b/xmodule/discussion_block.py index a1fe42c41bef..b37ceb73d719 100644 --- a/xmodule/discussion_block.py +++ b/xmodule/discussion_block.py @@ -16,7 +16,7 @@ from xblock.fields import UNIQUE_ID, Scope, String from xblock.utils.resources import ResourceLoader from xblock.utils.studio_editable import StudioEditableXBlockMixin -from xblocks_contrib.discussion import DiscussionXBlock as _ExtractedDiscussionXBlock +from xblock_discussion import DiscussionXBlock as _ExtractedDiscussionXBlock from openedx.core.djangolib.markup import HTML, Text from openedx.core.lib.xblock_utils import get_css_dependencies, get_js_dependencies diff --git a/xmodule/html_block.py b/xmodule/html_block.py index 0532aef3964d..c6248f930bd7 100644 --- a/xmodule/html_block.py +++ b/xmodule/html_block.py @@ -16,8 +16,8 @@ from web_fragments.fragment import Fragment from xblock.core import XBlock from xblock.fields import Boolean, List, Scope, String -from xblocks_contrib.html import HtmlBlock as _ExtractedHtmlBlock -from xblocks_contrib.html import HtmlBlockMixin as _ExtractedHtmlBlockMixin +from xblock_html import HtmlBlock as _ExtractedHtmlBlock +from xblock_html import HtmlBlockMixin as _ExtractedHtmlBlockMixin from common.djangoapps.xblock_django.constants import ATTR_KEY_DEPRECATED_ANONYMOUS_USER_ID from xmodule.contentstore.content import StaticContent @@ -50,7 +50,7 @@ class _BuiltinHtmlBlockMixin( # pylint: disable=abstract-method .. deprecated:: 2026-03 This built-in HTML block mixin is deprecated. Please use the extracted ``HtmlBlockMixin`` - from ``xblocks_contrib.html`` instead. + from ``xblock_html`` instead. """ display_name = String( @@ -378,7 +378,7 @@ class _BuiltInHtmlBlock(_BuiltinHtmlBlockMixin): # pylint: disable=abstract-met .. deprecated:: 2026-03 This built-in HTML block is deprecated. Please use the extracted ``HtmlBlock`` - from ``xblocks_contrib.html`` instead. + from ``xblock_html`` instead. """ is_extracted = False @@ -551,7 +551,7 @@ def reset_class(): warnings.warn( "The built-in `xmodule.html_block` HtmlBlock implementation is deprecated. " "To fix this warning, enable `USE_EXTRACTED_HTML_BLOCK` (set it to True) to use " - "`xblocks_contrib.html.HtmlBlock` instead. " + "`xblock_html.HtmlBlock` instead. " "Support for the built-in implementation, and the `USE_EXTRACTED_HTML_BLOCK` setting, " "will be removed in Willow.", DeprecationWarning, diff --git a/xmodule/library_content_block.py b/xmodule/library_content_block.py index 2c72c5ebe64a..142c833ac495 100644 --- a/xmodule/library_content_block.py +++ b/xmodule/library_content_block.py @@ -22,7 +22,7 @@ from webob import Response from xblock.core import XBlock from xblock.fields import Boolean, Scope, String -from xblocks_contrib.problem.capa.responsetypes import registry +from xblock_problem.capa.responsetypes import registry from xmodule.item_bank_block import ItemBankMixin from xmodule.modulestore.django import modulestore diff --git a/xmodule/lti_block.py b/xmodule/lti_block.py index cad3df090d79..a8e6b48a06cc 100644 --- a/xmodule/lti_block.py +++ b/xmodule/lti_block.py @@ -75,7 +75,7 @@ from webob import Response from xblock.core import List, Scope, String, XBlock from xblock.fields import Boolean, Float -from xblocks_contrib.lti import LTIBlock as _ExtractedLTIBlock +from xblock_lti import LTIBlock as _ExtractedLTIBlock from common.djangoapps.xblock_django.constants import ATTR_KEY_ANONYMOUS_USER_ID, ATTR_KEY_USER_ROLE from openedx.core.djangolib.markup import HTML, Text @@ -285,7 +285,7 @@ class _BuiltInLTIBlock( .. deprecated:: 2026-03 This built-in LTI block is deprecated. Please use the extracted ``LTIBlock`` - from ``xblocks_contrib.lti`` instead. + from ``xblock_lti`` instead. Except usual Xmodule structure it proceeds with OAuth signing. How it works:: @@ -1008,7 +1008,7 @@ def reset_class(): warnings.warn( "The built-in `xmodule.lti_block` LTIBlock implementation is deprecated. " "To fix this warning, enable `USE_EXTRACTED_LTI_BLOCK` (set it to True) to use " - "`xblocks_contrib.lti.LTIBlock` instead. " + "`xblock_lti.LTIBlock` instead. " "Support for the built-in implementation, and the `USE_EXTRACTED_LTI_BLOCK` setting, " "will be removed in Willow.", DeprecationWarning, diff --git a/xmodule/modulestore/tests/test_api.py b/xmodule/modulestore/tests/test_api.py index afaf4273790c..9b6e32fa45dd 100644 --- a/xmodule/modulestore/tests/test_api.py +++ b/xmodule/modulestore/tests/test_api.py @@ -26,7 +26,7 @@ def test_get_root_module_name(): """ assert get_root_module_name(LtiConsumerXBlock) == 'lti_consumer' - expected_root_module = 'xblocks_contrib' if settings.USE_EXTRACTED_VIDEO_BLOCK else 'xmodule' + expected_root_module = 'xblock_video' if settings.USE_EXTRACTED_VIDEO_BLOCK else 'xmodule' assert get_root_module_name(VideoBlock) == expected_root_module assert get_root_module_name(DoneXBlock) == 'done' diff --git a/xmodule/poll_block.py b/xmodule/poll_block.py index 8a25fd476fe4..587ed3e0c7b6 100644 --- a/xmodule/poll_block.py +++ b/xmodule/poll_block.py @@ -18,7 +18,7 @@ from web_fragments.fragment import Fragment from xblock.core import XBlock from xblock.fields import Boolean, Dict, List, Scope, String # pylint: disable=wrong-import-order -from xblocks_contrib.poll import PollBlock as _ExtractedPollBlock +from xblock_poll_question import PollBlock as _ExtractedPollBlock from openedx.core.djangolib.markup import HTML, Text from xmodule.mako_block import MakoTemplateBlockBase @@ -43,8 +43,9 @@ class _BuiltInPollBlock( Poll Block. .. deprecated:: 2026-03 - This built-in poll block is deprecated. Please use the extracted ``PollBlock`` - from ``xblocks_contrib.poll`` instead. + This built-in poll block will soon be removed. Please use the extracted ``PollBlock`` + from ``xblock_poll_question`` instead, which is unsupported but stable. Alternatively, use + https://github.com/open-craft/xblock-poll instead, which is supported and stable. """ is_extracted = False @@ -270,7 +271,7 @@ def reset_class(): warnings.warn( "The built-in `xmodule.poll_block` PollBlock implementation is deprecated. " "To fix this warning, enable `USE_EXTRACTED_POLL_QUESTION_BLOCK` (set it to True) to use " - "`xblocks_contrib.poll.PollBlock` instead. " + "`xblock_poll_question.PollBlock` instead. " "Support for the built-in implementation, and the `USE_EXTRACTED_POLL_QUESTION_BLOCK` setting, " "will be removed in Willow.", DeprecationWarning, diff --git a/xmodule/services.py b/xmodule/services.py index 55e3b1a37a96..068cf2c9f39c 100644 --- a/xmodule/services.py +++ b/xmodule/services.py @@ -16,7 +16,7 @@ from requests.auth import HTTPBasicAuth from xblock.reference.plugins import Service from xblock.runtime import KvsFieldData -from xblocks_contrib.problem.capa.xqueue_interface import XQueueInterface +from xblock_problem.capa.xqueue_interface import XQueueInterface from common.djangoapps.track import contexts from lms.djangoapps.courseware.field_overrides import OverrideFieldData diff --git a/xmodule/tests/test_capa_block.py b/xmodule/tests/test_capa_block.py index 49860b8fa3cc..6f2146ac18eb 100644 --- a/xmodule/tests/test_capa_block.py +++ b/xmodule/tests/test_capa_block.py @@ -26,11 +26,11 @@ from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from xblock.scorable import Score -from xblocks_contrib.problem.capa import responsetypes -from xblocks_contrib.problem.capa.correctmap import CorrectMap -from xblocks_contrib.problem.capa.responsetypes import LoncapaProblemError, ResponseError, StudentInputError -from xblocks_contrib.problem.capa.tests.test_util import UseUnsafeCodejail -from xblocks_contrib.problem.capa.xqueue_interface import XQueueInterface +from xblock_problem.capa import responsetypes +from xblock_problem.capa.correctmap import CorrectMap +from xblock_problem.capa.responsetypes import LoncapaProblemError, ResponseError, StudentInputError +from xblock_problem.capa.tests.test_util import UseUnsafeCodejail +from xblock_problem.capa.xqueue_interface import XQueueInterface from lms.djangoapps.courseware.user_state_client import XBlockUserState from openedx.core.djangolib.testing.utils import skip_unless_lms @@ -809,7 +809,7 @@ def test_submit_problem_correct(self): # Simulate that all answers are marked correct, no matter # what the input is, by patching CorrectMap.is_correct() # Also simulate rendering the HTML - with patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: + with patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: with patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") as mock_html: mock_is_correct.return_value = True mock_html.return_value = "Test HTML" @@ -829,7 +829,7 @@ def test_submit_problem_correct(self): # and that this was considered attempt number 2 for grading purposes assert block.lcp.context["attempt"] == 2 - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_with_grading_method_disable(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -869,7 +869,7 @@ def test_submit_problem_with_grading_method_disable(self, mock_html: Mock, mock_ assert block.lcp.context["attempt"] == 3 assert block.score == Score(raw_earned=1, raw_possible=1) - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_with_grading_method_enable(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -891,7 +891,7 @@ def test_submit_problem_with_grading_method_enable(self, mock_html: Mock, mock_i assert block.score == Score(raw_earned=1, raw_possible=1) mock_get_score.assert_called() - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_grading_method_always_enabled(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -944,7 +944,7 @@ def test_submit_problem_grading_method_always_enabled(self, mock_html: Mock, moc assert block.lcp.context["attempt"] == 4 assert block.score == Score(raw_earned=1, raw_possible=1) - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_grading_method_always_enabled_highest_score(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -997,7 +997,7 @@ def test_submit_problem_grading_method_always_enabled_highest_score(self, mock_h assert block.lcp.context["attempt"] == 4 assert block.score == Score(raw_earned=1, raw_possible=1) - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_correct_last_score(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -1030,7 +1030,7 @@ def test_submit_problem_correct_last_score(self, mock_html: Mock, mock_is_correc assert block.lcp.context["attempt"] == 2 assert block.score == Score(raw_earned=0, raw_possible=1) - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_correct_highest_score(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -1062,7 +1062,7 @@ def test_submit_problem_correct_highest_score(self, mock_html: Mock, mock_is_cor assert block.lcp.context["attempt"] == 2 assert block.score == Score(raw_earned=1, raw_possible=1) - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_correct_first_score(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -1094,7 +1094,7 @@ def test_submit_problem_correct_first_score(self, mock_html: Mock, mock_is_corre assert block.lcp.context["attempt"] == 2 assert block.score == Score(raw_earned=0, raw_possible=1) - @patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") + @patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") @patch("xmodule.capa_block._BuiltInProblemBlock.get_problem_html") def test_submit_problem_correct_average_score(self, mock_html: Mock, mock_is_correct: Mock): """ @@ -1152,7 +1152,7 @@ def test_submit_problem_incorrect(self): block = CapaFactory.create(attempts=0) # Simulate marking the input incorrect - with patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: + with patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: mock_is_correct.return_value = False # Check the problem @@ -1221,7 +1221,7 @@ def test_submit_problem_queued(self): # Simulate that the problem is queued multipatch = patch.multiple( - "xblocks_contrib.problem.capa.capa_problem.LoncapaProblem", + "xblock_problem.capa.capa_problem.LoncapaProblem", is_queued=DEFAULT, get_recentmost_queuetime=DEFAULT, ) @@ -1351,7 +1351,7 @@ def test_submit_problem_error(self): block = CapaFactory.create(attempts=1, user_is_staff=False) # Simulate answering a problem that raises the exception - with patch("xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: + with patch("xblock_problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: mock_grade.side_effect = exception_class("test error") get_request_dict = {CapaFactory.input_key(): "3.14"} @@ -1378,7 +1378,7 @@ def test_submit_problem_error_with_codejail_exception(self): block = CapaFactory.create(attempts=1, user_is_staff=False) # Simulate a codejail exception "Exception: Couldn't execute jailed code" - with patch("xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: + with patch("xblock_problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: try: raise ResponseError( "Couldn't execute jailed code: stdout: '', " @@ -1414,7 +1414,7 @@ def test_submit_problem_other_errors(self): block.runtime.is_author_mode = True # Simulate answering a problem that raises the exception - with patch("xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: + with patch("xblock_problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: error_msg = "Superterrible error happened: ☠" mock_grade.side_effect = Exception(error_msg) @@ -1448,7 +1448,7 @@ def test_submit_problem_error_nonascii(self): block = CapaFactory.create(attempts=1, user_is_staff=False) # Simulate answering a problem that raises the exception - with patch("xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: + with patch("xblock_problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: mock_grade.side_effect = exception_class("ȧƈƈḗƞŧḗḓ ŧḗẋŧ ƒǿř ŧḗşŧīƞɠ") get_request_dict = {CapaFactory.input_key(): "3.14"} @@ -1473,7 +1473,7 @@ def test_submit_problem_error_with_staff_user(self): block = CapaFactory.create(attempts=1, user_is_staff=True) # Simulate answering a problem that raises an exception - with patch("xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: + with patch("xblock_problem.capa.capa_problem.LoncapaProblem.grade_answers") as mock_grade: mock_grade.side_effect = exception_class("test error") get_request_dict = {CapaFactory.input_key(): "3.14"} @@ -1504,7 +1504,7 @@ def test_handle_ajax_show_correctness(self, show_correctness, is_correct, expect block = CapaFactory.create(show_correctness=show_correctness, due=self.tomorrow_str, correct=is_correct) # Simulate marking the input correct/incorrect - with patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: + with patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: mock_is_correct.return_value = is_correct # Check the problem @@ -1580,14 +1580,14 @@ def test_rescore_problem_correct(self): # Simulate that all answers are marked correct, no matter # what the input is, by patching LoncapaResponse.evaluate_answers() with patch( - "xblocks_contrib.problem.capa.responsetypes.LoncapaResponse.evaluate_answers" + "xblock_problem.capa.responsetypes.LoncapaResponse.evaluate_answers" ) as mock_evaluate_answers: mock_evaluate_answers.return_value = CorrectMap( answer_id=CapaFactory.answer_key(), correctness="correct", npoints=1, ) - with patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: + with patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: mock_is_correct.return_value = True # Check the problem @@ -1628,10 +1628,10 @@ def test_rescore_problem_additional_correct(self): # In case of rescore with only_if_higher=True it should update score of block # if previous score was lower - with patch("xblocks_contrib.problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: + with patch("xblock_problem.capa.correctmap.CorrectMap.is_correct") as mock_is_correct: mock_is_correct.return_value = True block.set_score(block.score_from_lcp(block.lcp)) - with patch("xblocks_contrib.problem.capa.responsetypes.NumericalResponse.get_staff_ans") as get_staff_ans: + with patch("xblock_problem.capa.responsetypes.NumericalResponse.get_staff_ans") as get_staff_ans: get_staff_ans.return_value = 1 + 0j block.rescore(only_if_higher=True) @@ -1652,7 +1652,7 @@ def test_rescore_problem_incorrect(self): # Simulate that all answers are marked incorrect, no matter # what the input is, by patching LoncapaResponse.evaluate_answers() with patch( - "xblocks_contrib.problem.capa.responsetypes.LoncapaResponse.evaluate_answers" + "xblock_problem.capa.responsetypes.LoncapaResponse.evaluate_answers" ) as mock_evaluate_answers: mock_evaluate_answers.return_value = CorrectMap(CapaFactory.answer_key(), "incorrect") block.rescore(only_if_higher=False) @@ -1833,7 +1833,7 @@ def test_rescore_problem_not_supported(self): # Try to rescore the problem, and get exception with patch( - "xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.supports_rescoring" + "xblock_problem.capa.capa_problem.LoncapaProblem.supports_rescoring" ) as mock_supports_rescoring: mock_supports_rescoring.return_value = False with pytest.raises(NotImplementedError): @@ -2003,7 +2003,7 @@ def test_codejail_error_upon_problem_creation(self): # When codejail safe_exec fails upon problem creation, a LoncapaProblemError should be raised. with pytest.raises(LoncapaProblemError): # noqa: PT012 - with patch("xblocks_contrib.problem.capa.capa_problem.safe_exec") as mock_safe_exec: + with patch("xblock_problem.capa.capa_problem.safe_exec") as mock_safe_exec: mock_safe_exec.side_effect = SafeExecException() factory.create() @@ -2019,7 +2019,7 @@ def _rescore_problem_error_helper(self, exception_class): # Simulate answering a problem that raises the exception with patch( - "xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.get_grade_from_current_answers" + "xblock_problem.capa.capa_problem.LoncapaProblem.get_grade_from_current_answers" ) as mock_rescore: mock_rescore.side_effect = exception_class("test error \u03a9") with pytest.raises(exception_class): @@ -2292,7 +2292,7 @@ def test_get_problem_html(self, render_template): block.should_show_save_button = Mock(return_value=show_save_button) # Patch the capa problem's HTML rendering - with patch("xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.get_html") as mock_html: + with patch("xblock_problem.capa.capa_problem.LoncapaProblem.get_html") as mock_html: mock_html.return_value = "
Test Problem HTML
" # Render the problem HTML @@ -4058,11 +4058,11 @@ class ProblemBlockReportGenerationTest(unittest.TestCase): def setUp(self): self.find_question_label_patcher = patch( - "xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.find_question_label", + "xblock_problem.capa.capa_problem.LoncapaProblem.find_question_label", lambda self, answer_id: answer_id, ) self.find_answer_text_patcher = patch( - "xblocks_contrib.problem.capa.capa_problem.LoncapaProblem.find_answer_text", + "xblock_problem.capa.capa_problem.LoncapaProblem.find_answer_text", lambda self, answer_id, current_answer: current_answer, ) self.find_question_label_patcher.start() diff --git a/xmodule/tests/test_lti20_unit.py b/xmodule/tests/test_lti20_unit.py index 7fd67d3e4b8f..c5657362dffe 100644 --- a/xmodule/tests/test_lti20_unit.py +++ b/xmodule/tests/test_lti20_unit.py @@ -9,7 +9,7 @@ from django.conf import settings from django.test import TestCase, override_settings from xblock.field_data import DictFieldData -from xblocks_contrib.lti.lti_2_util import LTIError as ExtractedLTIError +from xblock_lti.lti_2_util import LTIError as ExtractedLTIError from xmodule import lti_block from xmodule.lti_2_util import LTIError as BuiltInLTIError diff --git a/xmodule/tests/test_lti_unit.py b/xmodule/tests/test_lti_unit.py index 0840ffc7d5c1..479f5df46817 100644 --- a/xmodule/tests/test_lti_unit.py +++ b/xmodule/tests/test_lti_unit.py @@ -17,7 +17,7 @@ from webob.request import Request from xblock.field_data import DictFieldData from xblock.fields import ScopeIds, Timedelta -from xblocks_contrib.lti.lti_2_util import LTIError as ExtractedLTIError +from xblock_lti.lti_2_util import LTIError as ExtractedLTIError from common.djangoapps.xblock_django.constants import ATTR_KEY_ANONYMOUS_USER_ID from xmodule import lti_block diff --git a/xmodule/tests/test_services.py b/xmodule/tests/test_services.py index 456d5627e438..4015cbd45b4d 100644 --- a/xmodule/tests/test_services.py +++ b/xmodule/tests/test_services.py @@ -13,7 +13,7 @@ from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator from xblock.fields import ScopeIds from xblock.runtime import Mixologist -from xblocks_contrib.problem.capa.xqueue_interface import XQueueInterface +from xblock_problem.capa.xqueue_interface import XQueueInterface from openedx.core.djangolib.testing.utils import skip_unless_lms from openedx.core.lib.teams_config import TeamsConfig diff --git a/xmodule/video_block/video_block.py b/xmodule/video_block/video_block.py index 955ecad66363..0b7cf74c8197 100644 --- a/xmodule/video_block/video_block.py +++ b/xmodule/video_block/video_block.py @@ -31,10 +31,10 @@ from xblock.fields import ScopeIds from xblock.runtime import KvsFieldData from xblock.utils.resources import ResourceLoader -from xblocks_contrib.video import VideoBlock as _ExtractedVideoBlock -from xblocks_contrib.video.bumper_utils import bumperize -from xblocks_contrib.video.exceptions import TranscriptNotFoundError -from xblocks_contrib.video.video_handlers import VideoStudentViewHandlers, VideoStudioViewHandlers +from xblock_video import VideoBlock as _ExtractedVideoBlock +from xblock_video.bumper_utils import bumperize +from xblock_video.exceptions import TranscriptNotFoundError +from xblock_video.video_handlers import VideoStudentViewHandlers, VideoStudioViewHandlers from common.djangoapps.xblock_django.constants import ATTR_KEY_REQUEST_COUNTRY_CODE, ATTR_KEY_USER_ID from openedx.core.djangoapps.video_config.transcripts_utils import ( @@ -121,7 +121,7 @@ class _BuiltInVideoBlock( .. deprecated:: 2026-03 This built-in video block is deprecated. Please use the extracted ``VideoBlock`` - from ``xblocks_contrib.video`` instead. + from ``xblock_video`` instead. """ is_extracted = False has_custom_completion = True @@ -1202,7 +1202,7 @@ def _poster(self): warnings.warn( "The built-in `xmodule.video_block` VideoBlock implementation is deprecated. " "To fix this warning, enable `USE_EXTRACTED_VIDEO_BLOCK` (set it to True) to use " - "`xblocks_contrib.video.VideoBlock` instead. " + "`xblock_video.VideoBlock` instead. " "Support for the built-in implementation, and the `USE_EXTRACTED_VIDEO_BLOCK` setting, " "will be removed in Willow.", DeprecationWarning, diff --git a/xmodule/word_cloud_block.py b/xmodule/word_cloud_block.py index baa13a74b126..784a7419ef47 100644 --- a/xmodule/word_cloud_block.py +++ b/xmodule/word_cloud_block.py @@ -14,7 +14,7 @@ from web_fragments.fragment import Fragment from xblock.core import XBlock from xblock.fields import Boolean, Dict, Integer, List, Scope, String -from xblocks_contrib.word_cloud import WordCloudBlock as _ExtractedWordCloudBlock +from xblock_word_cloud import WordCloudBlock as _ExtractedWordCloudBlock from xmodule.editing_block import EditingMixin from xmodule.raw_block import EmptyDataRawMixin @@ -53,7 +53,7 @@ class _BuiltInWordCloudBlock( # pylint: disable=abstract-method .. deprecated:: 2026-03 This built-in word cloud block is deprecated. Please use the extracted ``WordCloudBlock`` - from ``xblocks_contrib.word_cloud`` instead. + from ``xblock_word_cloud`` instead. """ is_extracted = False @@ -334,7 +334,7 @@ def reset_class(): warnings.warn( "The built-in `xmodule.word_cloud_block` WordCloudBlock implementation is deprecated. " "To fix this warning, enable `USE_EXTRACTED_WORD_CLOUD_BLOCK` (set it to True) to use " - "`xblocks_contrib.word_cloud.WordCloudBlock` instead. " + "`xblock_word_cloud.WordCloudBlock` instead. " "Support for the built-in implementation, and the `USE_EXTRACTED_WORD_CLOUD_BLOCK` setting, " "will be removed in Willow.", DeprecationWarning,