Teachers and parents have welcomed the NSW government’s new code of conduct for school students, but the Opposition warns “the real test” still lies ahead.