You are here

public function LongAnswerQuestion::getAnsweringForm in OG Quiz 7

Implementation of getAnweringForm

Overrides QuizQuestion::getAnsweringForm

See also

QuizQuestion#getAnsweringForm($form_state, $rid)

File

includes/og_long_answer.php, line 126
Long answer classes.

Class

LongAnswerQuestion
Extension of QuizQuestion.

Code

public function getAnsweringForm(array $form_state = NULL, $rid) {
  $form = parent::getAnsweringForm($form_state, $rid);
  $form['#theme'] = 'long_answer_answering_form';
  $form['tries'] = array(
    '#type' => 'textarea',
    '#title' => t('Answer'),
    '#description' => t('Enter your answer here. If you need more space, click on the grey bar at the bottom of this area and drag it down.'),
    '#rows' => 15,
    '#cols' => 60,
    '#required' => FALSE,
  );
  if (isset($rid)) {
    $response = new LongAnswerResponse($rid, $this->node);
    $form['tries']['#default_value'] = $response
      ->getResponse();
  }
  return $form;
}