public function LongAnswerQuestion::getNodeView in Quiz 6.4
Same name and namespace in other branches
- 7.6 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::getNodeView()
- 7 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::getNodeView()
- 7.4 question_types/long_answer/long_answer.classes.inc \LongAnswerQuestion::getNodeView()
- 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 88 - Long answer classes.
Class
- LongAnswerQuestion
- Extension of QuizQuestion.
Code
public function getNodeView() {
$content = parent::getNodeView();
if ($this
->viewCanRevealCorrect()) {
$rubric_html = check_markup($this->node->rubric, $this->node->format, FALSE);
$content['answers'] = array(
'#type' => 'item',
'#title' => t('Rubric'),
'#value' => '<div class="quiz-solution">' . $rubric_html . '</div>',
'#weight' => 1,
);
}
else {
$content['answers'] = array(
'#type' => 'markup',
'#value' => '<div class="quiz-answer-hidden">Answer hidden</div>',
'#weight' => 1,
);
}
return $content;
}