function _CourseList::get_previous_assignments

4.x _CourseList.php _CourseList::get_previous_assignments($course_id)
5.x _CourseList.php _CourseList::get_previous_assignments($course_id, $degree_id = 0)

Returns a CourseList of all the courses matching course_id that has bool_has_been_assigned == TRUE.

Parameters

int $course_id:

Return value

CourseList

File

classes/_CourseList.php, line 1160

Class

_CourseList

Code

function get_previous_assignments($course_id) 
 {
  // Return a courseList of all the times a course matching
  // course_id has the bool_has_been_assigned set to TRUE.

  $rtn_list = new CourseList();

  for ($t = 0; $t < $this->count; $t++) 
   {
    $course = $this->array_list [$t];
    if ($course->course_id == $course_id && $course->bool_has_been_assigned == true) 
     {
      $rtn_list->add($course);
    }
  }

  return $rtn_list;

}