diff options
author | Walther Neuper <wneuper@localhost.(none)> | 2010-05-17 13:49:36 (GMT) |
---|---|---|
committer | Walther Neuper <wneuper@localhost.(none)> | 2010-05-17 13:49:36 (GMT) |
commit | 2be2e8c3a606e11ebf4ebddb41c78f027bacced4 (patch) | |
tree | 90d35aecc63f748a4f4c39f1d1e5b04fff48d853 | |
parent | 4d4362ee90b887c85ebfd98c7e8d4014c624151a (diff) | |
parent | 9f7c29765b405cb91c6ea82ec4c7be3c811fbcef (diff) |
Merge branch 'wintersw'
Conflicts:
ReckonPrimer.activity/data/Collection.data
ReckonPrimer.activity/display.py
ReckonPrimer.activity/exstore.py
ReckonPrimer.activity/settings.py
-rw-r--r-- | ReckonPrimer.activity/data/Collection.data | 646 | ||||
-rw-r--r-- | ReckonPrimer.activity/display.py | 49 | ||||
-rw-r--r-- | ReckonPrimer.activity/exstore.py | 253 | ||||
-rw-r--r-- | ReckonPrimer.activity/reckonprimeractivity.py (renamed from ReckonPrimer.activity/ReckonPrimerActivity.py) | 0 | ||||
-rw-r--r-- | ReckonPrimer.tests/extimesdiv/test_extd_format.py | 72 |
5 files changed, 896 insertions, 124 deletions
diff --git a/ReckonPrimer.activity/data/Collection.data b/ReckonPrimer.activity/data/Collection.data index d2291bf..9dcd015 100644 --- a/ReckonPrimer.activity/data/Collection.data +++ b/ReckonPrimer.activity/data/Collection.data @@ -17,6 +17,7 @@ p7 (dp8 g2 (lp9 +<<<<<<< HEAD:ReckonPrimer.activity/data/Collection.data sS'_pic' p10 NsS'_title' @@ -241,4 +242,649 @@ p81 sg13 S'aber ben\xc3\xb6tigt zum richtigen speichern/lesen' p82 +======= +(icollection +Collection +p10 +(dp11 +g2 +(lp12 +(itask +Task +p13 +(dp14 +S'_eval' +p15 +(lp16 +sS'_sett' +p17 +(dp18 +S'cut-max' +p19 +I01 +sS':' +p20 +I00 +sS'icon' +p21 +NsS'title' +p22 +S'2-er Reihe' +p23 +sS'shuffle_all' +p24 +I01 +sS'MAX' +p25 +I50 +sS'*commute' +p26 +I00 +sS'*' +p27 +I01 +sS'descript' +p28 +S'settings: series (2,4,8 is possible!) of *, "in" and : with remainder, series 11..19 (left bar),series 10..90 (right long bar), separate shuffling or operands.' +p29 +sS'factors' +p30 +(lp31 +I2 +asS'topic' +p32 +S'times_div' +p33 +sS'MIN' +p34 +I10 +sS'in' +p35 +I00 +sS'vadd' +p36 +I0 +sS'shuffle_inner' +p37 +I01 +sS'remainder' +p38 +I00 +sS'vmult' +p39 +I1 +sS'calclines' +p40 +I1 +ssba(itask +Task +p41 +(dp42 +g15 +(lp43 +sg17 +(dp44 +g19 +I01 +sg20 +I00 +sg21 +Nsg22 +S'3-er Reihe' +p45 +sg24 +I01 +sg25 +I50 +sg26 +I00 +sg27 +I01 +sg28 +g29 +sg30 +(lp46 +I3 +asg32 +g33 +sg34 +I10 +sg35 +I00 +sg36 +I0 +sg37 +I01 +sg38 +I00 +sg39 +I1 +sg40 +I1 +ssba(itask +Task +p47 +(dp48 +g15 +(lp49 +sg17 +(dp50 +g19 +I01 +sg20 +I00 +sg21 +Nsg22 +S'4-er Reihe' +p51 +sg24 +I01 +sg25 +I50 +sg26 +I00 +sg27 +I01 +sg28 +g29 +sg30 +(lp52 +I4 +asg32 +g33 +sg34 +I10 +sg35 +I00 +sg36 +I0 +sg37 +I01 +sg38 +I00 +sg39 +I1 +sg40 +I1 +ssba(itask +Task +p53 +(dp54 +g15 +(lp55 +sg17 +(dp56 +g19 +I01 +sg20 +I00 +sg21 +Nsg22 +S'5-er Reihe' +p57 +sg24 +I01 +sg25 +I50 +sg26 +I00 +sg27 +I01 +sg28 +g29 +sg30 +(lp58 +I5 +asg32 +g33 +sg34 +I10 +sg35 +I00 +sg36 +I0 +sg37 +I01 +sg38 +I00 +sg39 +I1 +sg40 +I1 +ssba(itask +Task +p59 +(dp60 +g15 +(lp61 +sg17 +(dp62 +g19 +I01 +sg20 +I00 +sg21 +Nsg22 +S'6-er Reihe' +p63 +sg24 +I01 +sg25 +I50 +sg26 +I00 +sg27 +I01 +sg28 +g29 +sg30 +(lp64 +I6 +asg32 +g33 +sg34 +I10 +sg35 +I00 +sg36 +I0 +sg37 +I01 +sg38 +I00 +sg39 +I1 +sg40 +I1 +ssba(itask +Task +p65 +(dp66 +g15 +(lp67 +sg17 +(dp68 +g19 +I01 +sg20 +I00 +sg21 +Nsg22 +S'7-er Reihe' +p69 +sg24 +I01 +sg25 +I50 +sg26 +I00 +sg27 +I01 +sg28 +g29 +sg30 +(lp70 +I7 +asg32 +g33 +sg34 +I10 +sg35 +I00 +sg36 +I0 +sg37 +I01 +sg38 +I00 +sg39 +I1 +sg40 +I1 +ssba(itask +Task +p71 +(dp72 +g15 +(lp73 +sg17 +(dp74 +g19 +I01 +sg20 +I00 +sg21 +Nsg22 +S'8-er Reihe' +p75 +sg24 +I01 +sg25 +I50 +sg26 +I00 +sg27 +I01 +sg28 +g29 +sg30 +(lp76 +I8 +asg32 +g33 +sg34 +I10 +sg35 +I00 +sg36 +I0 +sg37 +I01 +sg38 +I00 +sg39 +I1 +sg40 +I1 +ssba(itask +Task +p77 +(dp78 +g15 +(lp79 +sg17 +(dp80 +g19 +I01 +sg20 +I00 +sg21 +Nsg22 +S'9-er Reihe' +p81 +sg24 +I01 +sg25 +I50 +sg26 +I00 +sg27 +I01 +sg28 +g29 +sg30 +(lp82 +I9 +asg32 +g33 +sg34 +I10 +sg35 +I00 +sg36 +I0 +sg37 +I01 +sg38 +I00 +sg39 +I1 +sg40 +I1 +ssbasS'_pic' +p83 +NsS'_title' +p84 +S"Einzelne Reihen . und 'in'" +p85 +sS'_description' +p86 +S' ' +p87 +sba(icollection +Collection +p88 +(dp89 +g2 +(lp90 +sg83 +Nsg84 +S'Mehrere Reihen .' +p91 +sg86 +S'Wir ueben zusammengehoerende Reihen.' +p92 +sba(icollection +Collection +p93 +(dp94 +g2 +(lp95 +sg83 +Nsg84 +S'Alle Reihen gemischt' +p96 +sg86 +g87 +sbasg83 +Nsg84 +S"Uebungen . und 'in' " +p97 +sg86 +g87 +sba(icollection +Collection +p98 +(dp99 +g2 +(lp100 +sg83 +Nsg84 +S'Uebungen :' +p101 +sg86 +g87 +sba(icollection +Collection +p102 +(dp103 +g2 +(lp104 +sg83 +Nsg84 +S'Uebungen + und - ' +p105 +sg86 +g87 +sbasg83 +Nsg84 +S'Praxis Volksschule' +p106 +sg86 +S'Rechenuebungen fuer die 1. und 2.Klasse, festgelegt am 16.Dez.09 mit Nina Jaklitsch und Arndt Stoeckl .' +p107 +sba(icollection +Collection +p108 +(dp109 +g2 +(lp110 +sg83 +Nsg84 +S'Schoenberger' +p111 +sg86 +S'Most efficient introduction to the four basic arithmetic operations as taught by Igo Schoenberger in the last century in Upper Austria.' +p112 +sba(icollection +Collection +p113 +(dp114 +g2 +(lp115 +(itask +Task +p116 +(dp117 +g15 +(lp118 +sg17 +(dp119 +S'min' +p120 +I0 +sS'=input' +p121 +(lp122 +I1 +aI3 +aI5 +asg19 +I01 +sS'_+_=_' +p123 +I01 +sg22 +S'Template: + - within 10' +p124 +sg25 +I100 +sS'+' +p125 +I01 +sg34 +I20 +sg28 +S'settings: range of result, input at 3 positions, swap around =' +p126 +sS'input=' +p127 +(lp128 +I1 +aI3 +aI5 +asg32 +S'addsub_simp' +p129 +sg40 +I1 +sS'-' +p130 +I01 +sS'max' +p131 +I1 +sS'_=_+_' +p132 +I00 +sS'shuffle' +p133 +I00 +sg21 +Nssba(itask +Task +p134 +(dp135 +g15 +(lp136 +sg17 +(dp137 +g120 +I2 +sg19 +I01 +sS'newline' +p138 +I01 +sg22 +S'Template: + - passing the 10 barrier' +p139 +sg24 +I00 +sg25 +I150 +sg125 +I01 +sg34 +I10 +sg28 +S'settings: range of 1st operand, input left and right from =, input intermediate result, separate shuffling of operands.' +p140 +sg32 +S'passten' +p141 +sg40 +I1 +sg130 +I00 +sg131 +I2 +sS'input' +p142 +(lp143 +I3 +asg37 +I00 +sg21 +Nssba(itask +Task +p144 +(dp145 +g15 +(lp146 +sg17 +(dp147 +g30 +(lp148 +I2 +aI4 +asg37 +I00 +sg27 +I00 +sg22 +S'Template: * : "in" series' +p149 +sg24 +I00 +sg25 +I50 +sg26 +I00 +sg34 +I10 +sg28 +g29 +sg36 +I0 +sg32 +g33 +sg40 +I1 +sg35 +I00 +sg19 +I01 +sg20 +I01 +sg38 +I00 +sg39 +I1 +sg21 +Nssbasg83 +Nsg84 +S'Templates' +p150 +sg86 +S'These are the (classes of) exercises all others are derived from. Thus, please, do not deletem them. For testing exercises disabling of @ is recommended.' +p151 +sbasg83 +Nsg84 +S'root = invisible node' +p152 +sg86 +S'required by tree structure' +p153 +>>>>>>> wintersw:ReckonPrimer.activity/data/Collection.data sb.
\ No newline at end of file diff --git a/ReckonPrimer.activity/display.py b/ReckonPrimer.activity/display.py index 6ec3737..0f1c70a 100644 --- a/ReckonPrimer.activity/display.py +++ b/ReckonPrimer.activity/display.py @@ -72,7 +72,8 @@ class Display: self.main_window = window # Save the sugar main window # whole window with 5 lines and 2 columns - self.table = gtk.Table(5, 2, True) + #self.table = gtk.Table(5, 2, True) + self.table = gtk.Table(10, 2, True) self.table.set_row_spacings(2) self.table.set_col_spacings(2) self.main_window.set_canvas(self.table) @@ -101,8 +102,10 @@ class Display: # Connect log_view and scrolled window self.scrolled_window.add(self.log_view) - # Insert the log_view into the upper half - self.table.attach(self.scrolled_window, 0, 1, 0, 3) + # Insert the log_view into the upper half on left side + # TODO make bottom depend on exercise._sett['calclines'] + #self.table.attach(self.scrolled_window, 0, 1, 0, 3) + self.table.attach(self.scrolled_window, 0, 1, 0, 5) self.log_view.show() self.scrolled_window.show() # make empty lines such that all calcs are entered at bottom @@ -170,10 +173,15 @@ class Display: self.info_table.attach(self.ex_num_label, 7, 9, 6, 7) self.ex_num_label.show() # Insert the 3 tables into the right half of the screen - self.table.attach(self.exercise_table, 1, 2, 0, 5) - self.table.attach(self.exstore_table, 1, 2, 0, 5) - self.table.attach(self.settings_table, 1, 2, 0, 5) - self.table.attach(self.info_table, 0, 1, 3, 5) + #self.table.attach(self.exercise_table, 1, 2, 0, 5) + self.table.attach(self.exercise_table, 1, 2, 0, 10) + #self.table.attach(self.exstore_table, 1, 2, 0, 5) + self.table.attach(self.exstore_table, 1, 2, 0, 10) + #self.table.attach(self.settings_table, 1, 2, 0, 5) + self.table.attach(self.settings_table, 1, 2, 0, 10) + #self.table.attach(self.info_table, 0, 1, 3, 5) + self.table.attach(self.info_table, 0, 1, 7, 10) + self.exercise_table.attach(self.feedback_table, 0, 9, 11, 13) # show all tables, scrolled_window already shown above self.exstore_table.show() # treat uniformly ! @@ -237,7 +245,8 @@ class Display: self.settings_table = gtk.Table(14, 9, True) self.settings_table.set_row_spacings(2) self.settings_table.set_col_spacings(2) - self.table.attach(self.settings_table, 1, 2, 0, 5) + #self.table.attach(self.settings_table, 1, 2, 0, 5) + self.table.attach(self.settings_table, 1, 2, 0, 10) self.settings_table_show() self.exstore_table.show() self.info_table.show() @@ -438,7 +447,8 @@ class Display: self.calc_table = gtk.Table(5, 1, True) self.calc_table.set_row_spacings(2) self.calc_table.set_col_spacings(2) - self.table.attach(self.calc_table, 0, 1, 0, 5) + #self.table.attach(self.calc_table, 0, 1, 0, 5) + self.table.attach(self.calc_table, 0, 1, 6, 10) self.calc_table.show() """display the lines of a calc with _ at all input positions""" @@ -456,7 +466,8 @@ class Display: calculation, cursor = line, linepos self.calculation_box = gtk.HBox(True, 0) calc_pos = 0 - self.calc_table.attach(self.calculation_box, 0, 1, 3 + lineno, 4 + lineno) + #self.calc_table.attach(self.calculation_box, 0, 1, 3 + lineno, 4 + lineno) + self.calc_table.attach(self.calculation_box, 0, 1, 0 + lineno, 1 + lineno) for i in calculation: if (calc_pos != cursor): self.label = gtk.Label(i) @@ -523,24 +534,6 @@ class Display: self.tree_scrolled_window.show() self.set_coll_to_learner() # set finish_learner_coll_butt + callback - '''def switch_exercise(self): - """ Another exercise has been selected. """ - # WN091215 DAS IST AB JETZT FALSCH: ex<->sett + ex<->coll moeglich - self.settings_table.destroy() - self.settings_table = gtk.Table(14, 9, True) - self.settings_table.set_row_spacings(2) - self.settings_table.set_col_spacings(2) - self.table.attach(self.settings_table, 1, 2, 0, 5) - self.settings_table.show() - - #self.feedback_table.destroy() - self.feedback_table = gtk.Table(14, 9, True) - self.feedback_table.set_row_spacings(2) - self.feedback_table.set_col_spacings(2) - self.table.attach(self.feedback_table, 1, 2, 0, 5) - self.feedback_table_show() - ''' - def set_select_exerc_semaphore(self, coll_key): """ Sets a semaphore for finish_collect_callback. """ #print('in display.set_select_exerc_semaphore, coll_key', self._coll_key) diff --git a/ReckonPrimer.activity/exstore.py b/ReckonPrimer.activity/exstore.py index a12a77c..8f38fa1 100644 --- a/ReckonPrimer.activity/exstore.py +++ b/ReckonPrimer.activity/exstore.py @@ -31,108 +31,169 @@ class ExStore: self._display = display self._coach = coach self._active_exerc = None - #self._sett = Settings() - #Provisorium für die "3-Button-Version" vvvvvvvvvvvvvvvvvvvvvvvvv - #self._data = [(self._sett.get_setting('addsub_simp'), []), - # (self._sett.get_setting('passten'), []), - # (self._sett.get_setting('times_div'), [])] - #Provisorium für die "3-Button-Version" ^^^^^^^^^^^^^^^^^^^^^^^^^ #Provisorium für impl. "treeView-Kollektion" vvvvvvvvvvvvvvvvvvvv - _ex010 = Task({'topic' : 'addsub_simp', - 'title' : 'template exaddsimp', - 'descript': 'addition and subtraction without carry, \ - i.e. without passing the 10 barrier. ', - 'icon' : None, # for quick reference of the exercise - 'calclines': 1, # no. of lines for calc to be input. - 'MAX' : 30, # maximum of calcs generated. - # Generate fills up by varying input. - 'MIN' : 20, # minimum of calcs generated UNUSED - 'min' : 0, # minimum in size of a number in a calc - 'max' : 1, # maximum in size of a number in a calc - # 0 <= min <= max <= 10 - '+' : True, # make all additions min..max - '-' : True, # make all subtactions min..max - '_+_=_' : True, # = is _right_ from operator, e.g. 1+2=3 - 'input=' : [1,3,5],# list of positions in calc: 1 | 3 | 5 - # where input is possible; - # actual positions chosen by Generate. - '_=_+_' : False, # = is _left_ from operator, e.g. 3=1+2 - '=input' : [1,3,5],# analogous to '_+_=_' - 'shuffle': True, # shuffle _all_ the calcs - 'cut-max': True # cut set of all calcs down to MAX - }, []) - _ex011 = Task({'topic' : 'passten', - 'title' : 'template expassten', - 'descript': 'addition and subtraction with carry, \ - i.e. with passing the 10 barrier. ', - 'icon' : None, # for quick reference of the exercise - 'calclines' : 1, # or 2 iff 'newline' : True. - 'MAX' : 150, # maximum of calcs generated; - # TODO: Generate fills up by varying input. - 'MIN' : 10, # minimum of calcs generated 090416WN:UNUSED - '+' :True, # + crossing the ten barrier!! - '-' :False, # - goes below the ten barrier!!! - # (i.e. iteration on left arg. is "outer" loop) - 'min' : 2, # +: minimum in size of number in left argument - #'min' : 5, # +: minimum in size of number in left argument - # -: minimum in size of result - 'max' : 2, # +: maximum in size of number in left argument - # -: maximum in size of result - #'max' : 9, # +: maximum in size of number in left argument - 'input' :[3], # list of positions in calc 3 | 5 - # where input is possible; - # actual positions chosen by Generate. - 'newline' : True, # display 2nd line for intermediate results - 'shuffle_all' : False, # shuffle all calcs - 'shuffle_inner': False, # shuffle only 1st (inner) iteration - 'cut-max' : True # cut set of all calcs down to MAX - }, []) - _ex012 = Task({'topic' : 'times_div', #for programmers only
- 'title' : 'template extimesdiv',
- 'descript': 'multiplication, division and "in" \
- from 2 to 19 and 20 to 190. ',
- 'icon' : None, # for quick reference of the exercise
- 'calclines' : 1, # no. of lines for calc to be input.
- 'MAX' : 50, # maximum of calcs generated;
- # TODO: Generate fills up by varying input.
- 'MIN' : 10, # minimum of calcs generated 090416WN:UNUSED
- '*' : False, # eg. 7 . 2 =_
- '*commute' : False, # commute the operands 2 . 7 = _
- ':' : True, # 14 : 2 = _
- 'in' : False, # 2 in 14 = _
- 'remainder' : False, # : | in ... with remainder
- 'vadd' : 0, # 0 or 10, for 1.11 ... 1.19
- 'vmult' : 1, # 1 or 10, for 1.10 ... 1.90
- 'min' : 2, # +: minimum number in right *operand
- # -: minimum result
- 'max' : 2, # +: maximum number in right *operand
- # -: maximum result - 'factors' : [2,4], # Liste mit ausgewählten zahlen zur berechnung
- 'shuffle_all' : False, # shuffle all calcs
- 'shuffle_inner': False, # shuffle only 1st (inner) iteration
- 'cut-max' : True # cut set of all calcs down to MAX
- }, []) - _coll00 = Collection("Add Sub: + & -", - "hier sind alle 1x1-Reihen mit 'in'", - None, []) - _coll01 = Collection("Times Division: x & in", - "hier sind alle 1x1-Reihen mit 'in'", - None, [_ex010, _ex011, _ex012]) +####### _c1 ################################################################## +####### _c1c1c1t ############################################################# + _sett = {'topic' : 'times_div', + 'title' : '99-er Reihe', + 'descript' : 'settings: series (2,4,8 is possible!) of *, "in" and : with remainder, series 11..19 (left bar),series 10..90 (right long bar), separate shuffling or operands.', + 'icon' : None, + 'calclines' : 1, + 'MAX' : 50, + + 'MIN' : 10, + '*' : True, + '*commute' : False, + ':' : False, + 'in' : False, + 'remainder' : False, + 'vadd' : 0, + 'vmult' : 1, + 'factors' : [99], + 'shuffle_all' : True, + 'shuffle_inner': True, + 'cut-max' : True + } + _sett['factors'] = [2]; _sett['title'] = '2-er Reihe' + _c1c1c1t2 = Task(copy.deepcopy(_sett), []) + _sett['factors'] = [3]; _sett['title'] = '3-er Reihe' + _c1c1c1t3 = Task(copy.deepcopy(_sett), []) + _sett['factors'] = [4]; _sett['title'] = '4-er Reihe' + _c1c1c1t4 = Task(copy.deepcopy(_sett), []) + _sett['factors'] = [5]; _sett['title'] = '5-er Reihe' + _c1c1c1t5 = Task(copy.deepcopy(_sett), []) + _sett['factors'] = [6]; _sett['title'] = '6-er Reihe' + _c1c1c1t6 = Task(copy.deepcopy(_sett), []) + _sett['factors'] = [7]; _sett['title'] = '7-er Reihe' + _c1c1c1t7 = Task(copy.deepcopy(_sett), []) + _sett['factors'] = [8]; _sett['title'] = '8-er Reihe' + _c1c1c1t8 = Task(copy.deepcopy(_sett), []) + _sett['factors'] = [9]; _sett['title'] = '9-er Reihe' + _c1c1c1t9 = Task(copy.deepcopy(_sett), []) +####### _c1c1c2t ############################################################# +# _sett['factors'] = [2,4]; _sett['title'] = '2,4-er Reihe' +# _c1c1c2t1 = Task(copy.deepcopy(_sett), []) +# _sett['factors'] = [2,4,8]; _sett['title'] = '2,4,8-er Reihe' +# _c1c1c2t2 = Task(copy.deepcopy(_sett), []) +# #_sett['factors'] = [5,10]; _sett['title'] = '-er Reihe' +# #_c1c1c2t2 = Task(copy.deepcopy(_sett), []) +# _sett['factors'] = [3,6]; _sett['title'] = '3,6-er Reihe' +# _c1c1c2t3 = Task(copy.deepcopy(_sett), []) +# _sett['factors'] = [3,6,9]; _sett['title'] = '3,6,9-er Reihe' +# _c1c1c2t4 = Task(copy.deepcopy(_sett), []) +####### _c1c1c3t ############################################################# - _coll02 = Collection("Pass Ten: ->10", - "hier sind alle 1x1-Reihen mit 'in'", - None, []) - _coll0 = Collection("Templates", - "Hier finden Sie alle verfügbaren Templates", - None, [_coll00, _coll01, _coll02]) +####### _c2 ################################################################## +####### _c3 ################################################################## + _c3t1 = Task({'topic' : 'addsub_simp', + 'title' : 'Template: + - within 10', + 'descript' : 'settings: range of result, input at 3 positions, swap around =', + 'icon' : None, # for quick reference of the exercise + 'calclines': 1, # no. of lines for calc to be input. + 'MAX' : 100, # maximum of calcs generated. + # Generate fills up by varying input. + 'MIN' : 20, # minimum of calcs generated UNUSED + 'min' : 0, # minimum in size of a number in a calc + 'max' : 1, # maximum in size of a number in a calc + # 0 <= min <= max <= 10 + '+' : True, # make all additions min..max + '-' : True, # make all subtactions min..max + '_+_=_' : True, # = is _right_ from operator, e.g. 1+2=3 + 'input=' : [1,3,5],# list of positions in calc: 1 | 3 | 5 + # where input is possible; + # actual positions chosen by Generate. + '_=_+_' : False, # = is _left_ from operator, e.g. 3=1+2 + '=input' : [1,3,5],# analogous to '_+_=_' + 'shuffle' : False, # shuffle _all_ the calcs + 'cut-max' : True # cut set of all calcs down to MAX + }, []) + _c3t2 = Task({'topic' : 'passten', + 'title' : 'Template: + - passing the 10 barrier', + 'descript' : 'settings: range of 1st operand, input left and right from =, input intermediate result, separate shuffling of operands.', + 'icon' : None, # for quick reference of the exercise + 'calclines' : 1, # or 2 iff 'newline' : True. + 'MAX' : 150, # maximum of calcs generated; + # TODO: Generate fills up by varying input. + 'MIN' : 10, # minimum of calcs generated 090416WN:UNUSED + '+' :True, # + crossing the ten barrier!! + '-' :False, # - goes below the ten barrier!!! + #(i.e. iteration on left arg. is "outer" loop) + 'min' : 2, # +: minimum in size of number in left argument + 'max' : 2, # +: maximum in size of number in left argument + 'input' :[3], # list of positions in calc 3 | 5 + # where input is possible. + 'newline' : True, # display 2nd line for intermediate results + 'shuffle_all' : False,# shuffle all calcs + 'shuffle_inner': False,# shuffle only 1st (inner) iteration + 'cut-max' : True # cut set of all calcs down to MAX + }, []) + _c3t3 = Task({'topic' : 'times_div', #for programmers only + 'title' : 'Template: * : "in" series', + 'descript' : 'settings: series (2,4,8 is possible!) of *, "in" and : with remainder, series 11..19 (left bar),series 10..90 (right long bar), separate shuffling or operands.', + 'icon' : None, # for quick reference of the exercise + 'calclines' : 1, # no. of lines for calc to be input. + 'MAX' : 50, # maximum of calcs generated; + # TODO: Generate fills up by varying input. + 'MIN' : 10, # minimum of calcs generated 090416WN:UNUSED + '*' : False, # eg. 7 . 2 =_ + '*commute' : False, # commute the operands 2 . 7 = _ + ':' : True, # 14 : 2 = _ + 'in' : False, # 2 in 14 = _ + 'remainder' : False, # : | in ... with remainder + 'vadd' : 0, # 0 or 10, for 1.11 ... 1.19 + 'vmult' : 1, # 1 or 10, for 1.10 ... 1.90 + 'factors' : [2,4], # Liste mit ausgewählten zahlen zur berechnung + 'shuffle_all' : False, # shuffle all calcs + 'shuffle_inner': False, # shuffle only 1st (inner) iteration + 'cut-max' : True # cut set of all calcs down to MAX + }, []) - #constructor of collections root - self._root = Collection("root = invisible node", - "aber benötigt zum richtigen speichern/lesen", - None, [_coll0]) + self._root = \ +Collection("root = invisible node","required by tree structure", None, + [Collection("Praxis Volksschule", #_c1 + "Rechenuebungen fuer die 1. und 2.Klasse, festgelegt am 16.Dez.09 mit Nina Jaklitsch und Arndt Stoeckl .", + None, + [Collection("Uebungen . und 'in' ", #_c1c1 + " ", None, + [Collection("Einzelne Reihen . und 'in'", #_c1c1c1 + " ", None, + [_c1c1c1t2, _c1c1c1t3, _c1c1c1t4, _c1c1c1t5, + _c1c1c1t6, _c1c1c1t7, _c1c1c1t8, _c1c1c1t9 + ]), + Collection("Mehrere Reihen .", + "Wir ueben zusammengehoerende Reihen.", None, + [ + ]), + Collection("Alle Reihen gemischt", + " ", None, + [ + ]) + ]), + Collection("Uebungen :", #_c1c2 + " ", None, + [ + ]), + Collection("Uebungen + und - ", #_c1c3 + " ", None, + [ + ]) + ]), + Collection("Schoenberger", #_c2 + "Most efficient introduction to the four basic arithmetic \ + operations as taught by Igo Schoenberger in the last century \ + in Upper Austria.", + None, + [ + ]), + Collection("Templates", #_c3 + "These are the (classes of) exercises all others are derived \ + from. Thus, please, do not deletem them. \ + For testing exercises disabling of @ is recommended.", None, + [_c3t1, _c3t2, _c3t3]) + ]) # comment to save changes (order of the items) till the next start diff --git a/ReckonPrimer.activity/ReckonPrimerActivity.py b/ReckonPrimer.activity/reckonprimeractivity.py index 20f2e1d..20f2e1d 100644 --- a/ReckonPrimer.activity/ReckonPrimerActivity.py +++ b/ReckonPrimer.activity/reckonprimeractivity.py diff --git a/ReckonPrimer.tests/extimesdiv/test_extd_format.py b/ReckonPrimer.tests/extimesdiv/test_extd_format.py new file mode 100644 index 0000000..e19a623 --- /dev/null +++ b/ReckonPrimer.tests/extimesdiv/test_extd_format.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +print("====================================_____________________=============") +print("===== ReckonPrimer.tests/extimesdiv/test_extd_format.py =============") + +from extimesdiv import ExTimesDiv + +_sett = {'topic' : 'times_div', #for programmers only + 'title' : 'template extimesdiv', + 'descript': 'multiplication, division and "in" \ + from 2 to 19 and 20 to 190. ', + 'icon' : None, # for quick reference of the exercise + 'calclines' : 1, # no. of lines for calc to be input. + 'MAX' : 100, # maximum of calcs generated; + # TODO: Generate fills up by varying input. + 'MIN' : 10, # minimum of calcs generated 090416WN:UNUSED + '*' : False, # eg. 7 . 2 =_ + '*commute' : False, # commute the operands 2 . 7 = _ + ':' : False, # 14 : 2 = _ + 'in' : True, # 2 in 14 = _ + 'remainder' : True, # : | in ... with remainder + 'vadd' : 0, # 0 or 10, for 1.11 ... 1.19 + 'vmult' : 1, # 1 or 10, for 1.10 ... 1.90 + 'min' : 2, # +: minimum number in right *operand + # -: minimum result + 'max' : 2, # +: maximum number in right *operand + # -: maximum result + 'shuffle_all' : False, # shuffle all calcs + 'shuffle_inner': False, # shuffle only 1st (inner) iteration + 'cut-max' : True # cut set of all calcs down to MAX + } +_ex = ExTimesDiv(None, (_sett, None)) +_ex._generate_calcs() +#_calc = _ex.get_next_calc() +#print("in test_extd_format: _calc=", _calc) +_calc1 = (['2', 'in', '2', '0', '=', '1', '0', '|', '0'], 5) +_calc2 = (['1', '2', 'in', '2', '0', '=', '1', '|', '8'], 5) +print("in test_extd_format@@@@@@@@@@@@@: _calc1=", _calc1) +_form1 = _ex.format(_calc1) +print("in test_extd_format@@@@@@@@@@@@@: _form1=", _form1) +""" +([[' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '_', '_', '|', '_', ' ']], + [(0, 13, '0', ' 2 in 20 = 10|_ ', ' 2 in 20 = 10|0 ', + [' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '0', '|', '0', ' '] + ), + (0, 11, '0', ' 2 in 20 = 1_|_ ', ' 2 in 20 = 10|_ ', [' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '0', '|', '_', ' ']), + (0, 10, '1', ' 2 in 20 = __|_ ', ' 2 in 20 = 1_|_ ', [' ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '_', '|', '_', ' '])])) +""" + +print(len(['1','2','3','a',' '])) + +([[] + ] +) + + +print("in test_extd_format@@@@@@@@@@@@@: _calc2=", _calc2) +_ex.format(_calc2) + + + + + + + +[' ','1 ', '2', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '1', '|', '8', ' '] + + + +[' ','1 ', '2', '0', ' ', 'in', ' ', '2', '0', ' ', '=', ' ', '0', '|', '1','2', '0', ' '] + + |