The attack took place as the students – thought to be mainly girls – were leaving the Kabul school.