function Course::assign_display_status

7.x Course.php Course::assign_display_status()
6.x Course.php Course::assign_display_status()

This will assign the $this->display_status string based on the grade the student has made on the course. The display_status is used by other display functions to decide what color the course should show up as.

1 call to Course::assign_display_status()
Course::load_course in classes/Course.php
Loads $this as a new course, based on course_id.

File

classes/Course.php, line 951

Class

Course

Code

function assign_display_status() 
 {
  // Assigns the display status, based on grade.
  $grade = $this->grade;
  // Get these grade definitions from our system settings
  // Configure them in custom/settings.php
  $retake_grades = csv_to_array(variable_get_for_school("retake_grades", 'F,W,I', $this->school_id));
  $enrolled_grades = csv_to_array(variable_get_for_school("enrolled_grades", 'E', $this->school_id));


  if (in_array($grade, $retake_grades)) 
   {
    $this->display_status = "retake";
  }

  if (in_array($grade, $enrolled_grades)) 
   {
    $this->display_status = "enrolled";
  }
}