diff --git a/cms/djangoapps/contentstore/tests/test_contentstore.py b/cms/djangoapps/contentstore/tests/test_contentstore.py index 3bfd307345..847b4eeeec 100644 --- a/cms/djangoapps/contentstore/tests/test_contentstore.py +++ b/cms/djangoapps/contentstore/tests/test_contentstore.py @@ -37,7 +37,7 @@ from xmodule.modulestore.inheritance import own_metadata from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory, check_mongo_calls from xmodule.modulestore.xml_exporter import export_course_to_xml from xmodule.modulestore.xml_importer import import_course_from_xml, perform_xlint -from xmodule.seq_module import SequenceBlock +from xmodule.seq_block import SequenceBlock from xmodule.video_module import VideoBlock from cms.djangoapps.contentstore.config import waffle diff --git a/cms/djangoapps/contentstore/tests/test_crud.py b/cms/djangoapps/contentstore/tests/test_crud.py index 1ae40b0dfd..371e9fd35d 100644 --- a/cms/djangoapps/contentstore/tests/test_crud.py +++ b/cms/djangoapps/contentstore/tests/test_crud.py @@ -9,7 +9,7 @@ from xmodule.modulestore import ModuleStoreEnum from xmodule.modulestore.exceptions import DuplicateCourseError from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory -from xmodule.seq_module import SequenceBlock +from xmodule.seq_block import SequenceBlock class TemplateTests(ModuleStoreTestCase): diff --git a/cms/djangoapps/contentstore/views/tests/test_course_index.py b/cms/djangoapps/contentstore/views/tests/test_course_index.py index e05b500a7d..a954a34632 100644 --- a/cms/djangoapps/contentstore/views/tests/test_course_index.py +++ b/cms/djangoapps/contentstore/views/tests/test_course_index.py @@ -813,7 +813,7 @@ class TestCourseReIndex(CourseTestCase): with self.assertRaises(SearchIndexingError): reindex_course_and_check_access(self.course.id, self.user) - @mock.patch('xmodule.seq_module.SequenceBlock.index_dictionary') + @mock.patch('xmodule.seq_block.SequenceBlock.index_dictionary') def test_reindex_seq_error_json_responses(self, mock_index_dictionary): """ Test json response with mocked error data for sequence @@ -923,7 +923,7 @@ class TestCourseReIndex(CourseTestCase): with self.assertRaises(SearchIndexingError): CoursewareSearchIndexer.do_course_reindex(modulestore(), self.course.id) - @mock.patch('xmodule.seq_module.SequenceBlock.index_dictionary') + @mock.patch('xmodule.seq_block.SequenceBlock.index_dictionary') def test_indexing_seq_error_responses(self, mock_index_dictionary): """ Test do_course_reindex response with mocked error data for sequence diff --git a/lms/djangoapps/course_blocks/transformers/hidden_content.py b/lms/djangoapps/course_blocks/transformers/hidden_content.py index b0bbd7f137..e82d8d3441 100644 --- a/lms/djangoapps/course_blocks/transformers/hidden_content.py +++ b/lms/djangoapps/course_blocks/transformers/hidden_content.py @@ -8,7 +8,7 @@ from datetime import datetime from pytz import utc from openedx.core.djangoapps.content.block_structure.transformer import BlockStructureTransformer -from xmodule.seq_module import SequenceBlock # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.seq_block import SequenceBlock # lint-amnesty, pylint: disable=wrong-import-order from .utils import collect_merged_boolean_field, collect_merged_date_field diff --git a/lms/djangoapps/courseware/tests/test_module_render.py b/lms/djangoapps/courseware/tests/test_module_render.py index 8a4b0f4391..363de536d7 100644 --- a/lms/djangoapps/courseware/tests/test_module_render.py +++ b/lms/djangoapps/courseware/tests/test_module_render.py @@ -920,7 +920,7 @@ class TestHandleXBlockCallback(SharedModuleStoreTestCase, LoginEnrollmentTestCas assert not mock_score_signal.called @ddt.data( - # See seq_module.py for the definition of these handlers + # See seq_block.py for the definition of these handlers ('get_completion', True), # has the 'will_recheck_access' attribute set to True ('goto_position', False), # does not set it ) diff --git a/lms/djangoapps/courseware/views/index.py b/lms/djangoapps/courseware/views/index.py index 407874112e..b51cc00a59 100644 --- a/lms/djangoapps/courseware/views/index.py +++ b/lms/djangoapps/courseware/views/index.py @@ -561,17 +561,17 @@ def render_accordion(request, course, table_of_contents): return render_to_string('courseware/accordion.html', context) -def save_child_position(seq_module, child_name): +def save_child_position(seq_block, child_name): """ child_name: url_name of the child """ - for position, child in enumerate(seq_module.get_display_items(), start=1): + for position, child in enumerate(seq_block.get_display_items(), start=1): if child.location.block_id == child_name: # Only save if position changed - if position != seq_module.position: - seq_module.position = position + if position != seq_block.position: + seq_block.position = position # Save this new position to the underlying KeyValueStore - seq_module.save() + seq_block.save() def save_positions_recursively_up(user, request, field_data_cache, xmodule, course=None): diff --git a/lms/djangoapps/gating/tests/test_integration.py b/lms/djangoapps/gating/tests/test_integration.py index b58073f5c2..608231c2a1 100644 --- a/lms/djangoapps/gating/tests/test_integration.py +++ b/lms/djangoapps/gating/tests/test_integration.py @@ -149,7 +149,7 @@ class TestGatedContent(MilestonesTestCaseMixin, SharedModuleStoreTestCase): # access to gating content (seq1) remains constant assert bool(has_access(user, 'load', self.seq1, self.course.id)) - # access to gated content (seq2) remains constant, access is prevented in SeqModule loading + # access to gated content (seq2) remains constant, access is prevented in SeqBlock loading assert bool(has_access(user, 'load', self.seq2, self.course.id)) def assert_user_has_prereq_milestone(self, user, expected_has_milestone): diff --git a/lms/templates/seq_module.html b/lms/templates/seq_block.html similarity index 100% rename from lms/templates/seq_module.html rename to lms/templates/seq_block.html diff --git a/openedx/core/lib/xblock_utils/__init__.py b/openedx/core/lib/xblock_utils/__init__.py index ca881bd02d..1674b2757f 100644 --- a/openedx/core/lib/xblock_utils/__init__.py +++ b/openedx/core/lib/xblock_utils/__init__.py @@ -28,7 +28,7 @@ from xblock.scorable import ScorableXBlockMixin from common.djangoapps import static_replace from common.djangoapps.edxmako.shortcuts import render_to_string -from xmodule.seq_module import SequenceBlock # lint-amnesty, pylint: disable=wrong-import-order +from xmodule.seq_block import SequenceBlock # lint-amnesty, pylint: disable=wrong-import-order from xmodule.util.xmodule_django import add_webpack_to_fragment # lint-amnesty, pylint: disable=wrong-import-order from xmodule.vertical_block import VerticalBlock # lint-amnesty, pylint: disable=wrong-import-order from xmodule.x_module import ( # lint-amnesty, pylint: disable=wrong-import-order diff --git a/setup.py b/setup.py index 5b3bfe4486..db9bdf31e1 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ XBLOCKS = [ "about = xmodule.html_block:AboutBlock", "book = xmodule.template_module:TranslateCustomTagBlock", "annotatable = xmodule.annotatable_block:AnnotatableBlock", - "chapter = xmodule.seq_module:SectionBlock", + "chapter = xmodule.seq_block:SectionBlock", "conditional = xmodule.conditional_block:ConditionalBlock", "course = xmodule.course_block:CourseBlock", "course_info = xmodule.html_block:CourseInfoBlock", @@ -27,7 +27,7 @@ XBLOCKS = [ "poll_question = xmodule.poll_block:PollBlock", "problem = xmodule.capa_block:ProblemBlock", "randomize = xmodule.randomize_block:RandomizeBlock", - "sequential = xmodule.seq_module:SequenceBlock", + "sequential = xmodule.seq_block:SequenceBlock", "slides = xmodule.template_module:TranslateCustomTagBlock", "split_test = xmodule.split_test_module:SplitTestBlock", "static_tab = xmodule.html_block:StaticTabBlock", diff --git a/xmodule/conditional_block.py b/xmodule/conditional_block.py index 76296cdc37..3422a892ce 100644 --- a/xmodule/conditional_block.py +++ b/xmodule/conditional_block.py @@ -17,7 +17,7 @@ from xblock.fields import ReferenceList, Scope, String from openedx.core.djangolib.markup import HTML, Text from xmodule.mako_block import MakoTemplateBlockBase from xmodule.modulestore.exceptions import ItemNotFoundError -from xmodule.seq_module import SequenceMixin +from xmodule.seq_block import SequenceMixin from xmodule.studio_editable import StudioEditableBlock from xmodule.util.xmodule_django import add_webpack_to_fragment from xmodule.validation import StudioValidation, StudioValidationMessage diff --git a/xmodule/course_block.py b/xmodule/course_block.py index 99ff1e84cd..406c6a17d1 100644 --- a/xmodule/course_block.py +++ b/xmodule/course_block.py @@ -23,7 +23,7 @@ from xmodule import course_metadata_utils from xmodule.course_metadata_utils import DEFAULT_GRADING_POLICY, DEFAULT_START_DATE from xmodule.data import CertificatesDisplayBehaviors from xmodule.graders import grader_from_conf -from xmodule.seq_module import SequenceBlock +from xmodule.seq_block import SequenceBlock from xmodule.tabs import CourseTabList, InvalidTabsException from .fields import Date diff --git a/xmodule/randomize_block.py b/xmodule/randomize_block.py index cfa1a5424c..15b6bc0f36 100644 --- a/xmodule/randomize_block.py +++ b/xmodule/randomize_block.py @@ -8,7 +8,7 @@ from lxml import etree from web_fragments.fragment import Fragment from xblock.fields import Integer, Scope from xmodule.mako_block import MakoTemplateBlockBase -from xmodule.seq_module import SequenceMixin +from xmodule.seq_block import SequenceMixin from xmodule.xml_module import XmlMixin from xmodule.x_module import ( HTMLSnippet, diff --git a/xmodule/seq_module.py b/xmodule/seq_block.py similarity index 99% rename from xmodule/seq_module.py rename to xmodule/seq_block.py index ddeeaf42d8..bd5cba7a01 100644 --- a/xmodule/seq_module.py +++ b/xmodule/seq_block.py @@ -615,7 +615,7 @@ class SequenceBlock( parent_block_id = self.get_parent().scope_ids.usage_id.block_id params['chapter_completion_aggregator_url'] = '/'.join( [settings.COMPLETION_AGGREGATOR_URL, str(self.scope_ids.usage_id.context_key), parent_block_id]) + '/' - fragment.add_content(self.runtime.service(self, 'mako').render_template("seq_module.html", params)) + fragment.add_content(self.runtime.service(self, 'mako').render_template("seq_block.html", params)) self._capture_full_seq_item_metrics(display_items) self._capture_current_unit_metrics(display_items) diff --git a/xmodule/split_test_module.py b/xmodule/split_test_module.py index 763835d302..51ce967a15 100644 --- a/xmodule/split_test_module.py +++ b/xmodule/split_test_module.py @@ -20,7 +20,7 @@ from xblock.fields import Integer, ReferenceValueDict, Scope, String from xmodule.mako_block import MakoTemplateBlockBase from xmodule.modulestore.inheritance import UserPartitionList from xmodule.progress import Progress -from xmodule.seq_module import ProctoringFields, SequenceMixin +from xmodule.seq_block import ProctoringFields, SequenceMixin from xmodule.studio_editable import StudioEditableBlock from xmodule.util.xmodule_django import add_webpack_to_fragment from xmodule.validation import StudioValidation, StudioValidationMessage diff --git a/xmodule/static_content.py b/xmodule/static_content.py index ff586869e8..d3ef5a4781 100755 --- a/xmodule/static_content.py +++ b/xmodule/static_content.py @@ -26,7 +26,7 @@ from xmodule.html_block import AboutBlock, CourseInfoBlock, HtmlBlock, StaticTab from xmodule.library_content_block import LibraryContentBlock from xmodule.lti_block import LTIBlock from xmodule.poll_block import PollBlock -from xmodule.seq_module import SequenceBlock +from xmodule.seq_block import SequenceBlock from xmodule.split_test_module import SplitTestBlock from xmodule.template_module import CustomTagBlock from xmodule.word_cloud_module import WordCloudBlock diff --git a/xmodule/tests/__init__.py b/xmodule/tests/__init__.py index f268f33b49..4bdb43c9bb 100644 --- a/xmodule/tests/__init__.py +++ b/xmodule/tests/__init__.py @@ -183,7 +183,7 @@ class ModelsTest(unittest.TestCase): # lint-amnesty, pylint: disable=missing-cl def test_load_class(self): vc = XBlock.load_class('sequential') - vc_str = "" + vc_str = "" assert str(vc) == vc_str diff --git a/xmodule/tests/test_sequence.py b/xmodule/tests/test_sequence.py index bf0e16fb1e..1fb744635c 100644 --- a/xmodule/tests/test_sequence.py +++ b/xmodule/tests/test_sequence.py @@ -18,7 +18,7 @@ from web_fragments.fragment import Fragment from edx_toggles.toggles.testutils import override_waffle_flag from openedx.features.content_type_gating.models import ContentTypeGatingConfig -from xmodule.seq_module import TIMED_EXAM_GATING_WAFFLE_FLAG, SequenceBlock +from xmodule.seq_block import TIMED_EXAM_GATING_WAFFLE_FLAG, SequenceBlock from xmodule.tests import get_test_system from xmodule.tests.helpers import StubUserService from xmodule.tests.xml import XModuleXmlImportTest @@ -141,9 +141,9 @@ class SequenceBlockTestCase(XModuleXmlImportTest): def test_student_view_init(self): module_system = get_test_system() module_system.position = 2 - seq_module = SequenceBlock(runtime=module_system, scope_ids=Mock()) - seq_module.bind_for_student(module_system, 34) - assert seq_module.position == 2 + seq_block = SequenceBlock(runtime=module_system, scope_ids=Mock()) + seq_block.bind_for_student(module_system, 34) + assert seq_block.position == 2 # matches position set in the runtime @ddt.unpack @@ -165,7 +165,7 @@ class SequenceBlockTestCase(XModuleXmlImportTest): assert 'fa fa-check-circle check-circle is-hidden' not in html # pylint: disable=line-too-long - @patch('xmodule.seq_module.SequenceBlock.gate_entire_sequence_if_it_is_a_timed_exam_and_contains_content_type_gated_problems') + @patch('xmodule.seq_block.SequenceBlock.gate_entire_sequence_if_it_is_a_timed_exam_and_contains_content_type_gated_problems') def test_timed_exam_gating_waffle_flag(self, mocked_function): # pylint: disable=unused-argument """ Verify the code inside the waffle flag is not executed with the flag off @@ -209,7 +209,7 @@ class SequenceBlockTestCase(XModuleXmlImportTest): ) assert 'i_am_gated' in view # check a few elements to ensure the correct page was loaded - assert 'seq_module.html' in view + assert 'seq_block.html' in view assert 'NextSequential' in view assert 'PrevSequential' in view @@ -240,7 +240,7 @@ class SequenceBlockTestCase(XModuleXmlImportTest): def test_hidden_content_before_due(self): html = self._get_rendered_view(self.sequence_4_1) - assert 'seq_module.html' in html + assert 'seq_block.html' in html assert "'banner_text': None" in html def test_hidden_content_past_due(self): @@ -259,14 +259,14 @@ class SequenceBlockTestCase(XModuleXmlImportTest): self.sequence_4_1, extra_context=dict(specific_masquerade=True), ) - assert 'seq_module.html' in html + assert 'seq_block.html' in html html = self.get_context_dict_from_string(html) assert 'Because the due date has passed, this assignment is hidden from the learner.' == html['banner_text'] def test_hidden_content_self_paced_past_due_before_end(self): with freeze_time(PAST_DUE_BEFORE_END_DATE): html = self._get_rendered_view(self.sequence_4_1, self_paced=True) - assert 'seq_module.html' in html + assert 'seq_block.html' in html assert "'banner_text': None" in html def test_hidden_content_self_paced_past_end(self): @@ -284,7 +284,7 @@ class SequenceBlockTestCase(XModuleXmlImportTest): """ Assert sequence content is gated """ - assert 'seq_module.html' in html + assert 'seq_block.html' in html html = self.get_context_dict_from_string(html) assert html['banner_text'] is None assert [] == html['items'] @@ -299,7 +299,7 @@ class SequenceBlockTestCase(XModuleXmlImportTest): """ Assert sequence is a prerequisite with unfulfilled gates """ - assert 'seq_module.html' in html + assert 'seq_block.html' in html html = self.get_context_dict_from_string(html) assert 'This section is a prerequisite. You must complete this section in order to unlock additional content.' == html['banner_text'] assert not html['gated_content']['gated'] @@ -313,7 +313,7 @@ class SequenceBlockTestCase(XModuleXmlImportTest): """ Assert sequence is not gated """ - assert 'seq_module.html' in html + assert 'seq_block.html' in html assert "'banner_text': None" in html assert "'gated': False" in html assert str(sequence.location) in html @@ -464,5 +464,5 @@ class SequenceBlockTestCase(XModuleXmlImportTest): Retrieve dictionary from string. """ # Replace tuple and un-necessary info from inside string and get the dictionary. - cleaned_data = data.replace("(('seq_module.html',\n", '').replace("),\n {})", '').strip() + cleaned_data = data.replace("(('seq_block.html',\n", '').replace("),\n {})", '').strip() return ast.literal_eval(cleaned_data) diff --git a/xmodule/tests/test_xml_module.py b/xmodule/tests/test_xml_module.py index f36782075f..b15dc3529f 100644 --- a/xmodule/tests/test_xml_module.py +++ b/xmodule/tests/test_xml_module.py @@ -15,7 +15,7 @@ from xmodule.course_block import CourseBlock from xmodule.fields import Date, RelativeTime, Timedelta from xmodule.modulestore.inheritance import InheritanceKeyValueStore, InheritanceMixin, InheritingFieldData from xmodule.modulestore.split_mongo.split_mongo_kvs import SplitMongoKVS -from xmodule.seq_module import SequenceBlock +from xmodule.seq_block import SequenceBlock from xmodule.tests import get_test_descriptor_system from xmodule.tests.xml import XModuleXmlImportTest from xmodule.tests.xml.factories import CourseFactory, ProblemFactory, SequenceFactory diff --git a/xmodule/vertical_block.py b/xmodule/vertical_block.py index 34c88830ee..e7c8682188 100644 --- a/xmodule/vertical_block.py +++ b/xmodule/vertical_block.py @@ -16,7 +16,7 @@ from xblock.fields import Boolean, Scope from openedx_filters.learning.filters import VerticalBlockChildRenderStarted from xmodule.mako_block import MakoTemplateBlockBase from xmodule.progress import Progress -from xmodule.seq_module import SequenceFields +from xmodule.seq_block import SequenceFields from xmodule.studio_editable import StudioEditableBlock from xmodule.util.misc import is_xblock_an_assignment from xmodule.util.xmodule_django import add_webpack_to_fragment