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))
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)
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)
def q(self, **options): return post_process(self.wording.format(**self.wording_format))
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.'
def q(self, **options): return post_process(self.wording.format(**self.wording_format))\ .replace('QUESTION_MARK', COLORED_QUESTION_MARK)