def get_module_score(user, course, module):
 def inner_get_module(descriptor):
  '\n        Delegate to get_module_for_descriptor\n        '
  field_data_cache = FieldDataCache([descriptor], course.id, user)
  return get_module_for_descriptor(user, _get_mock_request(user), descriptor, field_data_cache, course.id, course=course)
 modules = yield_dynamic_descriptor_descendants(module, user.id, inner_get_module)
 return _calculate_score_for_modules(user.id, course, modules)

def get_module_score ( user , course , module ) : def inner_get_module ( descriptor ) : field_data_cache = FieldDataCache ( [ descriptor ] , course . id , user ) return get_module_for_descriptor ( user , _get_mock_request ( user ) , descriptor , field_data_cache , course . id , course = course ) modules = yield_dynamic_descriptor_descendants ( module , user . id , inner_get_module ) return _calculate_score_for_modules ( user . id , course , modules )
collects all children of the given module and calculates the cumulative score for this set of modules for the given user .