diff options
author | Walther Neuper <neuper@neuper.(none)> | 2009-12-13 15:44:45 (GMT) |
---|---|---|
committer | Walther Neuper <neuper@neuper.(none)> | 2009-12-13 15:44:45 (GMT) |
commit | 6aafb13d5274ac3fb93dd58fc763f6805909967b (patch) | |
tree | f8f199947e1251fb3601543761b9e6ccacd18967 | |
parent | b7ef0f337cd811f09a205524b687e7b32bb13dad (diff) |
added Collection.select
-rw-r--r-- | ReckonPrimer.activity/collection.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/ReckonPrimer.activity/collection.py b/ReckonPrimer.activity/collection.py index a1293a8..e3761ad 100644 --- a/ReckonPrimer.activity/collection.py +++ b/ReckonPrimer.activity/collection.py @@ -29,24 +29,24 @@ class Collection: self._coach = coach self._active_topic = None -# def select(self, key): -# """ Select an exercise by key. """ -# #WN.LV Code ersetzen, key NICHT fuer Listen sondern fuer ... -# _sett = self._data[key] -# if _sett['topic'] == 'addsub_simp': -# return ExAddSimp(self._display, _sett) -# elif _sett['topic'] == 'exaddsub': -# return ExAddSub(self._display, _sett) -# elif _sett['topic'] == 'passten': -# return ExPassTen(self._display, _sett) -# elif _sett['topic'] == 'exmult': -# return ExMult(self._display, _sett) -# elif _sett['topic'] == 'times_div': -# return ExTimesDiv(self._display, _sett) -# elif _sett['topic'] == 'extimesadd': -# return ExTimesAdd(self._display, _sett) -# else: -# raise Exception() + def select(self, key): + """ Select an exercise by key. """ + #WN.LV Code ersetzen, key NICHT fuer Listen sondern fuer ... + _sett = self._data[key] + if _sett['topic'] == 'addsub_simp': + return ExAddSimp(self._display, _sett) + elif _sett['topic'] == 'exaddsub': + return ExAddSub(self._display, _sett) + elif _sett['topic'] == 'passten': + return ExPassTen(self._display, _sett) + elif _sett['topic'] == 'exmult': + return ExMult(self._display, _sett) + elif _sett['topic'] == 'times_div': + return ExTimesDiv(self._display, _sett) + elif _sett['topic'] == 'extimesadd': + return ExTimesAdd(self._display, _sett) + else: + raise Exception() def define_coll_gui(self): """ Define gui-elements for presenting the collcetion. """ |