I got caught writing my student ID number after the end of the exam. Will I get in trouble? I had an exam yesterday morning which lasted 2 hours. There were two supervisors in the room for about 25-30 students. 

Before the beginning of the exam and again 5 minutes before the end, they told us not to forget to write our name and student ID number on each sheet (we used our own paper to answer the questions of the exam sheet but they had in reserve in case we had not enough), something which was also indicated at the front page of the exam question sheet.

At the end, they told us to stop writing and not leave immediately, that they will now proceed to collect all exams and check that they have all of them, after what we would be allowed leave. To do this, for each student, they stapled his/ her exam question sheet with the other sheets on which he/ she wrote his/ her answers.



Now here is my problem: while they were collecting the exams, I noticed that I had forgotten to write my student card number (not the name) on one of my sheet. So I quickly took my pen and wrote it on the sheet, something that took no more than 2 seconds. 

But then, once finished, I noticed that one of the two supervisor was looking at me with an angry frown while the other was stapling a student exam just next to him, so obviously he noticed that I had written something on one of my sheet.

They continued to collect all exams like normal. But once they were near me - I was the last student of the column -, the supervisor who had given me the angry frown collected the exam of the student in the row in front of me (there was one student sitting at each seat row end during the exam) and already directed himself with the pile of exams of our column to the main desk where they were gathering all exams, while the other supervisor was still busy stapling my exam. 

So the second supervisor then took my exam alone in his hand. This supervisor then put my exam on the main desk and then put at least one sheet that I could not identify on top of it (so he did not put it on the exam pile of our column), and so I saw it disappear. They then said we could leave and began to sort the exams in alphabetical order (at least that's what it seemed to me they were doing) 



So my questions are : 


Will I likely get accused of cheating in  a few days?
Did the other supervisor take my exam alone in order to put it on
the side so they can identify who I am?
Should I write a mail to them and explain what I was really doing?
If I really get accused, how should I behave? Should I just tell
them what I was doing even if they of course can not know if I am
lying or not?



I already talked about it with my father, who is a law professor, and he said I am dramatising the entire thing and that if they really wanted to do something, they would not have let me leave the room. Moreover, he said they could not prove anything, especially given that only one of both supervisors noticed what I was doing (and there is no video surveillance in the room). That if I really get called in the office in a few days, I would just need to say that I was writing my student card number, and that's it.


I know this is a bit long, but the more I think about it, the more I think something will happen, so I would like your opinion about that matter. 
 Thanks for your help.
You are definitely overthinking this: in the worst case, they wrote down on their report that you wrote something when the time was finished. This could result in you getting your mark slightly reduced to account for the additional time. 

I insist that this is the worst case scenario: this is clearly not a case of cheating, in all the exams I attended there are always a few students forgetting to write their student number and adding it at the end, some mistakenly writing their names, etc. 

It is actually very likely that what you interpreted as a special treatment for your paper was completely normal. In my experience papers are collected in no particular order.

Take this angry frown for what it probably is: just a warning that you should follow the instructions.