See the screencast below for the description of new moosh feature – code generation. You can download moosh from Moodle plugins, also see the documentation.

Make it fullscreen to see the details!

Alternatively watch it via youtube: