def _credit_course_requirements(course_key, student):
 if (not (settings.FEATURES.get('ENABLE_CREDIT_ELIGIBILITY', False) and is_credit_course(course_key))):
  return None
 enrollment = CourseEnrollment.get_enrollment(student, course_key)
 if (enrollment and (enrollment.mode not in REQUIREMENTS_DISPLAY_MODES)):
  return None
 non_eligible_statuses = ['failed', 'declined']
 requirement_statuses = get_credit_requirement_status(course_key, student.username)
 if is_user_eligible_for_credit(student.username, course_key):
  eligibility_status = 'eligible'
 elif any(((requirement['status'] in non_eligible_statuses) for requirement in requirement_statuses)):
  eligibility_status = 'not_eligible'
 else:
  eligibility_status = 'partial_eligible'
 return {'eligibility_status': eligibility_status, 'requirements': requirement_statuses}

def _credit_course_requirements ( course_key , student ) : if ( not ( settings . FEATURES . get ( 'ENABLE_CREDIT_ELIGIBILITY' , False ) and is_credit_course ( course_key ) ) ) : return None enrollment = CourseEnrollment . get_enrollment ( student , course_key ) if ( enrollment and ( enrollment . mode not in REQUIREMENTS_DISPLAY_MODES ) ) : return None non_eligible_statuses = [ 'failed' , 'declined' ] requirement_statuses = get_credit_requirement_status ( course_key , student . username ) if is_user_eligible_for_credit ( student . username , course_key ) : eligibility_status = 'eligible' elif any ( ( ( requirement [ 'status' ] in non_eligible_statuses ) for requirement in requirement_statuses ) ) : eligibility_status = 'not_eligible' else : eligibility_status = 'partial_eligible' return { 'eligibility_status' : eligibility_status , 'requirements' : requirement_statuses }
return information about which credit requirements a user has satisfied .