コード例 #1
0
ファイル: divi_direct.py プロジェクト: o2edu/mathmaker
 def q(self, **options):
     if self.context == 'mini_problem':
         return post_process(self.wording.format(**self.wording_format))
     else:
         return _("Calculate: {math_expr}")\
             .format(
             math_expr=shared.machine.write_math_style2(self.quotient_str))
コード例 #2
0
 def q(self, **options):
     if self.context == 'mini_problem':
         return post_process(self.wording.format(**self.wording_format))
     else:
         self.substitutable_question_mark = True
         return _('{math_expr} = {q_mark}').format(
             math_expr=shared.machine.write_math_style2(self.product_str),
             q_mark=COLORED_QUESTION_MARK)
コード例 #3
0
 def q(self, **options):
     if self.context == 'angles':
         if self.slideshow:
             col_widths = [6, 7]
         else:
             col_widths = [8.25, 4.75]
         self.substitutable_question_mark = True
         return shared.machine.write_layout(
             (1, 2),
             col_widths,
             [self.angles_bunch.drawn,
              _('${math_expr}$ = {q_mark}')
              .format(math_expr=self.angles_bunch.angles[0].name,
                      q_mark=COLORED_QUESTION_MARK)])
     elif hasattr(self, 'wording'):
         return post_process(self.wording.format(**self.wording_format))
     else:
         self.substitutable_question_mark = True
         return _('{math_expr} = {q_mark}')\
             .format(
             math_expr=shared.machine.write_math_style2(self.diff_str),
             q_mark=COLORED_QUESTION_MARK)
コード例 #4
0
 def q(self, **options):
     return post_process(self.wording.format(**self.wording_format))
コード例 #5
0
def test_post_process():
    """Checks if non breaking spaces are correctly inserted."""
    assert post_process('It weighs about 45 kg.') == \
        'It weighs about 45' + shared.markup['nonbreaking_space'] + 'kg.'
コード例 #6
0
def test_post_process():
    """Checks if non breaking spaces are correctly inserted."""
    assert post_process('It weighs about 45 kg.') == \
        'It weighs about 45' + shared.markup['nonbreaking_space'] + 'kg.'
コード例 #7
0
 def q(self, **options):
     return post_process(self.wording.format(**self.wording_format))\
         .replace('QUESTION_MARK', COLORED_QUESTION_MARK)