Use Python, Octave or Julia to generate a series of Moodle quiz questions, that can be imported into Moodle.
The tools consist libraries and template programs, that generate a file in Moodle-XML format ready to import in Moodle.
Add the directory (octave/) to your path
octave:1> addpath("/path/to/repo/octave")
Grab and modify an example and run it.
Put python/moodle.py
where Python can find, grab and modify an example and run it. Examples are in the form of Python script and jupyter notebook.
You can also try notebook examples online on Binder