Past perfect and past simple

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

"had given"

How can we use two past perfect clauses in the same sentence?Screenshot_٢٠١٩-٠٢-٠٢-٠٠-٤١-٢٠


Images (1)
Original Post