Here are the answers to your exercises:
3. Past Perfect / Past Perfect Continuous:
A: Mum was really angry at me.
B: I know. She had been cleaning the house all morning when you stepped in with those muddy shoes.A: Did Sally help you with the dinner party last night?
B: No, we had prepared everything by the time she got home.A: Why was Tracy so happy to see her uncle?
B: She had not seen him for eight months.A: Was Jenny upset that I called her so late?
B: No, she had not gone to bed yet.A: Lisa was exhausted yesterday.
B: I know. She had been studying for a history exam all day.
4. Past Tense:
Peter was talking on the phone when I went to his office, so I didn't want to interrupt him.
We didn't see Jane at the party because when we got there she had already gone home.
When did James graduate from university?
John had been trying to fix his computer for two hours before he decided to call a professional.
Sam did not win the Young Inventor of the Year Award last year, but he's sure he will this year.