Man in situations like this, Teachers will always have the reason. Since you are just a simple student they wont even care about if you are lying or not. Problem is, since they told you beforehand that the test had an essay exam, and you didnt told the teacher in the exam day that yours didnt had the essay part, that makes you kinda guilty of the act. So basically, what you can do is, beg to the teacher, and play the character of the guilty one because, protecting yourself for somethin that they told you before, is not the best thing to do. Good luck man.