Step-by-step explanation:
There are 2 ways to go in this case. You could either be honest, or fake it 'till you make it.
Let's say you decide to be honest. You could either come fully clean, or tell your professor you left your essay at home, if you are allowed to look at it.
Faking it 'till you make it is risky. You don't know how long it has to be, and might cut it too short. You're better off faking it.