The testgen.py module provides a set of utilities for creating tests from a set of testbanks. A testbank is a text file with labelled questions. The format of the testbank is:
%%e
%%b <label2> Question 2 %%e ~~~~~
A call to testgen.parseQuestionBank(f) where f if a file object referring to the test bank, will return a dictionary of label:question relations.