diff options
Diffstat (limited to 'ReckonPrimer.activity/coach.py')
-rwxr-xr-x | ReckonPrimer.activity/coach.py | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/ReckonPrimer.activity/coach.py b/ReckonPrimer.activity/coach.py index 3406c08..57f95bd 100755 --- a/ReckonPrimer.activity/coach.py +++ b/ReckonPrimer.activity/coach.py @@ -31,19 +31,14 @@ class Coach: self._dis.offer_coll_to_learner(self._collect) # calls back with notify('exerc-selected'... OR 'switch-to-setts' - def notify(self, (msg, data)): - """called by the observed objects""" - print("in coach.notify: msg=, data=", (msg, data)) - if msg == 'setting-done': # from display - self._ex.update_setting(data) - self._learner.notify(('start-calcs', self._ex)) - elif msg == 'exerc-selected': # from collection - self._ex = self._collect.select(data) - print('in coach.notify(exerc-selected), _sett=',self._ex._sett) - self._learner.notify(('start-calcs', self._ex)) - elif msg == 'switch-to-setts': # from display - self._ex = self._collect.select(data) - self._dis.offer_setting(self._ex) - else: - raise Error() - + def exercise_selected(self, key): + self._ex = self._collect.select(key) + self._learner.start_calcs(self._ex) + + def switch_to_settings(self, key): + self._ex = self._collect.select(key) + self._dis.offer_setting(self._ex) + + def settings_done(self, settings): + self._ex.update_setting(settings) + self._learner.start_calcs(self._ex) |