Yesterday I put a lot of time helping someone very new to SO and programming in general. It even needed a chat session. Near the end he didn't get how to implement the code I posted and basically asked : "write it for me"
The bugs he created by doing a bad copy/paste job had nothing to do with the original question and would have taken it completely off topic. The question itself at the moment is a frankenstein beast composed off the original question in text and a mangled version of the code from my answer.
I suggested an edit to the question, rolling it back to before he posted the code in. This got rejected because it did no longer reflect the question of the OP. At the moment the answers do not cover all the problems (which would involve teaching him all the basics).
So is it better to leave a bad question out there that is not at all helpful to other people or again suggest a roll back, and maybe get it back to a state where it is a simple question with a correct answer.