All three are correct.
This week I assigned my students to write a notice based on the following situation:
Is to write incorrect but is "the task of writing" correct? The example below makes me think that to write is correct too?
▪ They assigned me the job of cleaning the equipment. = They assigned the job of cleaning the equipment to me. = They assigned me to clean the equipment.
Could I ask why you've changed "to write" into "the task of writing"? I'm just curious whether your version sounds better.
In my opinion, you don't "assign + verb".
I personally disagree with bennevis that "They assigned me to clean the equipment" is correct. I would have changed that to "They assigned me to the equipment-cleaning team" or "They assigned me the task of cleaning the equipment".
The following year the New Yorker assigned him to write about the Grand Ole Opry, which inspired him to put together his own show and the first A Prairie Home Companion was broadcast later that year.
The Guardian, Saturday 6 March 2004
Is it possible you just didn't know we could say it this way?
I apologise for having said I disagreed with you. I was reading these posts on my phone and the links don't show up, it simply appeared that you had written "All three are correct".
to provide a person for a particular task or position
assign somebody (to something/as something) They've assigned their best man to the job.
assign somebody to do something
British forces have been assigned to help with peacekeeping.
You don't have to apologize. I do notice that in dictionaries the passive voice is used in such cases.