qtype_code is a question type that autocorrects source code based on some settings. The question creator can select an environment in which the student's code will be run, as well as env-specific settings. Feedback can be customized by the grader application, and any programming language is supported.
The environment system is very powerful and robust, being able to support several types of correction methods. Compiling and running can be done inside a docker container, being completely isolated from the host.
This question type also uses Moodle's logger, creating an entry every time some code is executed. The content of the logger can be customized by the environment.
- Extract the source code into your Moodle folder.
- Create the directory
/var/moodlecode/envand make it writable by your apache user. - (Optional but recommended) Change the value of
env::$secretonenv.class.phpto a random alphanumeric string - Create an environment