@receiver(PROBLEM_WEIGHTED_SCORE_CHANGED)
def handle_score_changed(**kwargs):
 course = modulestore().get_course(CourseKey.from_string(kwargs.get('course_id')))
 block = modulestore().get_item(UsageKey.from_string(kwargs.get('usage_id')))
 gating_api.evaluate_prerequisite(course, block, kwargs.get('user_id'))
 gating_api.evaluate_entrance_exam(course, block, kwargs.get('user_id'))

@ receiver ( PROBLEM_WEIGHTED_SCORE_CHANGED ) def handle_score_changed ( ** kwargs ) : course = modulestore ( ) . get_course ( CourseKey . from_string ( kwargs . get ( 'course_id' ) ) ) block = modulestore ( ) . get_item ( UsageKey . from_string ( kwargs . get ( 'usage_id' ) ) ) gating_api . evaluate_prerequisite ( course , block , kwargs . get ( 'user_id' ) ) gating_api . evaluate_entrance_exam ( course , block , kwargs . get ( 'user_id' ) )
receives the problem_weighted_score_changed signal sent by lms when a students score has changed for a given component and triggers the evaluation of any milestone relationships which are attached to the updated content .