Simple: you still write an essay and you may use ai to do so. Then you throw the essay out and go and talk with the teacher about it. If you can answer intelligently it’s because you know the stuff and if not then you don’t.
Happens in tax filing too.