Put the verb in brackets into Past Perfect Simple or Past Perfect Continuous Tense.
I didn't see Peter at the party yesterday. Was he even there?
No, he wasn't. He was still under his car when I was leaving. He (repair) it for the whole week and he felt angry because he couldn't find the mistake. This morning, he finally called the mechanic.