"Prerequisite" here is a non sequitur, and it seems like you wanted to use a different word, like "preamble".
If homework was indeed a prerequisite, those who didn't do it wouldn't be allowed to take the exam. That logic is then contradicted by your next sentence.