  Electronic quizzes are used extensively for summative and formative
assessment. Current Learning Management Systems (LMS) allow instructors to
create quizzes through a Graphical User Interface. Despite having a smooth
learning curve, question generation/editing process with such interfaces is
often slow and the creation of question variants is mostly limited to random
parameters. In this paper we argue that procedural question generation greatly
facilitates the task of creating varied, formative, up-to-date, adaptive
question banks for STEM quizzes. We present and evaluate a proof-of-concept
Python API for script-based question generation, and propose different question
design patterns that greatly facilitate question authoring. The API supports
questions including mathematical formulas, dynamically generated images and
videos, as well as interactive content such as 3D model viewers. Output
questions can be imported in major LMS. For basic usage, the required
programming skills are minimal. More advanced uses do require some programming
knowledge, but at a level that is common in STEM instructors. A side advantage
of our system is that the question bank is actually embedded in Python code,
making collaboration, version control, and maintenance tasks very easy. We
demonstrate the benefits of script-based generation over traditional GUI-based
approaches, in terms of question richness, authoring speed and content
re-usability.
