function _FlightPath::split_requirements_by_substitutions
Search API
4.x _FlightPath.php | _FlightPath::split_requirements_by_substitutions() |
5.x _FlightPath.php | _FlightPath::split_requirements_by_substitutions() |
File
- classes/
_FlightPath.php, line 2109
Class
Code
function split_requirements_by_substitutions()
{
// Go through all the required courses on the degree plan,
// and if there is a partial substitution specified in the student's
// list of substitutions, then split that requirement into 2 courses,
// one with enough hours to satisfy the sub, and the remaining hours.
$degree_plan = $this->degree_plan;
$student = $this->student;
$student->list_substitutions->reset_counter();
while ($student->list_substitutions->has_more())
{
$substitution = $student->list_substitutions->get_next();
$course_requirement = $substitution->course_requirement;
$course_sub = $substitution->course_list_substitutions->get_first();
// TODO: This could be an important part right here
// Check to see if the courseSub's hours_awarded are less than the
// course_requirement's min hours...
if ($course_requirement->min_hours > $course_sub->get_hours_awarded())
{
// Meaning the original course requirement is not being
// fully satisfied by this substitution! The original
// course requirement has hours left over which must be
// fulfilled somehow.
$remaining_hours = round($course_requirement->min_hours - $course_sub->get_hours_awarded(), 6);
// This means that the course requirement needs to be split.
// So, find this course in the degree plan.
$required_course_id = $course_requirement->course_id;
//$required_group_id = $course_requirement->assigned_to_group_id;
$required_group_id = $course_requirement->get_first_assigned_to_group_id(); // we assume a course requirement is only assigned to 1 group.
$required_semester_num = $course_requirement->assigned_to_semester_num;
}
}
}