function _Course::assign_display_status
Search API
4.x _Course.php | _Course::assign_display_status() |
5.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 399
Class
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($GLOBALS ["fp_system_settings"]["retake_grades"]);
$enrolled_grades = csv_to_array($GLOBALS ["fp_system_settings"]["enrolled_grades"]);
if (in_array($grade, $retake_grades))
{
$this->display_status = "retake";
}
if (in_array($grade, $enrolled_grades))
{
$this->display_status = "enrolled";
}
}