You are here

function short_answer_report_validate in Quiz 6.4

Same name and namespace in other branches
  1. 8.4 question_types/short_answer/short_answer.module \short_answer_report_validate()
  2. 7 question_types/short_answer/short_answer.module \short_answer_report_validate()
  3. 7.4 question_types/short_answer/short_answer.module \short_answer_report_validate()

Validate the result report for short answer

1 string reference to 'short_answer_report_validate'
ShortAnswerResponse::getReportFormValidate in question_types/short_answer/short_answer.classes.inc
Implementation of getReportFormValidate

File

question_types/short_answer/short_answer.module, line 179
The main file for short_answer.

Code

function short_answer_report_validate($values, $form_key) {

  // Check to make sure that entered score is not higher than max allowed score.
  if (!_quiz_is_int($values['score'], 0, (int) $values['max_score'])) {
    form_set_error($form_key . '][score', t('The score needs to be a number between 0 and @max', array(
      '@max' => (int) $values['max_score'],
    )));
  }
}