Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-30398 Validations added for password field

  • Loading branch information...
commit 6fe2462f989ff52655ba3303c9a7a4c3d26ab81c 1 parent 1f8ca42
@ankitagarwal ankitagarwal authored stronk7 committed
Showing with 4 additions and 0 deletions.
  1. +1 −0  mod/lesson/lang/en/lesson.php
  2. +3 −0  mod/lesson/mod_form.php
View
1  mod/lesson/lang/en/lesson.php
@@ -158,6 +158,7 @@
$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
3  mod/lesson/mod_form.php
@@ -339,6 +339,9 @@ function validation($data, $files) {
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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.