You are here

public function QuizQuestion::getNodeView in Quiz 7.6

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

Retrieve information relevant for viewing the node.

(This data is generally added to the node's extra field.)

Return value

Content array

6 calls to QuizQuestion::getNodeView()
LongAnswerQuestion::getNodeView in question_types/long_answer/long_answer.classes.inc
Implementation of getNodeView
MatchingQuestion::getNodeView in question_types/matching/matching.classes.inc
Implementation of getNodeView
MultichoiceQuestion::getNodeView in question_types/multichoice/multichoice.classes.inc
Implementation of getNodeView
ScaleQuestion::getNodeView in question_types/scale/scale.classes.inc
Implementation of getNodeView
ShortAnswerQuestion::getNodeView in question_types/short_answer/short_answer.classes.inc
Implementation of getNodeView

... See full list

6 methods override QuizQuestion::getNodeView()
LongAnswerQuestion::getNodeView in question_types/long_answer/long_answer.classes.inc
Implementation of getNodeView
MatchingQuestion::getNodeView in question_types/matching/matching.classes.inc
Implementation of getNodeView
MultichoiceQuestion::getNodeView in question_types/multichoice/multichoice.classes.inc
Implementation of getNodeView
ScaleQuestion::getNodeView in question_types/scale/scale.classes.inc
Implementation of getNodeView
ShortAnswerQuestion::getNodeView in question_types/short_answer/short_answer.classes.inc
Implementation of getNodeView

... See full list

File

question_types/quiz_question/quiz_question.core.inc, line 162
Classes used in the Quiz Question module.

Class

QuizQuestion
A base implementation of a quiz_question, adding a layer of abstraction between the node API, quiz API and the question types.

Code

public function getNodeView() {
  $type = node_type_get_type($this->node);
  $content['question_type'] = array(
    '#markup' => '<div class="question_type_name">' . $type->name . '</div>',
    '#weight' => -2,
  );

  /*
   $question_body = field_get_items('node', $this->node, 'body');
   $content['question'] = array(
   '#markup' => '<div class="question-body">' . $question_body[0]['safe_value'] . '</div>',
   '#weight' => -1,
   );
  */
  return $content;
}