Pupils write exams outside after setting fire to school hall