1) By the time they wrote the text the lesson had already been over.
2) Before my parents came home I had done all my homework.
3) I didnt know about it because nobody had informed me about it.
4) When I phoned my friend, he had already left.
5) When we arrived at the party, the drinks had already been served.