I first read this paradox in Martin Gardner's "The improbable hanging ..."
A prisoner was sentenced by a judge to hang, the following week, on a day he could not predict.
His lawyer reasoned like the brilliant student here, and he convinced the prisoner he was safe from execution.
On Wednesday, however, the hangman executed him.
Much to his surprise.
To analyze, consider the judge saying simply, "you will be executed next week on an unannounced day."
Now the prisoner fears for his life each day.
Adding the constraint "you can't figure out which day" really adds nothing to the situation.
It means only that the Judge makes the decision independently.
We can make it simpler.
The judge says "You will be executed within one day. You can't know what day that will be."
The lawyer says, well, if it's within one day it must be tomorrow. Since we know it must be tomorrow, it can't be tomorrow.
The prisoner is executed tomorrow - unexpectedly.
The reasoning of safety is unreliable: certainty that it won't happen makes the happening unexpected and therefore permissible.
The operative statement is "you will be executed within one day."
The rest is a red herring.
Not even if the teacher said: "You will have a drop quiz next week in a way that you will never know for sure it's the next day!"?