You are here

function quiz_question_node_view in Quiz 7.4

Same name and namespace in other branches
  1. 8.4 question_types/quiz_question/quiz_question.module \quiz_question_node_view()
  2. 7.5 question_types/quiz_question/quiz_question.module \quiz_question_node_view()

File

question_types/quiz_question/quiz_question.module, line 558
Quiz Question module. This module provides the basic facilities for adding quiz question types to a quiz.

Code

function quiz_question_node_view($node) {
  if (_quiz_is_taking_context() && array_key_exists($node->type, _quiz_question_get_implementations())) {
    if (empty($node->no_answer_form)) {

      /*
       * @todo: I see no reason why this should be a part of view anymore.
       * In quiz 5 we should stop using hook_view to view the answering form
       */
      $form = drupal_get_form('quiz_question_answering_form', $node);
      $form_markup = drupal_render($form);
      if (!empty($form_markup)) {
        $node->content['question_form'] = array(
          '#markup' => $form_markup,
          '#weight' => 30,
        );
      }
    }
  }
}