Prosecutor criticises school over run-up to mass shooting