Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mayer <christian.mayer@student.tugraz.at>2010-01-09 12:13:44 (GMT)
committer Christian Mayer <christian.mayer@student.tugraz.at>2010-01-09 12:13:44 (GMT)
commit0380738233b443ae6f46a7e48e300f8b8553b356 (patch)
treef73293d73d5b68285984ac22134242f9a0f78c42
parent4545e74816fdbf60ff7f98ae4bb101eb106d935a (diff)
parent85b7106d4b6db01c902a7be0f947d035efd1b62c (diff)
Merge branch 'master' of git://git.sugarlabs.org/rp/mainline
-rwxr-xr-xReckonPrimer.activity/display.py4
-rwxr-xr-xReckonPrimer.activity/exercises/exaddsimp.py25
-rwxr-xr-xReckonPrimer.activity/exercises/extimesdiv.py236
-rwxr-xr-xReckonPrimer.activity/session.py2
4 files changed, 135 insertions, 132 deletions
diff --git a/ReckonPrimer.activity/display.py b/ReckonPrimer.activity/display.py
index a2a26ee..92fc7ee 100755
--- a/ReckonPrimer.activity/display.py
+++ b/ReckonPrimer.activity/display.py
@@ -43,11 +43,11 @@ class Display:
#0+-------------------------+------------------------+
# | | |
#1| | OVERLAYS OF |
- # | scrolled_window | collection_table |
+ # | scrolled_window | collection_table |
#2| | OR |
# | | settings_table |
#3+-------------------------+ OR |
- # | | feedback_table |
+ # | | feedback_table |
#4| empty for calcs etc | |
# | | |
#5+-------------------------+------------------------+
diff --git a/ReckonPrimer.activity/exercises/exaddsimp.py b/ReckonPrimer.activity/exercises/exaddsimp.py
index a774436..9c8338d 100755
--- a/ReckonPrimer.activity/exercises/exaddsimp.py
+++ b/ReckonPrimer.activity/exercises/exaddsimp.py
@@ -117,16 +117,22 @@ class ExAddSimp(Exercise):
self.toggle_equal_fixed_right = gtk.ToggleButton("<<")
self.toggle_label = self.toggle_equal_fixed_right.get_child()
- self.toggle_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
- self.toggle_equal_fixed_right.connect("toggled", self.toggle_equal_fixed_right_callback)
- self._display.settings_table.attach(self.toggle_equal_fixed_right, 5, 6, 10, 11 )
+ self.toggle_label.modify_font(pango.FontDescription(
+ "sans %d" % style.zoom(12)))
+ self.toggle_equal_fixed_right.connect(
+ "toggled", self.toggle_equal_fixed_right_callback)
+ self._display.settings_table.attach(
+ self.toggle_equal_fixed_right, 7, 8, 10, 11 )
self.toggle_equal_fixed_right.show()
self.toggle_equal_fixed_left = gtk.ToggleButton("<<")
self.toggle_label = self.toggle_equal_fixed_left.get_child()
- self.toggle_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
- self.toggle_equal_fixed_left.connect("toggled", self.toggle_equal_fixed_left_callback)
- self._display.settings_table.attach(self.toggle_equal_fixed_left, 5, 6, 12, 13 )
+ self.toggle_label.modify_font(pango.FontDescription(
+ "sans %d" % style.zoom(12)))
+ self.toggle_equal_fixed_left.connect(
+ "toggled", self.toggle_equal_fixed_left_callback)
+ self._display.settings_table.attach(
+ self.toggle_equal_fixed_left, 7, 8, 12, 13 )
self.toggle_equal_fixed_left.show()
self.toggle_pos1 = gtk.ToggleButton("--")
@@ -227,12 +233,13 @@ class ExAddSimp(Exercise):
# Buttons 9 .. 0
self.number_butts = []
- for i in range(0,9+1):
+ for i in range(0,10+1):
self.toggle = gtk.ToggleButton(str(i))
self.toggle_label = self.toggle.get_child()
- self.toggle_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
+ self.toggle_label.modify_font(pango.FontDescription(
+ "sans %d" % style.zoom(12)))
self.toggle.connect("toggled", self.toggle_number_callback, i)
- self._display.settings_table.attach(self.toggle, 4, 5, 10-i, 11-i)
+ self._display.settings_table.attach(self.toggle, 6, 7, 10-i, 11-i)
self.toggle.show()
self.number_butts.append(self.toggle)
diff --git a/ReckonPrimer.activity/exercises/extimesdiv.py b/ReckonPrimer.activity/exercises/extimesdiv.py
index 3383810..d1fe8a0 100755
--- a/ReckonPrimer.activity/exercises/extimesdiv.py
+++ b/ReckonPrimer.activity/exercises/extimesdiv.py
@@ -81,162 +81,163 @@ class ExTimesDiv(Exercise):
def define_buttons(self):
"""buttons for this setting, which is specific for TimesDiv"""
- self.label = gtk.Label("2")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 0, 1, 13, 14 )
+ self.label = gtk.Label("2")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 0, 1, 13, 14 )
self.label.show()
- self.label = gtk.Label("in")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 1, 2, 13, 14 )
+ self.label = gtk.Label("in")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 1, 2, 13, 14 )
self.label.show()
- self.label = gtk.Label("2")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 2, 3, 13, 14 )
+ self.label = gtk.Label("2")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 2, 3, 13, 14 )
self.label.show()
- self.label = gtk.Label("=")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 3, 4, 13, 14 )
+ self.label = gtk.Label("=")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 3, 4, 13, 14 )
self.label.show()
- self.label = gtk.Label("1")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 4, 5, 13, 14 )
+ self.label = gtk.Label("1")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 4, 5, 13, 14 )
self.label.show()
- self.label = gtk.Label("|")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 5, 6, 13, 14 )
+ self.label = gtk.Label("|")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 5, 6, 13, 14 )
self.label.show()
self._display.settings_table.resize(15, 8)
- self.label = gtk.Label("0")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 6, 7, 13, 14 )
+ self.label = gtk.Label("0")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 6, 7, 13, 14 )
self.label.show()
- self.label = gtk.Label("2")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 0, 1, 12, 13 )
+ self.label = gtk.Label("2")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 0, 1, 12, 13 )
self.label.show()
- self.label = gtk.Label(":")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 1, 2, 12, 13 )
+ self.label = gtk.Label(":")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 1, 2, 12, 13 )
self.label.show()
- self.label = gtk.Label("2")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 2, 3, 12, 13 )
+ self.label = gtk.Label("2")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 2, 3, 12, 13 )
self.label.show()
- self.label = gtk.Label("=")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 3, 4, 12, 13 )
+ self.label = gtk.Label("=")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 3, 4, 12, 13 )
self.label.show()
- self.label = gtk.Label("1")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 4, 5, 12, 13 )
+ self.label = gtk.Label("1")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 4, 5, 12, 13 )
self.label.show()
- self.label = gtk.Label("|")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 5, 6, 12, 13 )
+ self.label = gtk.Label("|")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 5, 6, 12, 13 )
self.label.show()
- self.label = gtk.Label("0")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 6, 7, 12, 13 )
+ self.label = gtk.Label("0")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 6, 7, 12, 13 )
self.label.show()
- self.label = gtk.Label("1")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 0, 1, 9, 10 )
+ self.label = gtk.Label("1")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 0, 1, 9, 10 )
self.label.show()
- self.label = gtk.Label("*")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 1, 2, 9, 10 )
+ self.label = gtk.Label("*")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 1, 2, 9, 10 )
self.label.show()
- self.label = gtk.Label("=")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 3, 4, 9, 10 )
+ self.label = gtk.Label("=")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 3, 4, 9, 10 )
self.label.show()
- self.label = gtk.Label("2")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 4, 5, 9, 10 )
+ self.label = gtk.Label("2")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 4, 5, 9, 10 )
self.label.show()
- self.toggle_shuffle_all = gtk.ToggleButton("@")
- self.toggle_shuffle_all_label = self.toggle_shuffle_all.get_child()
- self.toggle_shuffle_all_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
- self.toggle_shuffle_all.connect("toggled", self.toggle_shuffle_all_callback)
- self._display.settings_table.attach(self.toggle_shuffle_all, 2, 3, 11, 12 )
+ self.toggle_shuffle_all = gtk.ToggleButton("@")
+ self.toggle_shuffle_all_label = self.toggle_shuffle_all.get_child()
+ self.toggle_shuffle_all_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
+ self.toggle_shuffle_all.connect("toggled", self.toggle_shuffle_all_callback)
+ self._display.settings_table.attach(self.toggle_shuffle_all, 2, 3, 11, 12 )
self.toggle_shuffle_all.show()
- self.toggle_shuffle_inner = gtk.ToggleButton("@")
- self.toggle_shuffle_inner_label = self.toggle_shuffle_inner.get_child()
- self.toggle_shuffle_inner_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
- self.toggle_shuffle_inner.connect("toggled", self.toggle_shuffle_inner_callback)
- self._display.settings_table.attach(self.toggle_shuffle_inner, 0, 1, 11, 12 )
+ self.toggle_shuffle_inner = gtk.ToggleButton("@")
+ self.toggle_shuffle_inner_label = self.toggle_shuffle_inner.get_child()
+ self.toggle_shuffle_inner_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
+ self.toggle_shuffle_inner.connect("toggled", self.toggle_shuffle_inner_callback)
+ self._display.settings_table.attach(self.toggle_shuffle_inner, 0, 1, 11, 12 )
self.toggle_shuffle_inner.show()
- self.toggle_remainder = gtk.ToggleButton("V")
- self.toggle_remainder_label = self.toggle_remainder.get_child()
- self.toggle_remainder_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
- self.toggle_remainder.connect("toggled", self.toggle_remainder_callback)
- self._display.settings_table.attach(self.toggle_remainder, 5, 7, 11, 12 )
+ self.toggle_remainder = gtk.ToggleButton("V")
+ self.toggle_remainder_label = self.toggle_remainder.get_child()
+ self.toggle_remainder_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
+ self.toggle_remainder.connect("toggled", self.toggle_remainder_callback)
+ self._display.settings_table.attach(self.toggle_remainder, 5, 7, 11, 12 )
self.toggle_remainder.show()
- self.label = gtk.Label("< - >")
- self.label.modify_font(pango.FontDescription("sans 12"))
- self._display.settings_table.attach(self.label, 0, 3, 10, 11)
+ self.label = gtk.Label("< - >")
+ self.label.modify_font(pango.FontDescription("sans 12"))
+ self._display.settings_table.attach(self.label, 0, 3, 10, 11)
self.label.show()
self.toggle_times = gtk.ToggleButton("<")
- self.toggle_times_label = self.toggle_times.get_child()
+ self.toggle_times_label = self.toggle_times.get_child()
self.toggle_times_label.modify_font(pango.FontDescription(
"sans %d" % style.zoom(12)))
self.toggle_times.connect("toggled", self.toggle_times_callback)
- self._display.settings_table.attach(self.toggle_times, 7, 8, 9, 10 )
+ self._display.settings_table.attach(self.toggle_times, 7, 8, 9, 10 )
self.toggle_times.show()
self.toggle_commute = gtk.ToggleButton("<")
- self.toggle_commute_label = self.toggle_commute.get_child()
+ self.toggle_commute_label = self.toggle_commute.get_child()
self.toggle_commute_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
self.toggle_commute.connect("toggled", self.toggle_commute_callback)
- self._display.settings_table.attach(self.toggle_commute, 7, 8, 10, 11 )
+ self._display.settings_table.attach(self.toggle_commute, 7, 8, 10, 11 )
self.toggle_commute.show()
self.toggle_div = gtk.ToggleButton("<")
- self.toggle_div_label = self.toggle_div.get_child()
+ self.toggle_div_label = self.toggle_div.get_child()
self.toggle_div_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
self.toggle_div.connect("toggled", self.toggle_div_callback)
- self._display.settings_table.attach(self.toggle_div, 7, 8, 12, 13 )
+ self._display.settings_table.attach(self.toggle_div, 7, 8, 12, 13 )
self.toggle_div.show()
self.toggle_in = gtk.ToggleButton("<")
- self.toggle_in_label = self.toggle_in.get_child()
+ self.toggle_in_label = self.toggle_in.get_child()
self.toggle_in_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
self.toggle_in.connect("toggled", self.toggle_in_callback)
- self._display.settings_table.attach(self.toggle_in, 7, 8, 13, 14 )
+ self._display.settings_table.attach(self.toggle_in, 7, 8, 13, 14 )
self.toggle_in.show()
- self.number_butts = []
-
- for i in range(2 ,9 + 1):
- self.toggle = gtk.ToggleButton(str(i))
- self.toggle_label = self.toggle.get_child()
- self.toggle_label.modify_font(pango.FontDescription("sans %d" % style.zoom(12)))
- self.toggle.connect("toggled", self.toggle_number_callback, i)
- self._display.settings_table.attach(self.toggle, 2, 3, 11-i, 12-i)
- self.toggle.show()
+ self.number_butts = []
+
+ for i in range(2 ,9 + 1):
+ self.toggle = gtk.ToggleButton(str(i))
+ self.toggle_label = self.toggle.get_child()
+ self.toggle_label.modify_font(pango.FontDescription(
+ "sans %d" % style.zoom(12)))
+ self.toggle.connect("toggled", self.toggle_number_callback, i)
+ self._display.settings_table.attach(self.toggle, 2, 3, 11-i, 12-i)
+ self.toggle.show()
self.number_butts.append(self.toggle)
def set_buttons(self, sett):
@@ -282,14 +283,14 @@ class ExTimesDiv(Exercise):
#**** callbacks ********************************************************
def toggle_shuffle_all_callback(self, widget):
- if widget.get_active():
+ if widget.get_active():
self._display._sett['shuffle_all'] = True
self.toggle_shuffle_inner.set_active(True)
else:
self._display._sett['shuffle_all'] = False
def toggle_shuffle_inner_callback(self, widget):
- if widget.get_active():
+ if widget.get_active():
self._display._sett['shuffle_inner'] = True
else:
if(self.toggle_shuffle_all.get_active()):
@@ -297,35 +298,30 @@ class ExTimesDiv(Exercise):
else:
self._display._sett['shuffle_inner'] = False
- def toggle_number_callback(self, widget, i):
-
- if widget.get_active():
- if(i < self._display._sett['min']):
- self._display._sett['min'] = i
- self.set_buttons(self._display._sett)
-
- elif( i > self._display._sett['max'] ):
- self._display._sett['max'] = i
- self.set_buttons(self._display._sett)
-
- else:
- if( i == self._display._sett['min'] ):
- if( self._display._sett['min'] == self._display._sett['max'] ):
- widget.set_active(True)
- else:
- self._display._sett['min'] = i+1
- self.set_buttons(self._display._sett)
-
- elif( i == self._display._sett['max'] ):
- if( self._display._sett['min'] == self._display._sett['max'] ):
- widget.set_active(True)
- else:
- self._display._sett['max'] = i-1
-
-
- self.set_buttons(self._display._sett)
-
- else:
+ def toggle_number_callback(self, widget, i):
+ if widget.get_active():
+ pass
+# if(i < self._display._sett['min']):
+# self._display._sett['min'] = i
+# self.set_buttons(self._display._sett)
+#
+# elif( i > self._display._sett['max'] ):
+# self._display._sett['max'] = i
+# self.set_buttons(self._display._sett)
+ else:
+ if( i == self._display._sett['min'] ):
+ if( self._display._sett['min'] == self._display._sett['max'] ):
+ widget.set_active(True)
+# else:
+# self._display._sett['min'] = i+1
+# self.set_buttons(self._display._sett)
+ elif( i == self._display._sett['max'] ):
+ if( self._display._sett['min'] == self._display._sett['max'] ):
+ widget.set_active(True)
+# else:
+# self._display._sett['max'] = i-1
+ self.set_buttons(self._display._sett)
+ else:
widget.set_active(True)
diff --git a/ReckonPrimer.activity/session.py b/ReckonPrimer.activity/session.py
index bb6f073..a399c73 100755
--- a/ReckonPrimer.activity/session.py
+++ b/ReckonPrimer.activity/session.py
@@ -32,7 +32,7 @@ class Session:
"""
#print("in Session.run")
if False: # TODO choice according to menu CM
- pass # start Author
+ pass # self._author.run()
else:
self._learner.run()
#self._co.request_exercise()