You are here

function quiz_take_question_view in Quiz 8.4

Same name and namespace in other branches
  1. 6.4 quiz.module \quiz_take_question_view()
  2. 7 quiz.module \quiz_take_question_view()
  3. 7.4 quiz.module \quiz_take_question_view()

Create the view for a question the user is about to take.

Parameters

$question_node: The question node that should be rendered.

$quiz_node: The quiz node.

Return value

A string containing the body of the node.

1 call to quiz_take_question_view()
quiz_take_quiz in ./quiz.module
Handles quiz taking.

File

./quiz.module, line 2413
Quiz Module

Code

function quiz_take_question_view($question_node, $quiz_node) {
  $question_node->allow_skipping = $quiz_node->allow_skipping;
  $content = node_view($question_node, 'teaser');

  //TODO: Use \Drupal::moduleHandler()->invoke($module, $hook, $args = array()). Instead module_invoke_all().
  module_invoke_all('node_build_alter', $question_node, FALSE);

  //$question_node->body = drupal_render($question_node->content);
  return theme('quiz_single_question_node', array(
    'content' => $content,
  ));
}