public function CourseObjectManual::getStatus in Course 3.x
Same name and namespace in other branches
- 8.3 modules/course_object_manual/src/Plugin/course/CourseObject/CourseObjectManual.php \Drupal\course_object_manual\Plugin\course\CourseObject\CourseObjectManual::getStatus()
- 8.2 modules/course_object_manual/src/Plugin/course/CourseObject/CourseObjectManual.php \Drupal\course_object_manual\Plugin\course\CourseObject\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/ src/ Plugin/ course/ CourseObject/ CourseObjectManual.php - Display status message as course content.
File
- modules/
course_object_manual/ src/ Plugin/ course/ CourseObject/ CourseObjectManual.php, line 31
Class
- CourseObjectManual
- Plugin annotation @CourseObject( id = "manual", label = "Manual step", handlers = { "fulfillment" = "\Drupal\course\Entity\CourseObjectFulfillment" } )
Namespace
Drupal\course_object_manual\Plugin\course\CourseObjectCode
public function getStatus() {
$user = Drupal::currentUser();
$config = $this
->getOptions();
if ($this
->getFulfillment($user)
->isComplete()) {
// User has a completed fulfillment (passed).
return t($config['complete_msg']);
}
elseif ($this
->getFulfillment($user)
->getGrade() == '') {
// User has a fulfillment but no grade (incomplete).
return $config['incomplete_msg'];
}
else {
// User has a grade but not complete (failed).
return $config['failed_msg'];
}
}