Here is a sentence from the student book year 2 secondary:
He wasn't feeling well yesterday as he had been working hard all weekend. He had been trying to do the homework which the teacher ..........him last week.
A- gave b-had given
The answer in the book is
How can we use two past perfect clauses in the same sentence?
Hello, Ahmed A.,
Thanks for providing thorough documentation of the source of the question. I agree with the answer "had given," even though "gave" is also possible there.
The first use of the past perfect, "had been trying," locates his trying to do the homework further in the past than the time of his not feeling well.
The second use of the past perfect, "had given," specifies that the homework was given to him before yesterday. This is further specified by "last week."
"He had been trying to finish the homework the teacher gave him" (without "last week") could mean that he was doing the homework the day he got it.