School to be built for pupils at risk of exclusion