public function QuizQuestionEntityTrait::getAnsweringForm in Quiz 8.5
Same name and namespace in other branches
- 8.6 src/Entity/QuizQuestionEntityTrait.php \Drupal\quiz\Entity\QuizQuestionEntityTrait::getAnsweringForm()
- 6.x src/Entity/QuizQuestionEntityTrait.php \Drupal\quiz\Entity\QuizQuestionEntityTrait::getAnsweringForm()
Get the form through which the user will answer the question.
Question types should populate the form with selected values from the current result if possible.
Parameters
FormStateInterface $form_state: Form state.
QuizResultAnswer $quizQuestionResultAnswer: The quiz result answer.
Return value
array Form array.
6 calls to QuizQuestionEntityTrait::getAnsweringForm()
- LongAnswerQuestion::getAnsweringForm in question_types/
quiz_long_answer/ src/ Plugin/ quiz/ QuizQuestion/ LongAnswerQuestion.php - Get the form through which the user will answer the question.
- MatchingQuestion::getAnsweringForm in question_types/
quiz_matching/ src/ Plugin/ quiz/ QuizQuestion/ MatchingQuestion.php - Implementation of getAnsweringForm().
- MultichoiceQuestion::getAnsweringForm in question_types/
quiz_multichoice/ src/ Plugin/ quiz/ QuizQuestion/ MultichoiceQuestion.php - Get the form through which the user will answer the question.
- QuizDirectionsQuestion::getAnsweringForm in question_types/
quiz_directions/ src/ Plugin/ quiz/ QuizQuestion/ QuizDirectionsQuestion.php - Get the form through which the user will answer the question.
- ShortAnswerQuestion::getAnsweringForm in question_types/
quiz_short_answer/ src/ Plugin/ quiz/ QuizQuestion/ ShortAnswerQuestion.php - Get the form through which the user will answer the question.
7 methods override QuizQuestionEntityTrait::getAnsweringForm()
- LongAnswerQuestion::getAnsweringForm in question_types/
quiz_long_answer/ src/ Plugin/ quiz/ QuizQuestion/ LongAnswerQuestion.php - Get the form through which the user will answer the question.
- MatchingQuestion::getAnsweringForm in question_types/
quiz_matching/ src/ Plugin/ quiz/ QuizQuestion/ MatchingQuestion.php - Implementation of getAnsweringForm().
- MultichoiceQuestion::getAnsweringForm in question_types/
quiz_multichoice/ src/ Plugin/ quiz/ QuizQuestion/ MultichoiceQuestion.php - Get the form through which the user will answer the question.
- QuizDirectionsQuestion::getAnsweringForm in question_types/
quiz_directions/ src/ Plugin/ quiz/ QuizQuestion/ QuizDirectionsQuestion.php - Get the form through which the user will answer the question.
- QuizPageQuestion::getAnsweringForm in question_types/
quiz_page/ src/ Plugin/ quiz/ QuizQuestion/ QuizPageQuestion.php - Implementation of getAnsweringForm().
File
- src/
Entity/ QuizQuestionEntityTrait.php, line 148
Class
- QuizQuestionEntityTrait
- A trait all Quiz question strongly typed entity bundles must use.
Namespace
Drupal\quiz\EntityCode
public function getAnsweringForm(FormStateInterface $form_state, QuizResultAnswer $quizQuestionResultAnswer) {
$form = array();
$form['#element_validate'] = [
[
static::class,
'getAnsweringFormValidate',
],
];
return $form;
}