The correct option is D who was
A relative pronoun functions as a pronoun, as it relates to the noun that's common between two sentences. It also functions as a conjunction as it combines those two sentences. In the given statement, "the boy" is the antecedent as it requires a relative pronoun that relates it to the rest of the sentence. Here, the sentence is in passive voice, the boy is scolded 'by someone', but it isn't mentioned who that 'someone' is. "The boy" is the subject, "was scolded" is the verb, and the object has been omitted, because the sentence is not focused on who scolded the boy. A sentence in the passive voice focuses on the action "was scolded". The relative pronoun should be of the same number and person as its antecedent, hence option D is correct as 'who' and 'was' is singular as 'the boy' is. 'Whom were' is incorrect, because 'whom' is a relative pronoun used for object antecedents, whereas the antecedent here is the subject. Similarly, 'whom was' is also incorrect and options A and B are wrong. 'Were' is a verb generally used for a plural noun, whereas 'the boy' is a singular noun, hence 'were' cannot be used and option C is incorrect.