I was not aware of GitHub ClassRoom as mentioned by @Ryan_Nutt above, but I have been using repl.it for classroom coding exercises.
It will do auto-correction (based on unit-tests or output matching) and will allow commenting. Students do not need to be able to use git, and can code their solution in an ide or online. Pasting their code in will let them test if it passes. You can view and comment on their code, albeit not an inline comment you can reference the line.
It is free. I link to it from Moodle and with the link the class can "join" my repl class. It also lets them save code in the cloud so that code from class can be saved online and therefore accessible from home.
It's worth a look and could be built up over time (exercises etc.). I have 10 in my class at the moment, am teaching with Python, and was able to import 115 questions another teacher had created, so there is opportunity to get up an running relatively quickly.
As an aside, I did find that creating questions from fresh a bit cumbersome but some of this may be because I found it difficult to even get started making a classroom at the beginning.
Hope this might be of some benefit to you.
Sean.