You are here

public function ShortAnswerQuestion::getAnsweringFormValidate in Quiz 7.6

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

Question response validator.

Overrides QuizQuestion::getAnsweringFormValidate

File

question_types/short_answer/short_answer.classes.inc, line 161
The main classes for the short answer question type.

Class

ShortAnswerQuestion
Extension of QuizQuestion.

Code

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