public function QuizQuestion::getNodeView in Quiz 8.4
Retrieve information relevant for viewing the node.
(This data is generally added to the node's extra field.)
Return value
Content array
7 calls to QuizQuestion::getNodeView()
- ClozeQuestion::getNodeView in question_types/
cloze/ lib/ Drupal/ cloze/ ClozeQuestion.php - Implementation of getNodeView()
- LongAnswerQuestion::getNodeView in question_types/
long_answer/ lib/ Drupal/ long_answer/ LongAnswerQuestion.php - Implementation of getNodeView
- MatchingQuestion::getNodeView in question_types/
matching/ lib/ Drupal/ matching/ MatchingQuestion.php - Implementation of getNodeView
- MultichoiceQuestion::getNodeView in question_types/
multichoice/ lib/ Drupal/ multichoice/ MultichoiceQuestion.php - Implementation of getNodeView
- ScaleQuestion::getNodeView in question_types/
scale/ lib/ Drupal/ scale/ ScaleQuestion.php - Implementation of getNodeView
7 methods override QuizQuestion::getNodeView()
- ClozeQuestion::getNodeView in question_types/
cloze/ lib/ Drupal/ cloze/ ClozeQuestion.php - Implementation of getNodeView()
- LongAnswerQuestion::getNodeView in question_types/
long_answer/ lib/ Drupal/ long_answer/ LongAnswerQuestion.php - Implementation of getNodeView
- MatchingQuestion::getNodeView in question_types/
matching/ lib/ Drupal/ matching/ MatchingQuestion.php - Implementation of getNodeView
- MultichoiceQuestion::getNodeView in question_types/
multichoice/ lib/ Drupal/ multichoice/ MultichoiceQuestion.php - Implementation of getNodeView
- ScaleQuestion::getNodeView in question_types/
scale/ lib/ Drupal/ scale/ ScaleQuestion.php - Implementation of getNodeView
File
- question_types/
quiz_question/ lib/ Drupal/ quiz_question/ QuizQuestion.php, line 293 - 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.
Namespace
Drupal\quiz_questionCode
public function getNodeView() {
$type = node_type_load($this->node
->getType());
$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;
}