A. The boys who had not done their homework had been punished by their teacher.
B. The boys were punished by their teacher who had not done their homework.
C. The boys who had not done their homework were punished by the teacher.
D. The boys who had not done their homework were being punished by the teacher.
Given sentence is in simple past tense and it is in active voice.
Rule :
Subject + (was/were) + V3 + Other agents