You are here

function CourseObjectQuiz::getOptionsSummary in Course 8.2

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::getOptionsSummary()
  2. 3.x modules/course_quiz/src/Plugin/course/CourseObject/CourseObjectQuiz.php \Drupal\course_quiz\Plugin\course\CourseObject\CourseObjectQuiz::getOptionsSummary()

Get core options summary.

Return value

array An associative array of summary keys and values.

Overrides CourseObject::getOptionsSummary

File

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

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 getOptionsSummary() {
  $summary = parent::getOptionsSummary();
  if ($this
    ->getInstanceId()) {
    $link = Drupal\Core\Link::createFromRoute('Edit questions', "quiz.questions", [
      'quiz' => $this
        ->getInstanceId(),
    ]);
    $summary['questions'] = $link
      ->toString();
  }
  return $summary;
}