function quiz_settings_form_validate in Quiz 5
Same name and namespace in other branches
- 5.2 quiz.module \quiz_settings_form_validate()
- 6.6 quiz.admin.inc \quiz_settings_form_validate()
- 6.2 quiz.admin.inc \quiz_settings_form_validate()
- 6.3 quiz.admin.inc \quiz_settings_form_validate()
- 6.4 quiz.admin.inc \quiz_settings_form_validate()
- 6.5 quiz.admin.inc \quiz_settings_form_validate()
- 7.6 quiz.admin.inc \quiz_settings_form_validate()
- 7 quiz.admin.inc \quiz_settings_form_validate()
- 7.4 quiz.admin.inc \quiz_settings_form_validate()
- 7.5 quiz.admin.inc \quiz_settings_form_validate()
Validation form settings form
File
- ./
quiz.module, line 1326 - Quiz Module
Code
function quiz_settings_form_validate($form_id, $form_values) {
if (!is_numeric($form_values['quiz_default_close']) || $form_values['quiz_default_close'] <= 0) {
form_set_error('quiz_default_close', t('The default number of days before a quiz is closed must be a number greater than 0.'));
}
if (!is_numeric($form_values['quiz_default_pass_rate'])) {
form_set_error('quiz_default_pass_rate', t('The pass rate value must be a number between 0% and 100%.'));
}
if ($form_values['quiz_default_pass_rate'] > 100) {
form_set_error('quiz_default_pass_rate', t('The pass rate value must not be more than 100%.'));
}
if ($form_values['quiz_default_pass_rate'] < 0) {
form_set_error('quiz_default_pass_rate', t('The pass rate value must not be less than 0%.'));
}
}