@receiver(PROBLEM_WEIGHTED_SCORE_CHANGED)
def score_changed_handler(sender, **kwargs):
 points_possible = kwargs.get('weighted_possible', None)
 points_earned = kwargs.get('weighted_earned', None)
 user_id = kwargs.get('user_id', None)
 course_id = kwargs.get('course_id', None)
 usage_id = kwargs.get('usage_id', None)
 if (None not in (points_earned, points_possible, user_id, course_id)):
  (course_key, usage_key) = parse_course_and_usage_keys(course_id, usage_id)
  assignments = increment_assignment_versions(course_key, usage_key, user_id)
  for assignment in assignments:
   if (assignment.usage_key == usage_key):
    send_leaf_outcome.delay(assignment.id, points_earned, points_possible)
   else:
    send_composite_outcome.apply_async((user_id, course_id, assignment.id, assignment.version_number), countdown=settings.LTI_AGGREGATE_SCORE_PASSBACK_DELAY)
 else:
  log.error('Outcome Service: Required signal parameter is None. points_possible: %s, points_earned: %s, user_id: %s, course_id: %s, usage_id: %s', points_possible, points_earned, user_id, course_id, usage_id)

@ receiver ( PROBLEM_WEIGHTED_SCORE_CHANGED ) def score_changed_handler ( sender , ** kwargs ) : points_possible = kwargs . get ( 'weighted_possible' , None ) points_earned = kwargs . get ( 'weighted_earned' , None ) user_id = kwargs . get ( 'user_id' , None ) course_id = kwargs . get ( 'course_id' , None ) usage_id = kwargs . get ( 'usage_id' , None ) if ( None not in ( points_earned , points_possible , user_id , course_id ) ) : ( course_key , usage_key ) = parse_course_and_usage_keys ( course_id , usage_id ) assignments = increment_assignment_versions ( course_key , usage_key , user_id ) for assignment in assignments : if ( assignment . usage_key == usage_key ) : send_leaf_outcome . delay ( assignment . id , points_earned , points_possible ) else : send_composite_outcome . apply_async ( ( user_id , course_id , assignment . id , assignment . version_number ) , countdown = settings . LTI_AGGREGATE_SCORE_PASSBACK_DELAY ) else : log . error ( 'Outcome Service: Required signal parameter is None. points_possible: %s, points_earned: %s, user_id: %s, course_id: %s, usage_id: %s' , points_possible , points_earned , user_id , course_id , usage_id )
consume signals that indicate score changes .