code: def update_score_summary(sender, **kwargs):
          
          score = kwargs['instance']
          try:
              score_summary = ScoreSummary.objects.get(
                  student_item=score.student_item
              )
              score_summary.latest = score
  
              # A score with the "reset" flag set will always replace the current highest score
              if score.reset:
                  score_summary.highest = score
              # The conversion to a float may return None if points possible is zero
              # In Python, None is always less than an integer, so any score
              # with non-null points possible will take precedence.
              elif score.to_float() > score_summary.highest.to_float():
                  score_summary.highest = score
              score_summary.save()
          except ScoreSummary.DoesNotExist:
              ScoreSummary.objects.create(
                  student_item=score.student_item,
                  highest=score,
                  latest=score,
              )
          except DatabaseError as err:
              logger.exception(
                  u"Error while updating score summary for student item {}"
                  .format(score.student_item)
              )
docs: Listen for new Scores and update the relevant ScoreSummary.
  
          Args:
              sender: not used
  
          Kwargs:
              instance (Score): The score model whose save triggered this receiver.