@receiver(PROBLEM_WEIGHTED_SCORE_CHANGED)
def enqueue_subsection_update(sender, **kwargs):
 _emit_problem_submitted_event(kwargs)
 result = recalculate_subsection_grade_v3.apply_async(kwargs=dict(user_id=kwargs['user_id'], anonymous_user_id=kwargs.get('anonymous_user_id'), course_id=kwargs['course_id'], usage_id=kwargs['usage_id'], only_if_higher=kwargs.get('only_if_higher'), expected_modified_time=to_timestamp(kwargs['modified']), score_deleted=kwargs.get('score_deleted', False), event_transaction_id=unicode(get_event_transaction_id()), event_transaction_type=unicode(get_event_transaction_type()), score_db_table=kwargs['score_db_table']))
 log.info(u'Grades: Request async calculation of subsection grades with args: {}. Task [{}]'.format(', '.join(('{}:{}'.format(arg, kwargs[arg]) for arg in sorted(kwargs))), getattr(result, 'id', 'N/A')))

@ receiver ( PROBLEM_WEIGHTED_SCORE_CHANGED ) def enqueue_subsection_update ( sender , ** kwargs ) : _emit_problem_submitted_event ( kwargs ) result = recalculate_subsection_grade_v3 . apply_async ( kwargs = dict ( user_id = kwargs [ 'user_id' ] , anonymous_user_id = kwargs . get ( 'anonymous_user_id' ) , course_id = kwargs [ 'course_id' ] , usage_id = kwargs [ 'usage_id' ] , only_if_higher = kwargs . get ( 'only_if_higher' ) , expected_modified_time = to_timestamp ( kwargs [ 'modified' ] ) , score_deleted = kwargs . get ( 'score_deleted' , False ) , event_transaction_id = unicode ( get_event_transaction_id ( ) ) , event_transaction_type = unicode ( get_event_transaction_type ( ) ) , score_db_table = kwargs [ 'score_db_table' ] ) ) log . info ( u'Grades: Request async calculation of subsection grades with args: {}. Task [{}]' . format ( ', ' . join ( ( '{}:{}' . format ( arg , kwargs [ arg ] ) for arg in sorted ( kwargs ) ) ) , getattr ( result , 'id' , 'N/A' ) ) )
handles the problem_weighted_score_changed signal by enqueueing a subsection update operation to occur asynchronously .