Student critical after shooting himself at school