- Teacher hands out sample code (one file) with errors in it, as well as a (hidden) correct example. The errors are fairly small and simple.
- Student finds errors in some of the lines
- Student submits corrected code
- Moodle compares submitted code line-by-line against the correct example and gives the student a grade.
Now, believe me, I know how difficult this could become. Ideally, one would use a complete C++ parser to somehow compare the code on a functional level and avoid differences that might be caused by comments or different formatting, but the customer believes the changes will be small enough that text matching could be used. This is good because I had a search and couldn't find any sort of C++ parser that would be suitable.
This could be implemented as a new module, as an assignment type, or even a new quiz question type. With my Moodle Manager hat on I would prefer to see it implemented as some sort of standard and generic solution for any fixed-type code or text but this is not essential.
Personally, I don't have time to work on this particular job, or a staff programmer (yet!) so I'm really advertising here for people who might be interested in doing this work. If you have some ideas about this sort of thing, feel free to post here, but if you're really interested in doing this work please contact me privately and I'll put you in touch with the customer to talk about costs etc.