You are here

public function MultichoiceQuestion::getNodeView in Quiz 8.4

Implementation of getNodeView

Overrides QuizQuestion::getNodeView

See also

QuizQuestion#getNodeView()

File

question_types/multichoice/lib/Drupal/multichoice/MultichoiceQuestion.php, line 379
The main classes for the multichoice question type.

Class

MultichoiceQuestion
Extension of QuizQuestion.

Namespace

Drupal\multichoice

Code

public function getNodeView() {
  $content = parent::getNodeView();
  if ($this->node->choice_random) {
    $this
      ->shuffle($this->node->alternatives);
  }
  $content['answers'] = array(
    '#markup' => theme('multichoice_answer_node_view', array(
      'alternatives' => $this->node->alternatives,
      'show_correct' => $this
        ->viewCanRevealCorrect(),
    )),
    '#weight' => 2,
  );
  return $content;
}