You are here

public function ShortAnswerQuestion::validateNode in Quiz 6.4

Same name and namespace in other branches
  1. 7.6 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::validateNode()
  2. 7 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::validateNode()
  3. 7.4 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::validateNode()
  4. 7.5 question_types/short_answer/short_answer.classes.inc \ShortAnswerQuestion::validateNode()

Implementation of validateNode

Overrides QuizQuestion::validateNode

See also

QuizQuestion#validateNode($form)

File

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

Class

ShortAnswerQuestion
Extension of QuizQuestion.

Code

public function validateNode(array &$form) {
  if ($this->node->correct_answer_evaluation != self::ANSWER_MANUAL && empty($this->node->correct_answer)) {
    form_set_error('correct_answer', t('An answer must be specified for any evaluation type other than manual scoring.'));
  }
}