OAKLAND - New Jersey's top education official has upheld a judge's ruling that found a Bergen County school district's round-the-clock code was unconstitutional.

The Ramapo Indian Hills Regional district temporarily banned students from sports and extracurricular activities if they were accused of drinking alcohol, using drugs or breaking other laws. It applied even if the alleged offense was committed off campus, after school and the student wasn't convicted by a court.

An administrative law judge determined the year-old policy could not be legally enforced. And acting state Education Commissioner Rochelle Hendricks recently upheld that ruling.

Hendricks noted that state law says punishment for off-campus offenses can only happen when it's necessary to spare the student or others from harm. The misconduct also must have "some link to the school environment."

AP wire services contributed to this report.