Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2012-12-21 18:57:49 (GMT)
committer Aneesh Dogra <lionaneesh@gmail.com>2012-12-21 19:05:16 (GMT)
commitfa352a315487c9d02d174a6c8d4c0c5bc5bd06f6 (patch)
tree4d99241537969c8dbc0cef5ca047a19b392e7cba
parent439077ffad53b7deb11c03518bff106a2a66b491 (diff)
Save the results to the file.
-rw-r--r--ConstellationsFlashCards.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/ConstellationsFlashCards.py b/ConstellationsFlashCards.py
index 0587707..1eff896 100644
--- a/ConstellationsFlashCards.py
+++ b/ConstellationsFlashCards.py
@@ -219,7 +219,7 @@ class ChartDisplay(Gtk.DrawingArea):
self.plotchart(False)
- def callback(self, widget, data=None):
+ def callback(self, widget, data=None, activity_instance=None):
global score
global seen
global quiz_count
@@ -270,7 +270,7 @@ class ChartDisplay(Gtk.DrawingArea):
labelr1.set_label(str(quiz_count) + _(" constellations seen."))
labelr3.set_label(str(correct_first_count) + _(" correct on first try."))
labelr4.set_label(str(correct_second_count) + _(" correct on second try."))
- elif data == 'reset_results':
+ elif data == 'reset_results' and activity_instance:
quiz_count = 0
correct_first_count = 0
correct_second_count = 0
@@ -278,6 +278,7 @@ class ChartDisplay(Gtk.DrawingArea):
labelr1.set_label(str(quiz_count) + _(" constellations seen."))
labelr3.set_label(str(correct_first_count) + _(" correct on first try."))
labelr4.set_label(str(correct_second_count) + _(" correct on second try."))
+ activity_instance.write_file(activity_instance.datafile)
else:
pass
return False
@@ -716,7 +717,7 @@ class ConstellationsFlashCards(activity.Activity):
# Reset Results
reset_button = ToolButton('system-restart')
reset_button.set_tooltip(_('Reset Results'))
- reset_button.connect('clicked', self.chart.callback, 'reset_results')
+ reset_button.connect('clicked', self.chart.callback, 'reset_results', self)
toolbar_box.toolbar.insert(reset_button, -1)
reset_button.show()
@@ -843,9 +844,7 @@ class ConstellationsFlashCards(activity.Activity):
def write_file(self, filename=""):
-# Write the values for the scores of all constellations.
-
-# Note: currently not used!
+ # Write the values for the scores of all constellations.
if (filename == ""):
self.identifyobject.set_label("Write_file: no filename given.")