Answer:
C. Noun clause
Explanation:
A noun clause is a dependent clause (a group of words containing a subject and a verb that does not express a complete thought) that function as a noun in a sentence, therefore, it can be a subject, a direct or indirect object, a predicate nominative, or an object of a preposition; we can also identify a noun clause because it tends to begin with the words who, whoever, whom, whomever, how, that, what, whatever, when, where, whether, which, whichever, or why.
In the sentence, the clause "whoever needed them" is a noun clause because it has a subject and a verb (whoever and needed), it begins with the "whoever" word and it acts as an indirect object (the one that receives the direct object: the textbooks).