Mary had always gotten good grades in school, but failed a test.
The teacher agreed and let her take the test again for a better grade.
Mary had been swimming and drowned.
Mary had been ill and hadn't studied.