public function ScaleQuestion::getNodeView in Quiz 7.5
Same name and namespace in other branches
- 8.6 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::getNodeView()
- 8.5 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::getNodeView()
- 6.4 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeView()
- 7.6 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeView()
- 7 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeView()
- 7.4 question_types/scale/scale.classes.inc \ScaleQuestion::getNodeView()
Implementation of getNodeView().
Overrides QuizQuestion::getNodeView
See also
File
- question_types/
scale/ scale.classes.inc, line 341 - Scale classes.
Class
- ScaleQuestion
- Extension of QuizQuestion.
Code
public function getNodeView() {
$content = parent::getNodeView();
$alternatives = array();
for ($i = 0; $i < variable_get('scale_max_num_of_alts', 10); $i++) {
if (isset($this->node->scale[$i]->answer) && drupal_strlen($this->node->scale[$i]->answer) > 0) {
$alternatives[] = check_plain($this->node->scale[$i]->answer);
}
}
$content['answers'] = array(
'#markup' => theme('scale_answer_node_view', array(
'alternatives' => $alternatives,
)),
'#weight' => 2,
);
return $content;
}