You are here

public function MultichoiceQuestion::getAnsweringFormValidate in Quiz 7.6

Same name and namespace in other branches
  1. 7.5 question_types/multichoice/multichoice.classes.inc \MultichoiceQuestion::getAnsweringFormValidate()

Question response validator.

Overrides QuizQuestion::getAnsweringFormValidate

File

question_types/multichoice/multichoice.classes.inc, line 788
The main classes for the multichoice question type.

Class

MultichoiceQuestion
Extension of QuizQuestion.

Code

public function getAnsweringFormValidate(array &$form, array &$form_state = NULL) {
  if (!$this->node->choice_multi && is_null($form_state['values']['question'][$this->node->nid]['answer']['user_answer'])) {
    form_set_error('', t('You must provide an answer.'));
  }
}