The teacher accepted a police caution for attempted voyeurism