Brooklyn teacher sentenced in sex scandal case