You are here

public function LongAnswerQuestion::getNodeView in OG Quiz 7

Implementation of getNodeView

Overrides QuizQuestion::getNodeView

See also

QuizQuestion#getNodeView()

File

includes/og_long_answer.php, line 102
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;
}