You are here

public function TrueFalseQuestion::getCreationForm in Quiz 7.5

Same name and namespace in other branches
  1. 6.6 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
  2. 6.3 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseQuestion::getCreationForm()
  3. 6.4 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
  4. 6.5 question_types/quiz_question/quiz_question.truefalse.inc \TrueFalseQuestion::getCreationForm()
  5. 7.6 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
  6. 7 question_types/truefalse/truefalse.classes.inc \TrueFalseQuestion::getCreationForm()
  7. 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;
}