You are here

public function QuizQuestion::getAnsweringForm in OG Quiz 7

Get the form through which the user will answer the question.

Parameters

$form_state: The FAPI form_state array

$rid: The result id.

Return value

Must return a FAPI array. At the moment all form elements that takes user response must have a key named "tries". (This is a Quiz 3.x legacy AFAIK. I'm not thrilled about it...)

1 call to QuizQuestion::getAnsweringForm()
LongAnswerQuestion::getAnsweringForm in includes/og_long_answer.php
Implementation of getAnweringForm
1 method overrides QuizQuestion::getAnsweringForm()
LongAnswerQuestion::getAnsweringForm in includes/og_long_answer.php
Implementation of getAnweringForm

File

includes/og_quiz_question.php, line 514
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 getAnsweringForm(array $form_state = NULL, $rid) {

  //echo $this->node->type;exit;
  $form = array();
  $form['question_nid'] = array(
    '#type' => 'hidden',
    '#value' => $this->node->nid,
  );

  /*$body = field_get_items('node', $this->node, 'body');
    $form['question'] = array(
      '#markup' => check_markup($body[0]['value'], $body[0]['format']),
      '#prefix' => '<div class="quiz-question-body">',
      '#suffix' => '</div>',
    );*/
  return $form;
}