You are here

public function ScaleQuestion::getAnsweringFormValidate in Quiz 7.6

Same name and namespace in other branches
  1. 8.6 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::getAnsweringFormValidate()
  2. 8.5 question_types/quiz_scale/src/Plugin/quiz/QuizQuestion/ScaleQuestion.php \ScaleQuestion::getAnsweringFormValidate()
  3. 7.5 question_types/scale/scale.classes.inc \ScaleQuestion::getAnsweringFormValidate()

Question response validator.

Overrides QuizQuestion::getAnsweringFormValidate

File

question_types/scale/scale.classes.inc, line 376
The main classes for the scale question type.

Class

ScaleQuestion
Extension of QuizQuestion.

Code

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