All our in-house question types are available on github here. However, I doubt they're what you want right now, as they're extremely complex with minimal documentation.
I attach an xml export of an implemention of your even_array question. It looks like this (displaying the integers as floats):

Behind the scenes what's happening here is:
- The template has been changed to a useful general-purpose form that runs the contents of the globalextra field before running each test. Further each test runs the contents of its TEST.extra field before each test.
{{ STUDENT_ANSWER }} SEPARATOR = "#<ab@17943918#@>#" {{ QUESTION.globalextra }} {% for TEST in TESTCASES %} {{ TEST.extra }} {{ TEST.testcode }} {% if not loop.last %} print(SEPARATOR) {% endif %} {% endfor %} - I've set the globalextra field to Python code that redefines the print function to convert any parameters that are numpy arrays to floats. It's best to use globalextra for this rather than TEST.extra to avoid repeating it for every test.
import numpy as __np__ __saved_print__ = print def print(*args, **kwargs): newargs = [arg.astype(float) if isinstance(arg, __np__.ndarray) else arg for arg in args] __saved_print__(*newargs, **kwargs)
However, with this approach, be prepared to field questions from students asking why the coderunner output displays all the numbers with a decimal point after them, whereas when they test their own code there are no decimal points.