Commit fd973442 by Chris Dodge

if we have to reload a module and already have the descriptor, we don't need to…

if we have to reload a module and already have the descriptor, we don't need to refect the descriptor (which results in another DB round-trip. We just need the student state.
parent 23f77a15
...@@ -10,7 +10,7 @@ from django.contrib.auth.models import User ...@@ -10,7 +10,7 @@ from django.contrib.auth.models import User
from .model_data import ModelDataCache, LmsKeyValueStore from .model_data import ModelDataCache, LmsKeyValueStore
from xblock.core import Scope from xblock.core import Scope
from .module_render import get_module from .module_render import get_module, get_module_for_descriptor
from xmodule import graders from xmodule import graders
from xmodule.capa_module import CapaModule from xmodule.capa_module import CapaModule
from xmodule.course_module import CourseDescriptor from xmodule.course_module import CourseDescriptor
...@@ -176,8 +176,7 @@ def grade(student, request, course, model_data_cache=None, keep_raw_scores=False ...@@ -176,8 +176,7 @@ def grade(student, request, course, model_data_cache=None, keep_raw_scores=False
def create_module(descriptor): def create_module(descriptor):
# TODO: We need the request to pass into here. If we could forgo that, our arguments # TODO: We need the request to pass into here. If we could forgo that, our arguments
# would be simpler # would be simpler
return get_module(student, request, descriptor.location, return get_module_for_descriptor(student, request, descriptor, model_data_cache, course.id)
model_data_cache, course.id)
for module_descriptor in yield_dynamic_descriptor_descendents(section_descriptor, create_module): for module_descriptor in yield_dynamic_descriptor_descendents(section_descriptor, create_module):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment