The sentence, "The examination has been cancelled. You needn't have done all the revison, after all."means that the student didn't have to do the revision, but he has done that. Can "need't have done" be changed into "didn't need to have done", by all means, "didn't need to have done" seems grammatical-corret.
Learn English – “didn’t need to have done” or “needn’t have done”
differenceslanguage-formation
Best Answer
In my dialect, need may pattern as an auxiliary, giving forms such as
It may also take do support:
and it nearly always does so for questions:
(Need you go? is grammatical but old fashioned for me, and I probably wouldn't say it.)
I believe that in some dialects of English, the auxiliary patterning (need not) is obsolete, and people will always say don't need to.