You are here

function quiz_ddlines_config_validate in Quiz 7.4

Same name and namespace in other branches
  1. 8.4 question_types/quiz_ddlines/quiz_ddlines.module \quiz_ddlines_config_validate()

Validate the config form values

1 string reference to 'quiz_ddlines_config_validate'
quiz_ddlines_config in question_types/quiz_ddlines/quiz_ddlines.module
Implements hook_config().

File

question_types/quiz_ddlines/quiz_ddlines.module, line 163
The main file for Quiz drag and drop with lines.

Code

function quiz_ddlines_config_validate($form, $form_state) {
  $int_fields = array(
    'quiz_ddlines_canvas_width',
    'quiz_ddlines_canvas_height',
    'quiz_ddlines_hotspot_radius',
    'quiz_ddlines_pointer_radius',
  );
  foreach ($int_fields as $field) {
    if (!_quiz_is_int($form_state['values'][$field])) {
      form_set_error($field, t('The value must be a positive number'));
    }
  }

  // Feedback fields may contain nothing or everything; no need to validate it
}