You are here

public function LongAnswerQuestion::getNodeView in Quiz 7.6

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

Implementation of getNodeView

Overrides QuizQuestion::getNodeView

See also

QuizQuestion#getNodeView()

File

question_types/long_answer/long_answer.classes.inc, line 104
Long answer classes.

Class

LongAnswerQuestion
Extension of QuizQuestion.

Code

public function getNodeView() {
  $content = parent::getNodeView();
  if ($this
    ->viewCanRevealCorrect()) {
    $content['answers'] = array(
      '#type' => 'item',
      '#title' => t('Rubric'),
      '#markup' => '<div class="quiz-solution">' . check_markup($this->node->rubric, $this
        ->getFormat()) . '</div>',
      '#weight' => 1,
    );
  }
  else {
    $content['answers'] = array(
      '#markup' => '<div class="quiz-answer-hidden">Answer hidden</div>',
      '#weight' => 1,
    );
  }
  return $content;
}