function DegreePlan::add_semester_developmental

7.x DegreePlan.php DegreePlan::add_semester_developmental($student_id)
6.x DegreePlan.php DegreePlan::add_semester_developmental($student_id)

File

classes/DegreePlan.php, line 1128

Class

DegreePlan

Code

function add_semester_developmental($student_id) 
 {
  // This will add the developmental courses in as
  // a semester.  Will check the studentID to see if any
  // developmentals are required.
  // -55 is the developmental semester.
  $sem = new Semester(DegreePlan::SEMESTER_NUM_FOR_DEVELOPMENTALS);
  $sem->title = variable_get_for_school("developmentals_title", t("Developmental Requirements", $this->school_id));
  $is_empty = true;


  $temp_array = $this->db->get_developmental_requirements($student_id, $this->school_id);
  // We expect this to give us back an array like:
  // 0 => ART~101
  // 1 => MATH~090
  foreach ($temp_array as $temp_course_name) {
    $temp = explode("~", $temp_course_name);
    $c = new Course($this->db->get_course_id($temp [0], $temp [1], '', FALSE, $this->school_id, TRUE));
    $c->min_grade = "C";
    $c->requirement_type = "dev";
    $sem->list_courses->add($c);

    $is_empty = false;
  }

  $sem->notice = variable_get_for_school("developmentals_notice", t("According to our records, you are required to complete the course(s) listed above. For some transfer students, your record may not be complete. If you have any questions, please ask your advisor.", $this->school_id));

  if (!$is_empty) 
   {
    $this->list_semesters->add($sem);
  }

}