Teacher convicted of child endangerment