It's absolutely impossible to turn an average coder into a great coder. Because the things about code you mention in the question -
1. Beautiful 2. Modular 3. Modular 4. Maintainable
All of the four things above do not come by direct learning. They come with experience and a lot of practice.
I agree with the fact that you can make a platform to provide the user with questions that will challenge him but still there will be a part where you will give him some hints. And that will just spoil the entire working.