Explanation
The sentence " Our task had been completed before sunset " is converted to active voice, You simply need to switch the subject and object, making "We" the subject and "our task" the object, resulting in "We had completed our task before sunset.". Passive voice structure: "Object + had been + verb (past participle) + by subject". Active voice structure: "Subject + had + verb (past participle) + object".