Let's look at every possible answer:
Afterwards-
Afterwards, he had informed us that the quiz would happen tomorrow.
If the students were surprised by the teacher saying the quiz was that day, the teacher wouldn't have said it was actually the next day afterwards. This is not the answer.
Earlier-
Earlier, he had informed us that the quiz would happen tomorrow.
If the teacher had said earlier the test was tomorrow then turned around and decided it be today, then of course the students would be surprised. This is a possible answer.
Equally-
Equally, he had informed us that the quiz would happen tomorrow.
Equally means "in the same manner." If the teacher said the test would be today equal to tomorrow, that just doesn't make sense. This is not the answer.
Nevertheless-
Nevertheless, he had informed us that the quiz would happen tomorrow.
Nevertheless just means "all the same" or just "still." This is kind of like equally, and is not the right answer.
So the answer is B. Earlier, which means before. It makes the most sense and fits perfectly in context.