Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/rest_api/v2/views/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/transcript_storage_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cms/djangoapps/contentstore/views/transcripts_ajax.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/ccx/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/courseware/block_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/courseware/tests/test_block_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/courseware/tests/test_entrance_exam.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,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 (
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/courseware/tests/test_masquerade.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lms/djangoapps/courseware/tests/test_submitting_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/courseware/tests/test_video_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lms/djangoapps/courseware/tests/test_video_mongo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2328,7 +2328,7 @@ class TestVideoWithBumper(TestVideo): # pylint: disable=test-inherits-tests
# Use temporary FEATURES in this test without affecting the original
FEATURES = dict(settings.FEATURES)

@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
Expand All @@ -2353,8 +2353,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
Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/courseware/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2024,7 +2024,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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/grades/tests/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/grades/tests/integration/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/grades/tests/integration/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/grades/tests/integration/test_problems.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/tests/test_enrollment.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor/tests/test_spoc_gradebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lms/djangoapps/instructor_task/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions lms/djangoapps/instructor_task/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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"])

Expand Down
4 changes: 2 additions & 2 deletions lms/djangoapps/instructor_task/tests/test_tasks_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)

Expand Down Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/content/block_structure/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion openedx/core/djangoapps/discussions/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/video_config/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions openedx/core/djangoapps/video_config/transcripts_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading