public function TrueFalseQuestion::getCreationForm in Quiz 7.5
Same name and namespace in other branches
- 6.6 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
- 6.3 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseQuestion::getCreationForm()
- 6.4 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
- 6.5 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseQuestion::getCreationForm()
- 7.6 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
- 7 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
- 7.4 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
Implementation of getCreationForm().
Overrides QuizQuestion::getCreationForm
See also
QuizQuestion::getCreationForm()
File
- question_types/
truefalse/ truefalse.classes.inc, line 149 - TrueFalse classes.
Class
- TrueFalseQuestion
- Extension of QuizQuestion.
Code
public function getCreationForm(array &$form_state = NULL) {
$form['correct_answer'] = array(
'#type' => 'radios',
'#title' => t('Correct answer'),
'#options' => array(
1 => t('True'),
0 => t('False'),
),
'#default_value' => isset($this->node->correct_answer) ? $this->node->correct_answer : 1,
'#required' => TRUE,
'#weight' => -4,
'#description' => t('Choose if the correct answer for this question is "true" or "false".'),
);
return $form;
}