You are here

public function MultichoiceQuestion::getNodeView in Quiz 7

Same name and namespace in other branches
  1. 6.4 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getNodeView()
  2. 7.6 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getNodeView()
  3. 7.4 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getNodeView()
  4. 7.5 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getNodeView()

Implementation of getNodeView

Overrides QuizQuestion::getNodeView

See also

QuizQuestion#getNodeView()

File

question_types/multichoice/multichoice.classes.inc, line 368
The main classes for the multichoice question type.

Class

MultichoiceQuestion
Extension of QuizQuestion.

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;
}