If I am your partner , I would not be upset because chances will be there for every one , so I start learning
I would try convincing him by telling that the mistake may not be from the teacher. He may have gone wrong somewhere due to which he would have lost marks. But there is nothing to worry there will be more tests in future in which with extra hardwork he can improve his results. I would try to calm him down and ask the teacher for apologize for his mistake. If doesn't have the courage to tell her he can write an apology letter and give it to her.