MDL-30398 Validations added for password field

This commit is contained in:
Ankit Kumar Agarwal 2011-11-22 14:23:05 +05:30
parent 79b0fece1f
commit 7b5abb50ce
2 changed files with 4 additions and 0 deletions

View File

@ -158,6 +158,7 @@ $string['endoflesson'] = 'End of lesson';
$string['enteredthis'] = 'entered this.';
$string['entername'] = 'Enter a nickname for the high scores list';
$string['enterpassword'] = 'Please enter the password:';
$string['emptypassword'] = 'Password cannot be empty';
$string['eolstudentoutoftime'] = 'Attention: You ran out of time for this lesson. Your last answer may not have counted if it was answered after the time was up.';
$string['eolstudentoutoftimenoanswers'] = 'You did not answer any questions. You have received a 0 for this lesson.';
$string['essay'] = 'Essay';

View File

@ -339,6 +339,9 @@ class mod_lesson_mod_form extends moodleform_mod {
if (empty($data['maxtime']) and !empty($data['timed'])) {
$errors['timedgrp'] = get_string('err_numeric', 'form');
}
if (!empty($data['usepassword']) && empty($data['password'])) {
$errors['password'] = get_string('emptypassword', 'lesson');
}
return $errors;
}