No longer persist XModule templates
Instead, we use XModule field default values when creating an empty XModule. Driven by this use case, we also allow for XModules to be created in memory without being persisted to the database at all. This necessitates a change to the Modulestore api, replacing clone_item with create_draft and save_xmodule.
This commit is contained in:
@@ -119,7 +119,7 @@ class InstructorTaskModuleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase)
|
||||
|
||||
# add a sequence to the course to which the problems can be added
|
||||
self.problem_section = ItemFactory.create(parent_location=chapter.location,
|
||||
template='i4x://edx/templates/sequential/Empty',
|
||||
category='sequential',
|
||||
display_name=TEST_SECTION_NAME)
|
||||
|
||||
@staticmethod
|
||||
@@ -169,7 +169,7 @@ class InstructorTaskModuleTestCase(LoginEnrollmentTestCase, ModuleStoreTestCase)
|
||||
'num_responses': 2}
|
||||
problem_xml = factory.build_xml(**factory_args)
|
||||
ItemFactory.create(parent_location=self.problem_section.location,
|
||||
template="i4x://edx/templates/problem/Blank_Common_Problem",
|
||||
category="problem",
|
||||
display_name=str(problem_url_name),
|
||||
data=problem_xml)
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ class TestRescoringTask(TestIntegrationTask):
|
||||
grader_payload=grader_payload,
|
||||
num_responses=2)
|
||||
ItemFactory.create(parent_location=self.problem_section.location,
|
||||
template="i4x://edx/templates/problem/Blank_Common_Problem",
|
||||
category="problem",
|
||||
display_name=str(problem_url_name),
|
||||
data=problem_xml)
|
||||
|
||||
@@ -293,7 +293,7 @@ class TestRescoringTask(TestIntegrationTask):
|
||||
# Per-student rerandomization will at least generate different seeds for different users, so
|
||||
# we get a little more test coverage.
|
||||
ItemFactory.create(parent_location=self.problem_section.location,
|
||||
template="i4x://edx/templates/problem/Blank_Common_Problem",
|
||||
category="problem",
|
||||
display_name=str(problem_url_name),
|
||||
data=problem_xml,
|
||||
metadata={"rerandomize": "per_student"})
|
||||
|
||||
Reference in New Issue
Block a user