MDL-30398 Validations added for password field
This commit is contained in:
committed by
Eloy Lafuente (stronk7)
parent
25641ce2da
commit
0c6182c125
@@ -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';
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user