def user_has_passed_entrance_exam(request, course):
 if (not course_has_entrance_exam(course)):
  return True
 if (not request.user.is_authenticated()):
  return False
 entrance_exam_score = get_entrance_exam_score(request, course)
 if (entrance_exam_score >= course.entrance_exam_minimum_score_pct):
  return True
 return False

def user_has_passed_entrance_exam ( request , course ) : if ( not course_has_entrance_exam ( course ) ) : return True if ( not request . user . is_authenticated ( ) ) : return False entrance_exam_score = get_entrance_exam_score ( request , course ) if ( entrance_exam_score >= course . entrance_exam_minimum_score_pct ) : return True return False
checks to see if the user has attained a sufficient score to pass the exam begin by short-circuiting if the course does not have an entrance exam .