mathmaker.lib.document.frames package¶
Submodules¶
mathmaker.lib.document.frames.exercise module¶
-
class
mathmaker.lib.document.frames.exercise.
Exercise
(**options)[source]¶ Bases:
object
-
questions_list
¶
-
-
class
mathmaker.lib.document.frames.exercise.
Q_info
(id, kind, subkind, nb_source, options, order)¶ Bases:
tuple
-
id
¶ Alias for field number 0
-
kind
¶ Alias for field number 1
-
nb_source
¶ Alias for field number 3
-
options
¶ Alias for field number 4
-
order
¶ Alias for field number 5
-
subkind
¶ Alias for field number 2
-
-
mathmaker.lib.document.frames.exercise.
auto_adjust_nb_sources
(nb_sources: list, q_i: collections.namedtuple)[source]¶ Automatically adjust nb_sources for certains questions.
Parameters: - nb_sources – the provided numbers sources
- q_i – the Q_info object (namedtuple), whose fields are ‘id,kind,subkind,nb_source,options’
-
mathmaker.lib.document.frames.exercise.
get_common_nb_from_pairs_pair
(pair)[source]¶ Return the common number found in a pair of pairs.
Parameters: pair (a tuple or a list (of two elements)) – the pair of pairs Return type: number
-
mathmaker.lib.document.frames.exercise.
merge_pair_to_tuple
(n_tuple, pair, common_nb)[source]¶ Add one number from the pair to the n_tuple.
It is assumed n_tuple and pair both contain common_nb. If n_tuple has more than 2 elements, it is also assumed that the first one is common_nb. If it has 2 elements, then it might need to get reordered. :param n_tuple: a tuple of 2 or more elements :type n_tuple: tuple :param pair: a tuple of 2 elements. One of them (at least) is common_nb, and will be removed, the other one will be added to n_tuple :type pair: tuple :param common_nb: the number contained in both n_tuple and pair :type common_nb: a number :rtype: tuple
-
mathmaker.lib.document.frames.exercise.
numbering_device
(numbering_kind='disabled')[source]¶ This generator provides “limitless” new items for numbering questions.
Possible values of the argument are: - ‘disabled’: an empty string will be returned - ‘numeric’: an integer is returned (until the maximal value is reached, but let’s consider there won’t be that long exercises!) - ‘alphabetic’: a letter is returned (once the alphabet is over, as a security, the letter is returned doubled, tripled, etc., thought it is not expected to need more than 26 questions in the same exercise.)
mathmaker.lib.document.frames.question module¶
mathmaker.lib.document.frames.sheet module¶
Module contents¶
-
class
mathmaker.lib.document.frames.
Sheet
(theme, subtheme, sheet_name, **options)[source]¶ Bases:
object