def get_entrance_exam_score(request, course):
 exam_key = UsageKey.from_string(course.entrance_exam_id)
 exam_descriptor = modulestore().get_item(exam_key)
 def inner_get_module(descriptor):
  '\n        Delegate to get_module_for_descriptor (imported here to avoid circular reference)\n        '
  from courseware.module_render import get_module_for_descriptor
  field_data_cache = FieldDataCache([descriptor], course.id, request.user)
  return get_module_for_descriptor(request.user, request, descriptor, field_data_cache, course.id, course=course)
 exam_module_generators = yield_dynamic_descriptor_descendants(exam_descriptor, request.user.id, inner_get_module)
 exam_modules = [module for module in exam_module_generators]
 return _calculate_entrance_exam_score(request.user, course, exam_modules)

def get_entrance_exam_score ( request , course ) : exam_key = UsageKey . from_string ( course . entrance_exam_id ) exam_descriptor = modulestore ( ) . get_item ( exam_key ) def inner_get_module ( descriptor ) : from courseware . module_render import get_module_for_descriptor field_data_cache = FieldDataCache ( [ descriptor ] , course . id , request . user ) return get_module_for_descriptor ( request . user , request , descriptor , field_data_cache , course . id , course = course ) exam_module_generators = yield_dynamic_descriptor_descendants ( exam_descriptor , request . user . id , inner_get_module ) exam_modules = [ module for module in exam_module_generators ] return _calculate_entrance_exam_score ( request . user , course , exam_modules )
gather the set of modules which comprise the entrance exam note that request may not actually be a genuine request .