(self)
| 3118 | anchor_x='left', anchor_y='center', batch=batch) |
| 3119 | self.update() |
| 3120 | def update(self): |
| 3121 | if not 'arithmetic' in mode.modalities[mode.mode] or not mode.started: |
| 3122 | self.label.text = '' |
| 3123 | return |
| 3124 | if mode.started and mode.hide_text: |
| 3125 | self.label.text = '' |
| 3126 | return |
| 3127 | |
| 3128 | self.label.font_size=calc_fontsize(16) |
| 3129 | str_list = [] |
| 3130 | str_list.append(_('Answer: ')) |
| 3131 | str_list.append(str(self.parse_answer())) |
| 3132 | self.label.text = ''.join(str_list) |
| 3133 | |
| 3134 | if cfg.SHOW_FEEDBACK and mode.show_missed: |
| 3135 | result = check_match('arithmetic') |
| 3136 | if result == _('correct'): |
| 3137 | self.label.color = cfg.COLOR_LABEL_CORRECT |
| 3138 | self.label.bold = True |
| 3139 | if result == _('incorrect'): |
| 3140 | self.label.color = cfg.COLOR_LABEL_INCORRECT |
| 3141 | self.label.bold = True |
| 3142 | else: |
| 3143 | self.label.color = cfg.COLOR_TEXT |
| 3144 | self.label.bold = False |
| 3145 | |
| 3146 | def parse_answer(self): |
| 3147 | chars = ''.join(self.answer) |
no test coverage detected