function _Course::get_hours

4.x _Course.php _Course::get_hours()
5.x _Course.php _Course::get_hours($degree_id = 0)

Figure out the number of hours this particular instance of the course is worth. In the case of variable hours, it will return the number of hours selected. If that does not exist, it will return the MIN HOURS.

Return value

int

1 call to _Course::get_hours()
_Course::get_quality_points in classes/_Course.php
Calculate the quality points for this course's grade and hours.

File

classes/_Course.php, line 570

Class

_Course

Code

function get_hours() 
 {

  // This course might be set to 1 hour, but be a "ghost hour",
  // meaning the student actually earned 0 hours, but we recorded 1
  // to make FP's math work out.  So, let's return back 0 hours.
  if ($this->bool_ghost_hour) 
   {
    $h = 0;
    return $h;
  }


  // Do they have any hours_awarded? (because they completed
  // the course)
  if ($this->hours_awarded > 0) 
   {
    $h = $this->hours_awarded;
    return $h;
  }


  if ($this->has_variable_hours() && $this->advised_hours > -1) {
    return $this->advised_hours;
  }






  // No selected hours, but it's a variable hour course.
  // So, return the min_hours for this course.
  return $this->min_hours;

}