You are here

public function TrueFalseQuestion::getAnsweringFormValidate in Quiz 7.6

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

Question response validator.

Overrides QuizQuestion::getAnsweringFormValidate

File

question_types/truefalse/truefalse.classes.inc, line 143
Defines the classes necessary for a True/False quiz.

Class

TrueFalseQuestion
Extension of QuizQuestion.

Code

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