The correct answer is: D. We had completed our task before sunset.
The sentence “Our task had been completed before sunset” is in the past perfect tense. This tense is used to talk about an action that was completed before a specific time in the past. In this case, the specific time is “sunset.” The past perfect tense is formed with the past participle of the verb (in this case, “completed”) and the auxiliary verb “had.”
The other options are incorrect because they do not use the past perfect tense. Option A, “We completed our task before sunset,” is in the simple past tense. This tense is used to talk about an action that was completed at a specific time in the past. Option B, “We have completed our task before sunset,” is in the present perfect tense. This tense is used to talk about an action that has been completed or that is ongoing up to the present time. Option C, “We complete our task before sunset,” is in the simple present tense. This tense is used to talk about an action that is repeated or habitual.
In conclusion, the correct answer is: D. We had completed our task before sunset.