function _Group::get_fulfilled_quality_points

4.x _Group.php _Group::get_fulfilled_quality_points($bool_check_subgroups = true, $only_count_semester_num = -1, $bool_ignore_enrolled = false, $bool_require_has_been_displayed = false)
5.x _Group.php _Group::get_fulfilled_quality_points($bool_check_subgroups = true, $only_count_semester_num = -1, $bool_ignore_enrolled = false, $bool_require_has_been_displayed = false, $requirement_type = "", $bool_exclude_all_transfer_credits = FALSE)

Returns the quality points earned for all of the courses in this group

File

classes/_Group.php, line 655

Class

_Group

Code

function get_fulfilled_quality_points($bool_check_subgroups = true, $only_count_semester_num = -1, $bool_ignore_enrolled = false, $bool_require_has_been_displayed = false, $requirement_type = "", $bool_exclude_all_transfer_credits = FALSE) 
 {
  $points = 0;
  // if onlyCountSemesterNum != -1, then we will only count courses
  // who have their "assigned_to_semester_num" = $only_count_semester_num.

  $this->list_courses->reset_counter();
  while ($this->list_courses->has_more()) 
   {
    $c = $this->list_courses->get_next();
    if ($only_count_semester_num != -1 && $c->assigned_to_semester_num != $only_count_semester_num) 
     {
      // Only accept courses assigned to a particular semester.
      continue;
    }


    if (is_object($c->course_list_fulfilled_by) && !($c->course_list_fulfilled_by->is_empty)) 
     {
      if ($bool_ignore_enrolled == true) 
       {
        // Only allow it if it has been completed.
        if ($c->course_list_fulfilled_by->get_first()->is_completed() == false) 
         {
          continue;
        }
      }

      $p = 0;

      // Are we requiring that the course has been displayed?
      if (!$bool_require_has_been_displayed || ($bool_require_has_been_displayed && $c->course_list_fulfilled_by->get_first()->get_has_been_displayed() == TRUE)) 
       {
        $p = $c->course_list_fulfilled_by->count_credit_quality_points($requirement_type, TRUE, TRUE, $bool_exclude_all_transfer_credits);
      }

      $points = $points + $p;

    }

  }

  if ($bool_check_subgroups == TRUE) 
   {
    // If there are any subgroups for this group, then run
    // this function for each group as well.
    $this->list_groups->reset_counter();
    while ($this->list_groups->has_more()) 
     {

      $g = $this->list_groups->get_next();
      $gp = $g->get_fulfilled_quality_points(TRUE, $only_count_semester_num, $bool_ignore_enrolled, $bool_require_has_been_displayed, $requirement_type, $bool_exclude_all_transfer_credits);
      $points = $points + $gp;
    }
  }


  return $points;

}