Nicholas Prosper had planned to kill at least 30 children and two of their teachers a court has heard.