You are here

public function MatchingQuestion::getAnsweringFormValidate in Quiz 7.5

Same name and namespace in other branches
  1. 7.6 question_types/matching/matching.classes.inc \MatchingQuestion::getAnsweringFormValidate()

Question response validator.

Overrides QuizQuestion::getAnsweringFormValidate

File

question_types/matching/matching.classes.inc, line 240
Matching classes.

Class

MatchingQuestion
Extension of QuizQuestion.

Code

public function getAnsweringFormValidate(array &$element, &$values) {
  foreach ($values as $value) {
    if ($value != 'def') {
      return TRUE;
    }
  }
  form_error($element, t('You need to match at least one of the items.'));
}