public function TrueFalseQuestion::getCreationForm in Quiz 8.5
Same name and namespace in other branches
- 8.6 question_types/quiz_truefalse/src/Plugin/quiz/QuizQuestion/TrueFalseQuestion.php \Drupal\quiz_truefalse\Plugin\quiz\QuizQuestion\TrueFalseQuestion::getCreationForm()
- 6.x question_types/quiz_truefalse/src/Plugin/quiz/QuizQuestion/TrueFalseQuestion.php \Drupal\quiz_truefalse\Plugin\quiz\QuizQuestion\TrueFalseQuestion::getCreationForm()
File
- question_types/
quiz_truefalse/ src/ Plugin/ quiz/ QuizQuestion/ TrueFalseQuestion.php, line 76
Class
- TrueFalseQuestion
- @QuizQuestion ( id = "truefalse", label = Plugin annotation @Translation("True/false question"), handlers = { "response" = "\Drupal\quiz_truefalse\Plugin\quiz\QuizQuestion\TrueFalseResponse" } )
Namespace
Drupal\quiz_truefalse\Plugin\quiz\QuizQuestionCode
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;
}