[gcompris/gcomprisbraille] Green fill for correct sequence else red|Added makefile.am files



commit bf631156dde9a7696b02a6b7e7d850a9cba09e94
Author: SrishAkaTux <srishakatux gmail com>
Date:   Wed Aug 24 19:53:02 2011 +0530

    Green fill for correct sequence else red|Added makefile.am files

 src/louis_braille-activity/Makefile.am             |    2 +-
 src/louis_braille-activity/louis_braille.py        |   27 +++++++---
 src/louis_braille-activity/louis_braille.xml.in    |    4 +-
 src/louis_braille-activity/resources/Makefile.am   |    1 +
 .../resources/louis_braille/Makefile.am            |   24 +++++++++
 .../resources/louis_braille/activity.desktop       |   46 ++++++++--------
 .../resources/louis_braille/activity.desktop.in    |   54 ++++++++++++++++++++
 7 files changed, 125 insertions(+), 33 deletions(-)
---
diff --git a/src/louis_braille-activity/Makefile.am b/src/louis_braille-activity/Makefile.am
index 8ca01a3..ed72448 100644
--- a/src/louis_braille-activity/Makefile.am
+++ b/src/louis_braille-activity/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS =
+SUBDIRS = resources
 
 pythondir = $(PYTHON_PLUGIN_DIR)
 
diff --git a/src/louis_braille-activity/louis_braille.py b/src/louis_braille-activity/louis_braille.py
index e4f6b39..a7ddef1 100644
--- a/src/louis_braille-activity/louis_braille.py
+++ b/src/louis_braille-activity/louis_braille.py
@@ -66,6 +66,7 @@ class Gcompris_louis_braille:
     self.counter = 0
     self.gamewon = 0
     self.item = 0
+
     self.groupitem_array = []
     self.coorditem_array = []
 
@@ -108,7 +109,7 @@ class Gcompris_louis_braille:
 
           # Insert the lines in the correct order
           for index in range(n_lines):
-              self.reordering.add_line( str(self.dataset.get(str(index + 1), "_story") ) )
+              self.reordering.add_line( str(self.dataset.get(str(index + 1), _("story"))))
 
           ok = goocanvas.Svg(parent = self.rootitem,
                          svg_handle = gcompris.skin.svg_get(),
@@ -164,7 +165,7 @@ class Gcompris_louis_braille:
                              20, 50, LOUIS_BRAILLE_NAME[index] ,COLOR_ON, COLOR_OFF,
                              CIRCLE_FILL, CIRCLE_FILL,True,False ,False, None)
 
-          story = self.dataset.get(str(level),"_story")
+          story = self.dataset.get(str(level),_("story"))
 
           #Rectangle for YEAR
           goocanvas.Rect(parent=self.rootitem,
@@ -180,7 +181,7 @@ class Gcompris_louis_braille:
           goocanvas.Text(parent = self.rootitem,
                    x=420.0,
                    y=395.0,
-                   text=str(self.dataset.get(str(level),"_year")),
+                   text=str(self.dataset.get(str(level) , "year")),
                    fill_color="black",
                    anchor = gtk.ANCHOR_CENTER,
                    alignment = pango.ALIGN_CENTER,
@@ -222,7 +223,7 @@ class Gcompris_louis_braille:
           gcompris.bonus.display(gcompris.bonus.WIN,gcompris.bonus.TUX)
           self.gamewon = 1
       else :
-          gcompris.bonus.display(gcompris.bonus.LOOSE,gcompris.bonus.TUX)
+          self.reordering.is_not_done()
 
   def previous_event(self, event, target,item, level):
       if (self.gcomprisBoard.level == 1):
@@ -276,6 +277,7 @@ class Reordering:
   def __init__(self, louisbraille, max_item):
     self.louisbraille = louisbraille
     self.rootitem = louisbraille.rootitem
+    self.rectbox_array = []
     self.index = 0
     self.randoms = range(max_item)
     random.shuffle(self.randoms)
@@ -294,6 +296,15 @@ class Reordering:
          return False
      return True
 
+  #To indicate correct and wrong lines
+  def is_not_done(self):
+      for index , item in enumerate (self.orders):
+          group_index = item.get_data("index")
+          if ( group_index != index ):
+              self.rectbox_array[index].set_property("fill_color","#F95234")
+          else :
+              self.rectbox_array[index].set_property("fill_color","#5DF934")
+
   def add_line(self, text):
     position = self.randoms[ self.index ]
     y = (position + 0.5) * 43
@@ -302,7 +313,7 @@ class Reordering:
     # Save in the item itself where is its correct position
     group_item.set_data("index", self.index)
     # Create Rounded Rectangles for each story
-    goocanvas.Rect(parent = group_item,
+    rect_box = goocanvas.Rect(parent = group_item,
                    x = 100,
                    y = 0,
                    width = 550,
@@ -312,6 +323,8 @@ class Reordering:
                    stroke_color = "orange",
                    fill_color = "white",
                    line_width = 2.0)
+
+    self.rectbox_array.append(rect_box)
     self.orders[ position ] = group_item
 
     # Displaying the STORY
@@ -325,6 +338,7 @@ class Reordering:
                    font = 'SANS 9',
                    width = 500,
                    )
+
     # It is hard to manage focus when we move the item
     # gcompris.utils.item_focus_init(self.dragText, self.dragRect)
     group_item.connect("button_press_event", self.component_drag)
@@ -360,7 +374,6 @@ class Reordering:
         self.move_group( index, self.get_group_index(group) )
         return
 
-
   def component_drag(self, widget, target, event):
       groupitem = target.get_parent()
       groupitem.raise_(None)
@@ -388,4 +401,4 @@ class Reordering:
         to_y = groupitem.get_data('yref')
         groupitem.set_properties(x = to_x, y = to_y)
 
-      return True
+      return True
\ No newline at end of file
diff --git a/src/louis_braille-activity/louis_braille.xml.in b/src/louis_braille-activity/louis_braille.xml.in
index ceeca1a..2bc8831 100644
--- a/src/louis_braille-activity/louis_braille.xml.in
+++ b/src/louis_braille-activity/louis_braille.xml.in
@@ -6,13 +6,13 @@
         section="/experimental"
         icon="louis_braille.svg"
         difficulty="1"
-        author="your name here"
+        author="Srishti Sethi (srishakatux gmail com)"
         boarddir=""
         demo="1">
         <title>Louis Braille</title>
         <description>The Story Of Louis Braille</description>
         <prerequisite></prerequisite>
-        <goal>Read the story of Louis Braille ,his biography and discovery of braille code.Click on the previous and next buttons to move to the respective story page.At the end of story, arrange the sequence.In the entry box in front of each story type the alphabet to indicate its sequence and press enter.</goal>
+        <goal>Read the story of Louis Braille, his biography and discovery of braille code. Click on the previous and next buttons to move to the respective story page. At the end of story, arrange the sequence of story by draging the round boxes.Click on OK button to confirm the sequence.Each correctly arranged line will me marked with green color otherwise with red color.</goal>
         <manual></manual>
         <credit>Louis Braille Video :http://bit.ly/qedAtc</credit>
   </Board>
diff --git a/src/louis_braille-activity/resources/Makefile.am b/src/louis_braille-activity/resources/Makefile.am
new file mode 100644
index 0000000..0c57d18
--- /dev/null
+++ b/src/louis_braille-activity/resources/Makefile.am
@@ -0,0 +1 @@
+SUBDIRS = louis_braille
\ No newline at end of file
diff --git a/src/louis_braille-activity/resources/louis_braille/Makefile.am b/src/louis_braille-activity/resources/louis_braille/Makefile.am
new file mode 100644
index 0000000..774467b
--- /dev/null
+++ b/src/louis_braille-activity/resources/louis_braille/Makefile.am
@@ -0,0 +1,24 @@
+imgdir = $(pkgdatadir)/@PACKAGE_DATA_DIR@/louis_braille
+img_DATA = \
+	activity.desktop \
+	background.svgz \
+	braile.jpg \
+	braille_ball.jpg \
+	chart.png \
+	fireplace.jpg \
+	louis.png \
+	night_printing.jpg \
+	piano.svg \
+	rnib.jpg \
+	statue.jpg \
+	teach.jpg \
+	workshop.jpg
+
+# Do not use the INTLTOOL_DESKTOP_RULE, we don't need to embed the translations
+# in the file themselves. GCompris pick the translations from the po file at
+# runtime.
+activity.desktop: activity.desktop.in
+	sed -e "s/^_//g" $< > $@
+
+EXTRA_DIST = $(img_DATA) activity.desktop.in
+CLEANFILES = activity.desktop
diff --git a/src/louis_braille-activity/resources/louis_braille/activity.desktop b/src/louis_braille-activity/resources/louis_braille/activity.desktop
index dd2c6b2..0a6c596 100755
--- a/src/louis_braille-activity/resources/louis_braille/activity.desktop
+++ b/src/louis_braille-activity/resources/louis_braille/activity.desktop
@@ -1,54 +1,54 @@
 [1]
-_year = 1809
-_story = Born January 4th at Coupvary near Paris in France.
+year = 1809
+story = Born January 4th at Coupvary near Paris in France.
 image = louis_braille/louis.png
 
 [2]
-_year = 1812
-_story = Louis Braille injured his left eye with a stitching awl from his fathers workshop.
+year = 1812
+story = Louis Braille injured his left eye with a stitching awl from his fathers workshop.
 image = louis_braille/workshop.jpg
 
 [3]
-_year = 1812
-_story = At the age of three Louis became blind due to sympathetic ophthalmia.
+year = 1812
+story = At the age of three Louis became blind due to sympathetic ophthalmia.
 image = louis_braille/fireplace.jpg
 
 [4]
-_year = 1819
-_story = At the age of 10 he was sent to Paris to study at the Royal Institute for Blind Youth.
+year = 1819
+story = At the age of 10 he was sent to Paris to study at the Royal Institute for Blind Youth.
 image = louis_braille/rnib.jpg
 
 [5]
-_year = 1820
-_story = He began to impress his classmates and began to play piano and the organ.
+year = 1820
+story = He began to impress his classmates and began to play piano and the organ.
 image = louis_braille/piano.svg
 
 [6]
-_year = 1821
-_story = Charles Barbier, a french soldier visited school and shared invention of night writing ,a code of 12 raised dots to share information on battlefield.
+year = 1821
+story = Charles Barbier, a french soldier visited school and shared invention of night writing ,a code of 12 raised dots to share information on battlefield.
 image = louis_braille/night_printing.jpg
 
 [7]
-_year = 1824
-_story = Louis trimmed Barbier's 12 dots into 6 and invented Braille.
+year = 1824
+story = Louis trimmed Barbier's 12 dots into 6 and invented Braille.
 image = louis_braille/braile.jpg
 
 [8]
-_year = 1828
-_story = He became a professor after graduating and secretly taught his method.
+year = 1828
+story = He became a professor after graduating and secretly taught his method.
 image = louis_braille/teach.jpg
 
 [9]
-_year = 1837
-_story = He revised and extended braille to include mathematics, symbols, punctuations and music notations.
+year = 1837
+story = He revised and extended braille to include mathematics, symbols, punctuations and music notations.
 image = louis_braille/chart.png
 
 [10]
-_year = 1852
-_story = He died of tuberculosis.He is burried in the Pantheon in Paris.A monument is erected to honor him.
+year = 1852
+story = He died of tuberculosis.He is burried in the Pantheon in Paris.A monument is erected to honor him.
 image = louis_braille/statue.jpg
 
 [11]
-_year = After his Death
-_story = Braille got accepted as a world wide standard.Louis proved if you have motivation you can do incredible things.
-image = louis_braille/braille_ball.jpg
\ No newline at end of file
+year = After his Death
+story = Braille got accepted as a world wide standard.Louis proved if you have motivation you can do incredible things.
+image = louis_braille/braille_ball.jpg
diff --git a/src/louis_braille-activity/resources/louis_braille/activity.desktop.in b/src/louis_braille-activity/resources/louis_braille/activity.desktop.in
new file mode 100644
index 0000000..ef49f56
--- /dev/null
+++ b/src/louis_braille-activity/resources/louis_braille/activity.desktop.in
@@ -0,0 +1,54 @@
+[1]
+year = 1809
+story = Born January 4th at Coupvary near Paris in France.
+image = louis_braille/louis.png
+
+[2]
+year = 1812
+story = Louis Braille injured his left eye with a stitching awl from his fathers workshop.
+image = louis_braille/workshop.jpg
+
+[3]
+year = 1812
+story = At the age of three Louis became blind due to sympathetic ophthalmia.
+image = louis_braille/fireplace.jpg
+
+[4]
+year = 1819
+story = At the age of 10 he was sent to Paris to study at the Royal Institute for Blind Youth.
+image = louis_braille/rnib.jpg
+
+[5]
+year = 1820
+story = He began to impress his classmates and began to play piano and the organ.
+image = louis_braille/piano.svg
+
+[6]
+year = 1821
+story = Charles Barbier, a french soldier visited school and shared invention of night writing ,a code of 12 raised dots to share information on battlefield.
+image = louis_braille/night_printing.jpg
+
+[7]
+year = 1824
+story = Louis trimmed Barbier's 12 dots into 6 and invented Braille.
+image = louis_braille/braile.jpg
+
+[8]
+year = 1828
+story = He became a professor after graduating and secretly taught his method.
+image = louis_braille/teach.jpg
+
+[9]
+year = 1837
+story = He revised and extended braille to include mathematics, symbols, punctuations and music notations.
+image = louis_braille/chart.png
+
+[10]
+year = 1852
+story = He died of tuberculosis.He is burried in the Pantheon in Paris.A monument is erected to honor him.
+image = louis_braille/statue.jpg
+
+[11]
+year = After his Death
+story = Braille got accepted as a world wide standard.Louis proved if you have motivation you can do incredible things.
+image = louis_braille/braille_ball.jpg
\ No newline at end of file



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]