diff options
author | Walther Neuper <neuper@neuper.(none)> | 2009-11-23 16:45:04 (GMT) |
---|---|---|
committer | Walther Neuper <neuper@neuper.(none)> | 2009-11-23 16:45:04 (GMT) |
commit | b40cdaec00b4fa388d524965f12e6691b2ae7246 (patch) | |
tree | 48cc10f18b3af5bb6bd931d1dfd7e22ca8dc3c49 | |
parent | 4b91b740bd200111b79bacb0a2192c54ccec054b (diff) |
removed buggy call Exercise.format_addsub_simp
-rwxr-xr-x | ReckonPrimer.activity/Exercise.py | 33 | ||||
-rwxr-xr-x | ReckonPrimer.activity/expassten.py | 6 | ||||
-rwxr-xr-x | ReckonPrimer.activity/extimesdiv.py | 2 |
3 files changed, 19 insertions, 22 deletions
diff --git a/ReckonPrimer.activity/Exercise.py b/ReckonPrimer.activity/Exercise.py index 0d97b54..3223ead 100755 --- a/ReckonPrimer.activity/Exercise.py +++ b/ReckonPrimer.activity/Exercise.py @@ -38,7 +38,7 @@ class Exercise: TODO: use self._sett['ID'] instead as soon as exs are stored.""" pass - def update_setting(self, sett): ####?????????? + def update_setting(self, sett): """The settings may be changed by the user. This method is inherited and thus not contained in subclasses.""" ####self._sett = sett @@ -49,7 +49,19 @@ class Exercise: coming through the net (TODO cooperative games, etc)""" pass - def generate_calcs(self): + def format_addsub_simp(self, (calc, linepos)): + """ Format the calc for display, prepare overlays for input. + Used within several subclasses. """ + #@print('in Display.format_addsub_simp: calc=', (calc, linepos))#@ + _ccs = collect_digits(calc) + print('in Exercise.format_addsub_simp: _ccs=',_ccs ) + _l0 = make_line(_ccs, linepos) + _ip = make_input(_ccs, linepos) + #@print('in Display.format_addsub_simp: return=', ([_l0], _ip)) #@ + return ([_l0], _ip) +#return ([[' ', '1', '0', ' ', '-', ' ', '7', ' ', '=', ' ', '_', ' ']], [(0, 10, '3', ' 10 - 7 = _ ', ' 10 - 7 = 3 ', [' ', '1', '0', ' ', '-', ' ', '7', ' ', '=', ' ', '3', ' '])]) + + def generate_calcs(self): #WN091123 make private !!! """TODO""" pass @@ -65,20 +77,3 @@ class Exercise: def set_buttons(self, sett): """XXX""" pass - - - - - - - - def format_addsub_simp(self, (calc, linepos)): - """format the calc for display, prepare overlays for input""" - #@print('in Display.format_addsub_simp: calc=', (calc, linepos))#@ - _ccs = collect_digits(calc) - print('in Display.format_addsub_simp: _ccs=',_ccs ) - _l0 = make_line(_ccs, linepos) - _ip = make_input(_ccs, linepos) - #@print('in Display.format_addsub_simp: return=', ([_l0], _ip)) #@ - return ([_l0], _ip) -#return ([[' ', '1', '0', ' ', '-', ' ', '7', ' ', '=', ' ', '_', ' ']], [(0, 10, '3', ' 10 - 7 = _ ', ' 10 - 7 = 3 ', [' ', '1', '0', ' ', '-', ' ', '7', ' ', '=', ' ', '3', ' '])]) diff --git a/ReckonPrimer.activity/expassten.py b/ReckonPrimer.activity/expassten.py index 75a05c1..3b1bbfe 100755 --- a/ReckonPrimer.activity/expassten.py +++ b/ReckonPrimer.activity/expassten.py @@ -47,9 +47,10 @@ class ExPassTen(Exercise): def format(self, (cs, ms, linepos)): """format the calc for display, prepare overlays for input""" - if ms == None: + #print('in ExPassTen.format: (cs, ms, linepos)=', (cs, ms, linepos)) + if ms is None: #@print('in Display.format_passten 1: calc=', (cs, linepos)) #@ - return Exercise.format_addsub_simp((cs, linepos)) + return self.format_addsub_simp((cs, linepos)) elif contain(cs, '+'): #@print('in Display.format_passten 2: calc=', (cs, ms, linepos))#@ if linepos == 1: ################################## unused ! @@ -207,6 +208,7 @@ class ExPassTen(Exercise): def generate_calcs(self): _dic = self._sett + print("in ExPassTen.generate_calcs: _dic=", _dic) _calcs = [] _c = [] # generate all calcs diff --git a/ReckonPrimer.activity/extimesdiv.py b/ReckonPrimer.activity/extimesdiv.py index a5aefab..c677976 100755 --- a/ReckonPrimer.activity/extimesdiv.py +++ b/ReckonPrimer.activity/extimesdiv.py @@ -64,7 +64,7 @@ class ExTimesDiv(Exercise): """generate all calculations between min..max given in dict""" #print('in Generate.times_div, (min, max)=',(_dic['min'], _dic['max'], _dic['remainder'])) _dic = self._sett - print('in Generate.times_div, _dic=', _dic) + #print('in Generate.times_div, _dic=', _dic) _calcs = [] if _dic['*']: _calcs.extend(self.tim_div(_dic['min'], _dic['max'], '*', _dic['shuffle_inner'], _dic['remainder'])) |