You are absolutely right of course that the Markov property tells us that probability of failing the seventh exam only depends on the result of the sixth exam. However, this question asks for the probability that the first exam failed is the 7th. This means we have to explicitly consider the paths through the state space that meet this condition.
As a general rule of thumb, if the question asks for a probability that doesn't seem like a standard transition probability (ie it is not the probability of going from one state to another in a set number of steps), then I'd try considering different possible sample paths through the state space that meet the given requirements.
In this case, for example, it is not the 6-step transition probability from pass (passing the first exam) to fail (failing the seventh), as this would include all possible paths that mean another exam could be failed before the seventh.
Another way to think about this is by considering the following probabilities:
P(fail 7 | pass 1,2,3,4,5,6) = P(fail 7 | pass 6) = (1-a)
as you point out.
However, we also have:
P(fail 7 | pass 1, 2, 3, fail 4, 5, pass 6) = P(fail 7 | pass 6) = (1-a)
In the second scenario the 7th exam is not the first exam that they failed (as they also failed 4 and 5).
So, the (1-a) is only considering the final transition, it tells me the probability of failing 7 given I pass 6 but we want the probability that 7 is the first fail.
Hope that helps!