def evaluate_entrance_exam(course, block, user_id):
 if milestones_helpers.is_entrance_exams_enabled():
  entrance_exam_enabled = getattr(course, 'entrance_exam_enabled', False)
  in_entrance_exam = getattr(block, 'in_entrance_exam', False)
  if (entrance_exam_enabled and in_entrance_exam):
   request = RequestFactory().request()
   request.user = User.objects.get(id=user_id)
   exam_pct = get_entrance_exam_score(request, course)
   if (exam_pct >= course.entrance_exam_minimum_score_pct):
    exam_key = UsageKey.from_string(course.entrance_exam_id)
    relationship_types = milestones_helpers.get_milestone_relationship_types()
    content_milestones = milestones_helpers.get_course_content_milestones(course.id, exam_key, relationship=relationship_types['FULFILLS'])
    user = {'id': request.user.id}
    for milestone in content_milestones:
     milestones_helpers.add_user_milestone(user, milestone)

def evaluate_entrance_exam ( course , block , user_id ) : if milestones_helpers . is_entrance_exams_enabled ( ) : entrance_exam_enabled = getattr ( course , 'entrance_exam_enabled' , False ) in_entrance_exam = getattr ( block , 'in_entrance_exam' , False ) if ( entrance_exam_enabled and in_entrance_exam ) : request = RequestFactory ( ) . request ( ) request . user = User . objects . get ( id = user_id ) exam_pct = get_entrance_exam_score ( request , course ) if ( exam_pct >= course . entrance_exam_minimum_score_pct ) : exam_key = UsageKey . from_string ( course . entrance_exam_id ) relationship_types = milestones_helpers . get_milestone_relationship_types ( ) content_milestones = milestones_helpers . get_course_content_milestones ( course . id , exam_key , relationship = relationship_types [ 'FULFILLS' ] ) user = { 'id' : request . user . id } for milestone in content_milestones : milestones_helpers . add_user_milestone ( user , milestone )
update milestone fulfillments for the specified content module .