CodeRunner is a free open-source question-type plug-in for Moodle that can run program code submitted by students in answer to a wide range of programming questions in many different languages.
Anyone with a Learn course can link through to CodeRunner via the “UOE STACK” tool in your Learn course. Chris Sangwin in the School of Mathematics set this up and they are very pleased with it for Python and MATLAB. They also have plans for C++, R and Maxima in the future, and other languages may be supported on request.
If you would like to use CodeRunner in your course, please get in touch.