This is one of "22 virus definitions" (thought-mistakes that cause ineffectiveness and unnecessary negative emotions).
As Seligman wrote: If you did poorly on a test, many factors could have contributed to that outcome. You may have been tired, the test might have been unusually difficult, the other students might have done exceptionally well (thus raising the grading curve), you might not have studied as much as you should have, the professor might have graded unfairly, you might not be very smart, and so on.
All of those are possible causes of the setback (your poor grade is the setback in this case). Some people leap to the most demoralizing conclusion and fixate on that, ignoring the other causes, debilitating themselves and feeling bad when it was entirely avoidable (and penalty-free).
That was a lot to pack into one paragraph, so let me explain it a little better. First, you hit a setback, which means something didn't go the way you'd hoped. And you feel let down by it. You feel demoralized. The bad feeling causes you to focus on whatever explanation for the setback popped into your head first. Usually this will be the most dire explanation. You focus on that one and ignore the fact that many different causes influenced how things turned out. Many of those other causes wouldn't make you feel so bad, but you are ignoring them.
For example, I create a blog and I write stuff, and I can see more and more people coming to my site, and everything is great, and all of a sudden my traffic starts to go down! This is a setback. And I feel upset. I think to myself, "They've all come and looked at my site and rejected it. I am a lousy blogger." I ignore several other possible influencing factors like this is a holiday weekend or random variation or the photo of Paris Hilton I keep putting on every blog post. I am fixated on my dire and catastrophic explanation for my setback, and it sends me into a deep depression. Why? Because I have committed the thought-mistake of ignoring alternatives. The virus has infected my mind.
What should I do? Why, of course: Put myself right with the antivirus for the mind and restore my determination as quickly as possible.
See the complete list of definitions: The 22 Virus Definitions.