You are here

public function CourseObjectManual::getStatus in Course 7

Same name and namespace in other branches
  1. 6 modules/course_object_manual/course_object_manual.classes.inc \CourseObjectManual::getStatus()
  2. 7.2 modules/course_object_manual/course_object_manual.classes.inc \CourseObjectManual::getStatus()

Return a message about the user's status in this object, for when this object is hidden.

Overrides CourseObject::getStatus

1 call to CourseObjectManual::getStatus()
CourseObjectManual::take in modules/course_object_manual/course_object_manual.classes.inc
Display status message as course content.

File

modules/course_object_manual/course_object_manual.classes.inc, line 16

Class

CourseObjectManual

Code

public function getStatus() {
  $grade = $this
    ->getFulfillment()
    ->getGrade();
  $config = $this
    ->getOptions();
  if ($this
    ->getFulfillment()
    ->isComplete()) {

    // User has a completed fulfillment (passed).
    return check_plain(t($config['complete_msg']));
  }
  elseif ($this
    ->getFulfillment()
    ->getGrade() == '') {

    // User has a fulfillment but no grade (incomplete).
    return check_plain(t($config['incomplete_msg']));
  }
  else {

    // User has a grade but not complete (failed).
    return check_plain(t($config['failed_msg']));
  }
}