def __init__(self, teacher):
abstract.IntervalGui.__init__(self, teacher)
self.g_test_stat_dlg = None
self.std_buttons_add(('give_up', self.give_up))
##############
# config_box #
##############
self.g_mici = MultipleIntervalConfigWidget(self.m_exname)
self.config_box.pack_start(self.g_mici, False, False, 0)
box = Gtk.HBox(False, 0)
self.config_box.pack_start(box, False, False,
padding=gu.PAD_SMALL)
self._add_auto_new_question_gui(self.config_box)
# ----------------------------------
self._create_select_inputwidget_gui()
self.add_lock_to_key_gui()
self.config_box.show_all()
##############
# statistics #
##############
self.setup_statisticsviewer(statisticsviewer.StatisticsViewer,
_("Melodic interval"))
self.select_inputwidget()
def _f(watchvar):
# The variables being watched by this function will change
# when we switch lesson files or when we are in expert mode and
# the user configures the exercise manually. We only have to run
# end|start_exercise here in expert mode because it is called
# automatically when we change lesson file.
if self.m_t.m_custom_mode:
self.on_end_practise()
for i in range(self.get_int('maximum_number_of_intervals')):
self.add_watch('ask_for_intervals_%i' % i, _f)
self.add_watch('number_of_intervals', _f)
评论列表
文章目录