mathmaker.lib.document.content.calculation package¶
Submodules¶
mathmaker.lib.document.content.calculation.addi_direct module¶
-
class
mathmaker.lib.document.content.calculation.addi_direct.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.addi_hole module¶
-
class
mathmaker.lib.document.content.calculation.addi_hole.
sub_object
(build_data, hidden=None, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.decimal_numerals module¶
-
class
mathmaker.lib.document.content.calculation.decimal_numerals.
sub_object
(**options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.digitplace_direct module¶
-
class
mathmaker.lib.document.content.calculation.digitplace_direct.
sub_object
(**options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.digitplace_numberof module¶
-
class
mathmaker.lib.document.content.calculation.digitplace_numberof.
sub_object
(**options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.digitplace_reversed module¶
-
class
mathmaker.lib.document.content.calculation.digitplace_reversed.
sub_object
(**options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.divi_direct module¶
-
class
mathmaker.lib.document.content.calculation.divi_direct.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.divi_euclidean module¶
-
class
mathmaker.lib.document.content.calculation.divi_euclidean.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.divisibility_rule module¶
-
class
mathmaker.lib.document.content.calculation.divisibility_rule.
sub_object
(build_data, **kwargs)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.divisibility_vocabulary module¶
-
class
mathmaker.lib.document.content.calculation.divisibility_vocabulary.
sub_object
(build_data, **kwargs)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.fraction_of_a_linesegment module¶
-
class
mathmaker.lib.document.content.calculation.fraction_of_a_linesegment.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.fraction_of_a_rectangle module¶
-
class
mathmaker.lib.document.content.calculation.fraction_of_a_rectangle.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.fraction_simplification module¶
-
class
mathmaker.lib.document.content.calculation.fraction_simplification.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.mini_pb_proportionality module¶
-
class
mathmaker.lib.document.content.calculation.mini_pb_proportionality.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.mini_pb_time module¶
-
class
mathmaker.lib.document.content.calculation.mini_pb_time.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.multi_clever module¶
-
class
mathmaker.lib.document.content.calculation.multi_clever.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.multi_direct module¶
-
class
mathmaker.lib.document.content.calculation.multi_direct.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.multi_hole module¶
-
class
mathmaker.lib.document.content.calculation.multi_hole.
sub_object
(build_data, hidden=None, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.multi_reversed module¶
-
class
mathmaker.lib.document.content.calculation.multi_reversed.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.numeric_expansion module¶
-
class
mathmaker.lib.document.content.calculation.numeric_expansion.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.numeric_factorization module¶
-
class
mathmaker.lib.document.content.calculation.numeric_factorization.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.order_of_operations module¶
-
class
mathmaker.lib.document.content.calculation.order_of_operations.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
adjust_depth
(depth, n=None, **kwargs)[source]¶ Return depth to use to split a number, depending on variant etc.
This is to ensure a correct minimal value.
Parameters: - depth (int) – current depth (for instance, the default one, or the one given by the user)
- n (a number (int or Decimal)) – the number to split
Return type: int
-
adjust_nb_for_variant_11
(a, b, c, d)[source]¶ Reorder the 4 numbers to ensure a÷b - c×d >= 0
May (recursively if needed) change some values by multiplying them by 10 (if there’s no other solution).
-
adjust_nb_for_variant_13
(a, b, c, d)[source]¶ Reorder the 4 numbers to ensure a×b - c÷d >= 0
May (recursively if needed) change some values by multiplying them by 10 (if there’s no other solution).
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.percent_direct module¶
-
class
mathmaker.lib.document.content.calculation.percent_direct.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.subtr_direct module¶
-
class
mathmaker.lib.document.content.calculation.subtr_direct.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.subtr_hole module¶
-
class
mathmaker.lib.document.content.calculation.subtr_hole.
sub_object
(build_data, hidden=None, swap_complement=None, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.units_conversion module¶
-
class
mathmaker.lib.document.content.calculation.units_conversion.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.vocabulary_addi module¶
-
class
mathmaker.lib.document.content.calculation.vocabulary_addi.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.calculation.vocabulary_questions.structure
mathmaker.lib.document.content.calculation.vocabulary_divi module¶
-
class
mathmaker.lib.document.content.calculation.vocabulary_divi.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.calculation.vocabulary_questions.structure
mathmaker.lib.document.content.calculation.vocabulary_multi module¶
-
class
mathmaker.lib.document.content.calculation.vocabulary_multi.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.calculation.vocabulary_questions.structure
mathmaker.lib.document.content.calculation.vocabulary_questions module¶
-
class
mathmaker.lib.document.content.calculation.vocabulary_questions.
structure
(nbs_to_use, **kwargs)[source]¶ Bases:
mathmaker.lib.document.content.component.structure
-
js_a
(**kwargs)[source]¶ Return the object as a list of user quickly writable strings.
The elements of this list will be used in embedded javascript of pdf files to compare to user’s answer. Most of the time, only one answer is possible (like answer of ‘7×8 = ?’ is equal to ‘56’) but sometimes it is useful to have several different answers to accept, like for fractions of a figure: ‘6/12’ should lead to also accept, at least, ‘3/6’, ‘2/4’ and ‘1/2’.
Must be reimplemented in each question.
-
mathmaker.lib.document.content.calculation.vocabulary_simple_multiple_of_a_number module¶
-
class
mathmaker.lib.document.content.calculation.vocabulary_simple_multiple_of_a_number.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.calculation.vocabulary_questions.structure
mathmaker.lib.document.content.calculation.vocabulary_simple_part_of_a_number module¶
-
class
mathmaker.lib.document.content.calculation.vocabulary_simple_part_of_a_number.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.calculation.vocabulary_questions.structure
mathmaker.lib.document.content.calculation.vocabulary_subtr module¶
-
class
mathmaker.lib.document.content.calculation.vocabulary_subtr.
sub_object
(build_data, **options)[source]¶ Bases:
mathmaker.lib.document.content.calculation.vocabulary_questions.structure