public function ShortAnswerQuestion::getAnsweringForm in Quiz 7.4
Same name and namespace in other branches
- 6.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getAnsweringForm()
- 7.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getAnsweringForm()
- 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getAnsweringForm()
- 7.5 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::getAnsweringForm()
Implementation of getAnsweringForm
Overrides QuizQuestion::getAnsweringForm
See also
QuizQuestion#getAnsweringForm($form_state, $rid)
File
- question_types/
short_answer/ short_answer.classes.inc, line 135 - The main classes for the short answer question type.
Class
- ShortAnswerQuestion
- Extension of QuizQuestion.
Code
public function getAnsweringForm(array $form_state = NULL, $rid) {
$form = parent::getAnsweringForm($form_state, $rid);
//$form['#theme'] = 'short_answer_answering_form';
$form['tries'] = array(
'#type' => 'textfield',
'#title' => t('Answer'),
'#description' => t('Enter your answer here'),
'#default_value' => '',
'#size' => 60,
'#maxlength' => 256,
'#required' => FALSE,
'#attributes' => array(
'autocomplete' => 'off',
),
);
if (isset($rid)) {
$response = new ShortAnswerResponse($rid, $this->node);
$form['tries']['#default_value'] = $response
->getResponse();
}
return $form;
}