function example__is_student_gpa_above_250

6.x student_priority.api.php example__is_student_gpa_above_250(Student $student)
1 string reference to 'example__is_student_gpa_above_250'
example_define_calculation_tests in modules/student_priority/student_priority.api.php
Implements hook_define_calculation_tests, "METHOD ONE" from above. Accept an array so we can alter. Then, we are just going to add to array (or modify).

File

modules/student_priority/student_priority.api.php, line 165

Code

function example__is_student_gpa_above_250(Student $student) {

  $rtn = array();

  // For this test, we will simply examine the student's cumulative GPA
  if (floatval($student->gpa) > 2.5) {
    $rtn ['result'] = 'Y';
  }
  else {
    $rtn ['result'] = 'N';
  }

  $rtn ['extra'] = 'Current cumulative GPA is ' . floatval($student->gpa);

  return $rtn;
}