Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/ReckonPrimer.activity/coach.py
diff options
context:
space:
mode:
Diffstat (limited to 'ReckonPrimer.activity/coach.py')
-rwxr-xr-xReckonPrimer.activity/coach.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/ReckonPrimer.activity/coach.py b/ReckonPrimer.activity/coach.py
index 1cb4234..3406c08 100755
--- a/ReckonPrimer.activity/coach.py
+++ b/ReckonPrimer.activity/coach.py
@@ -18,21 +18,32 @@ class Coach:
self._dis = dis
self._collect = collect
self._learner = learner
+ print('in coach.register, exaddsimp =', self._collect.select(0))
+ print('in coach.register, exaddsimp._display =', self._collect.select(0)._display._testvar)
+ print('in coach.register, expassten =', self._collect.select(1))
+ print('in coach.register, expassten._display =', self._collect.select(1)._display._testvar)
+ print('in coach.register, extimesdiv=', self._collect.select(2))
+ print('in coach.register, extimesdiv._display=', self._collect.select(2)._display._testvar)
def request_exercise(self):
""" This preliminary version just lets the Learner select. """
#print("in coach.request_exercise")
self._dis.offer_coll_to_learner(self._collect)
- # calls back with notify('exerc-selected'...
+ # 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))
+ print("in coach.notify: msg=, data=", (msg, data))
if msg == 'setting-done': # from display
self._ex.update_setting(data)
- self._learner.notify((msg, self._ex))
+ 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), self._ex._sett=',self._ex._sett)
+ 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()