You can get curry/shit smell if you get very close to a curry skin, I am assuming you were at least 3-4 ft away from him because it was an exam hall. But such a long distance shit smell has one and only explanation, he was farting and you were sniffing it. Don't do that, curry farts can be lethal.
Did you start to get the smell as soon as the exam began? Was the exam difficult? Because curries generally fart in the exam hall as soon as they get the question papers, it's their natural defense mechanism against stress and threat. Also the stench of the smell gets strong with the difficulty level of the exam. In 2015 I took a graduate math course called "combinatorics" and the subject was hard as fuck, there were 3/4 curries in the class, I took a gas mask during the final exam because I knew what was going to happen. Many students left the exam hall early without answering all the questions, but I solved all of them.