function Group::get_fulfilled_hours
Search API
6.x Group.php | Group::get_fulfilled_hours($bool_check_subgroups = true, $bool_count_advised = true, $bool_require_has_been_displayed = false, $only_count_semester_num = -1, $bool_ignore_enrolled = false, $bool_qpts_grades_only = FALSE, $requirement_type = "", $bool_exclude_all_transfer_credits = FALSE) |
2 calls to Group::get_fulfilled_hours()
- Group::get_hours_remaining in classes/
Group.php - Group::get_is_min_hours_allowed_fulfilled in classes/
Group.php - Return TRUE or FALSE if we've fulfilled the min hour allowed value, if it's set.
File
- classes/
Group.php, line 568
Class
Code
function get_fulfilled_hours($bool_check_subgroups = true, $bool_count_advised = true, $bool_require_has_been_displayed = false, $only_count_semester_num = -1, $bool_ignore_enrolled = false, $bool_qpts_grades_only = FALSE, $requirement_type = "", $bool_exclude_all_transfer_credits = FALSE)
{
// Returns how many hours have been used by the
// course fulfillments for this group...
$count = 0;
// if onlyCountSemesterNum != -1, then we will only count courses
// who have their "assigned_to_semester_num" = $only_count_semester_num.
//print_pre($this->to_string());
$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;
}
}
if (!$bool_require_has_been_displayed)
{ // The course does not have to have been displayed on the page yet.
$count = $count + $c->course_list_fulfilled_by->count_credit_hours($requirement_type, false, false, $bool_qpts_grades_only, $bool_exclude_all_transfer_credits);
}
else {
if ($c->course_list_fulfilled_by->get_first()->get_has_been_displayed() == true)
{
$h = $c->course_list_fulfilled_by->count_credit_hours($requirement_type, false, false, $bool_qpts_grades_only, $bool_exclude_all_transfer_credits);
$count = $count + $h;
}
}
}
else if ($c->bool_advised_to_take && $bool_count_advised == true)
{
$h = $c->get_hours();
$count = $count + $h;
}
}
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();
$gc = $g->get_fulfilled_hours(true, $bool_count_advised, $bool_require_has_been_displayed, $only_count_semester_num, $bool_ignore_enrolled, $bool_qpts_grades_only, $requirement_type, $bool_exclude_all_transfer_credits);
$count = $count + $gc;
}
}
//if ($this->group_id == 533404) {
//fpm($this);
//fpm("returning $count for group $this->group_id, $this->title");
//}
return $count;
}