MixedModulestore wraps most getters, update_item, delete_item

with code to translate between addressing schemes based on app
and persistence layer addressing scheme specification.

STUD-1206
This commit is contained in:
Don Mitchell
2014-01-16 15:41:26 -05:00
parent ea594a2980
commit c601b75675
45 changed files with 633 additions and 560 deletions

View File

@@ -208,7 +208,9 @@ class InstructorTaskModuleTestCase(InstructorTaskCourseTestCase):
'num_responses': 2}
problem_xml = factory.build_xml(**factory_args)
location = InstructorTaskTestCase.problem_location(problem_url_name)
self.module_store.update_item(location, problem_xml)
item = self.module_store.get_instance(self.course.id, location)
item.data = problem_xml
self.module_store.update_item(item, 'redefine_option_problem')
def get_student_module(self, username, descriptor):
"""Get StudentModule object for test course, given the `username` and the problem's `descriptor`."""

View File

@@ -288,7 +288,11 @@ class TestRescoringTask(TestIntegrationTask):
""" % ('!=' if redefine else '=='))
problem_xml = factory.build_xml(script=script, cfn="check_func", expect="42", num_responses=1)
if redefine:
self.module_store.update_item(InstructorTaskModuleTestCase.problem_location(problem_url_name), problem_xml)
descriptor = self.module_store.get_instance(
self.course.id, InstructorTaskModuleTestCase.problem_location(problem_url_name)
)
descriptor.data = problem_xml
self.module_store.update_item(descriptor, 'define_randomized_custom_response_problem')
else:
# Use "per-student" rerandomization so that check-problem can be called more than once.
# Using "always" means we cannot check a problem twice, but we want to call once to get the