Welcome to PyMoxQuizz’s documentation!


A MozQuizz question library for Python. See http://moxquizz.de/ for the original implementation in TCL.

class moxquizz.quiz.Question(attributes_dict)

Represents one MoxQuizz question.

EASY = 2

A value for level that indicates a question of easy difficulty.


A value for level that indicates a question of extreme difficulty or obscurity.

HARD = 4

A value for level that indicates a question of hard difficulty.

LEVELS = (1, 2, 3, 4, 5)

The available level difficulty values, TRIVIAL, EASY, NORMAL, HARD and EXTREME.


A value for level that indicates a question of average or normal difficulty.


A value for level that indicates a question of trivial difficulty.

answer = None

The answer. Arbitrary text; required. Correct answers can also be covered by the regexp property.

author = None

The question author. Arbitrary text; optional.

category = None

The question category. Arbitrary text; optional.

comment = None

A comment. Arbitrary text; optional.

level = None

The difficulty level. Value must be from the LEVELS tuple. The default value is NORMAL.


Populate fields from a dictionary of attributes, usually provided by a QuestionBank parse call.

question = None

The question. Arbitrary text; required.

regexp = None

A regular expression that will generate correct answers. Optional. See also the answer property.

score = 1

The points scored for the correct answer. Integer value; default is 1.

tip = []

An ordered list of tips (hints) to display to users. Optional.

tipcycle = 0

Indicates which tip is to be displayed next, if any.

class moxquizz.quiz.QuestionBank(filename)

Represents a MoxQuizz question bank.

KEYS = (u'Answer', u'Author', u'Category', u'Comment', u'Level', u'Question', u'Regexp', u'Score', u'Tip', u'Tipcycle')

The valid attributes available in a MoxQuizz question bank file.

LEVEL_VALUES = {u'normal': 3, u'hard': 4, u'easy': 2, u'baby': 1, u'extreme': 5, u'trivial': 1, u'difficult': 4}

Text labels for the Question.level difficulty values.

filename = u''

The path or filename of the question bank file.


Read a MoxQuizz-formatted question bank file. Returns a list of Question objects found in the file.

questions = []

A list of Question objects, constituting the questions in the question bank.

Indices and tables