diff options
Diffstat (limited to 'ReckonPrimer.activity/coach.py')
-rwxr-xr-x | ReckonPrimer.activity/coach.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ReckonPrimer.activity/coach.py b/ReckonPrimer.activity/coach.py index 310538d..861bb0b 100755 --- a/ReckonPrimer.activity/coach.py +++ b/ReckonPrimer.activity/coach.py @@ -6,12 +6,24 @@ import pickle from display import Display class Coach: - """ The coach supervises the selection of exercises. """ + """ The coach supervises the Learner. Presently he only + manages the selection of Exercises. """ print('in coach, class definition') + _learnmode = None + def __init__(self): #print("in coach.__init__") self._ex = None # the learner can change the settings of _this_ exerc + self.load_configuration_file() + + def load_configuration_file(self): + try: + configuration_file = open('data/learnmode.cfg', 'rb') + self._learnmode = pickle.load(configuration_file) + configuration_file.close() + except: + configuration_file = [] def register(self, sess, dis, collect, learner): self._sess = sess @@ -31,9 +43,13 @@ class Coach: self._dis.offer_coll_to_learner(self._collect) # calls back with notify('exerc-selected'... OR 'switch-to-setts' + def get_learnmode(self): + return(self._learnmode) + def exercise_selected(self, key): self._dis.init_calc() self._ex = self._collect.select(key) + self._learner.start_calcs(self._ex) def switch_to_settings(self, key): |