If the student hears the answer to a question in the test without meaning to, can he write it?
Question

During practical tests in medicine, we are asked to figure out the illness that the patient has. Sometimes the patient tells us what illness he has without the student asking. Is it permissible to write that down, or is that regarded as cheating, because he did not work it out himself? Likewise, if he hears it from any other person without asking him, can he write that down?
Praise be to Allah.If the student knows the diagnosis and the patient tells him without him asking him, there is nothing wrong with the student writing down what he already knows. That is not regarded as cheating, because he knew the answer before the patient told him.
But if the student did not know the diagnosis, but the patient told him without him asking, or he found out the diagnosis from some of his colleagues without meaning to, such as if he overheard it, then in that case he must tell the doctor who is supervising the test what really happened. This is a precaution, and this is the best approach.
However, if he benefitted from what he heard and wrote it in the test, then we hope that there is no blame on him, because he did not mean to do that. We heard our shaykh Muhammad ibn al-‘Uthaymin (may Allah have mercy on him) being asked about a student in the exam hall who, without meaning to, heard the answer to a question that he did not know from other students nearby; is it permissible for him to write it or not?
He replied that it is permissible, because he did not deliberately commit a sin or infraction. He made an analogy with what the Prophet (blessings and peace of Allah be upon him) said regarding one who is fasting: “Whoever forgets that he is fasting and eats or drinks, let him complete his fast, for Allah has fed him and given him to drink.” Narrated by al-Bukhari (1933) and Muslim (1155). According to the version narrated by ad-Daraqutni: “It is provision that Allah granted to him.” Ibn al-Qayyim said: This is a sahih isnad.
And Allah knows best.