You are here

function CourseObjectQuiz::getStatus in Course 3.x

Same name and namespace in other branches
  1. 8.3 modules/course_quiz/src/Plugin/course/CourseObject/CourseObjectQuiz.php \Drupal\course_quiz\Plugin\course\CourseObject\CourseObjectQuiz::getStatus()
  2. 8.2 modules/course_quiz/src/Plugin/course/CourseObject/CourseObjectQuiz.php \Drupal\course_quiz\Plugin\course\CourseObject\CourseObjectQuiz::getStatus()

Get the status of this quiz for the requirements list.

Overrides CourseObject::getStatus

File

modules/course_quiz/src/Plugin/course/CourseObject/CourseObjectQuiz.php, line 204

Class

CourseObjectQuiz
Plugin annotation @CourseObject( id = "quiz", label = "Quiz", handlers = { "fulfillment" = "\Drupal\course_quiz\Plugin\course\CourseObject\CourseObjectQuizFulfillment" } )

Namespace

Drupal\course_quiz\Plugin\course\CourseObject

Code

function getStatus() {
  $account = Drupal::currentUser();
  $grade = $this
    ->isGraded() ? t('Your grade: %grade_result%<br/>Pass grade: %passing_grade%', array(
    '%grade_result' => $this
      ->getFulfillment($account)
      ->getOption('grade_result'),
    '%passing_grade' => $this
      ->getOption('passing_grade'),
  )) : '';
  return $grade;
}