Fixes bug in teacher account generator so that it properly handles
student_id values less than 4 characters for both numbers and letters.
Previously it would fail padding non-numeric IDs.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
# If the ID value is less than 4 characters, pad the value
# with zeros to be 4 characters long. This will effect
# the barcode and password. Only do this for teacher accounts.
- $phash->{student_id} = sprintf('%0.4d', $phash->{student_id})
+ $phash->{student_id} = sprintf('%04s', $phash->{student_id})
if $is_teacher && length($phash->{student_id}) < 4;
# All teacher ID's, which can be alpha-numeric, are upper case.