[Commits] typing-turtle branch master updated.

Wade Brainerd wadetb at gmail.com
Sun Jan 25 20:38:32 EST 2009


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "/home/olpc-code/git/activities/typing-turtle".

The branch, master has been updated
       via  53f526ff1cde03e605d5b8666ae801f9dbab8fc6 (commit)
      from  fb0c2407556aa277601f3ba56714f7248b81998d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

 balloongame.py                      |   11 +++++++----
 lessonbuilder                       |   35 +++++++++++++++++++++++++++++------
 lessons/en_US/MAKELESSONS           |   35 ++++++++++++++++-------------------
 lessons/en_US/MAKETESTLESSONS       |    4 ++--
 lessons/en_US/bottomrow.lesson      |   19 ++++++++++++++++++-
 lessons/en_US/homerow.lesson        |   19 ++++++++++++++++++-
 lessons/en_US/homerowballoon.lesson |   19 +++++++++++++++++--
 lessons/en_US/intro.lesson          |   19 ++++++++++++++++++-
 lessons/en_US/leftcapital.lesson    |   17 +++++++++++++++++
 lessons/en_US/rightcapital.lesson   |   17 +++++++++++++++++
 lessons/en_US/toprow.lesson         |   19 ++++++++++++++++++-
 lessonscreen.py                     |    2 ++
 medalscreen.py                      |    5 +++--
 13 files changed, 182 insertions(+), 39 deletions(-)

- Log -----------------------------------------------------------------
commit 53f526ff1cde03e605d5b8666ae801f9dbab8fc6
Author: Wade Brainerd <wadetb at gmail.com>
Date:   Mon Jan 26 01:38:16 2009 +0000

    Balloon game, lesson builder improvements.

diff --git a/balloongame.py b/balloongame.py
index 65ea6f8..3e09706 100644
--- a/balloongame.py
+++ b/balloongame.py
@@ -23,8 +23,8 @@ import gobject, pygtk, gtk, pango
 # parameters about them.
 BALLOON_STAGES = [
     { 'count': 10, 'delay': 80 },
-    { 'count': 20, 'delay': 60 },
-    { 'count': 70, 'delay': 40 },
+    #{ 'count': 20, 'delay': 60 },
+    #{ 'count': 70, 'delay': 40 },
 ]
 
 class Balloon:
@@ -205,8 +205,11 @@ class BalloonGame(gtk.VBox):
         self.area.window.draw_rectangle(gc, False, x, y, w, h)
 
         # Draw text
-        report = _('You finished!\n\nYour score was %(score)d.') % \
-            { 'score': self.score }
+        report = _('You finished!')
+        report += '\n\n'
+        report += _('Your score was %(score)d.') % { 'score': self.score }
+        report += '\n\n'
+        report += _('Press the ENTER key to continue.')
     
         gc.foreground = self.area.get_colormap().alloc_color(0,0,0)
         layout = self.area.create_pango_layout(report)
diff --git a/lessonbuilder b/lessonbuilder
index 83cc40b..95c3dd2 100755
--- a/lessonbuilder
+++ b/lessonbuilder
@@ -445,19 +445,36 @@ if __name__ == "__main__":
 
     type_group = optparse.OptionGroup(parser, 
         'Lesson Types', 
-        'Specify one of these to control the kind of lesson created.')
-    type_group.add_option("--make-intro-lesson", dest="make_intro_lesson", action="store_true",
+        'You must pass a lesson type to control the kind of lesson created.')
+    type_group.add_option("--intro-lesson", dest="make_intro_lesson", action="store_true",
                       help="Generate the introductory lesson.")
-    type_group.add_option("--make-key-lesson", dest="make_key_lesson", action="store_true",
+    type_group.add_option("--key-lesson", dest="make_key_lesson", action="store_true",
                       help="Generate a lesson to teach a specific set of keys.")
-    type_group.add_option("--make-game-lesson", dest="make_game_lesson", action="store_true",
+    type_group.add_option("--game-lesson", dest="make_game_lesson", action="store_true",
                       help="Generate a lesson which plays a game.")
-    #type_group.add_option("--make-capital-lesson", dest="make_capital_lesson", action="store_true",
+    #type_group.add_option("--capital-lesson", dest="make_capital_lesson", action="store_true",
     #                  help="Generate a lesson which teaches CAPITAL letters (might not be appropriate for some languages).")
-    #type_group.add_option("--make-punctuation-lesson", dest="make_punctuation_lesson", action="store_true",
+    #type_group.add_option("--punctuation-lesson", dest="make_punctuation_lesson", action="store_true",
     #                  help="Generate a lesson which teaches punctuation (might not be appropriate for some languages).")
     parser.add_option_group(type_group)
 
+    medal_group = optparse.OptionGroup(parser, 
+        'Medal Requirements', 
+        'Optionally pass these arguments to override medal requirements.')
+    medal_group.add_option("--bronze-wpm", dest="bronze_wpm", type="int", metavar="N", default=60,
+                      help="Words per minute for a Bronze medal.  Default 15.")
+    medal_group.add_option("--silver-wpm", dest="silver_wpm", type="int", metavar="N", default=60,
+                      help="Words per minute for a Silver medal.  Default 20.")
+    medal_group.add_option("--gold-wpm", dest="gold_wpm", type="int", metavar="N", default=60,
+                      help="Words per minute for a Gold medal.  Default 25.")
+    medal_group.add_option("--bronze-acc", dest="bronze_accuracy", type="int", metavar="N", default=60,
+                      help="Accuracy for a Bronze medal.  Default 75.")
+    medal_group.add_option("--silver-acc", dest="silver_accuracy", type="int", metavar="N", default=60,
+                      help="Accuracy for a Silver medal.  Default 85.")
+    medal_group.add_option("--gold-acc", dest="gold_accuracy", type="int", metavar="N", default=60,
+                      help="Accuracy for a Gold medal.  Default 95.")
+    parser.add_option_group(medal_group)
+
     (options, args) = parser.parse_args()
 
     if not (options.make_intro_lesson or options.make_key_lesson or options.make_game_lesson):
@@ -487,6 +504,12 @@ if __name__ == "__main__":
     lesson['description'] = options.desc
     lesson['order'] = options.order
 
+    lesson['medals'] = [ 
+        { 'name': 'bronze', 'wpm': options.bronze_wpm, 'accuracy': options.bronze_accuracy },
+        { 'name': 'silver', 'wpm': options.silver_wpm, 'accuracy': options.silver_accuracy },
+        { 'name': 'gold',   'wpm': options.gold_wpm,   'accuracy': options.gold_accuracy },
+    ]
+
     if options.make_intro_lesson:
         lesson['name'] = _('Welcome') 
         lesson['type'] = 'normal' 
diff --git a/lessons/en_US/MAKELESSONS b/lessons/en_US/MAKELESSONS
index b5b8a23..b643c34 100755
--- a/lessons/en_US/MAKELESSONS
+++ b/lessons/en_US/MAKELESSONS
@@ -4,63 +4,60 @@
 #
 
 # Generate the introductory lesson.
-../../lessonbuilder --make-intro-lesson --order=0 --output=intro.lesson
+../../lessonbuilder --intro-lesson \
+    --bronze-wpm=0 --silver-wpm=0 --gold-wpm=0 \
+    --order=0 \
+    --output=intro.lesson
 
 # Generate the home, top and bottom row lessons.
-../../lessonbuilder --make-key-lesson \
+../../lessonbuilder --key-lesson \
     --title="The Home Row" \
     --desc="This lesson teaches you the a, s, d, f, g, h, j, k and l keys \nin the middle of the keyboard.\nThese keys are called the Home Row." \
     --keys="asdfghjkl" \
-    --wordlist=2of12.txt \
-    --badwordlist=badwords.txt \
+    --wordlist=2of12.txt --badwordlist=badwords.txt \
     --order=1 \
     --output=homerow.lesson
     
-../../lessonbuilder --make-game-lesson \
+../../lessonbuilder --game-lesson \
     --title="Home Row Balloon Practice" \
     --desc="Practice the home row keys in this exciting game!\nDon\'t let any balloons get by!" \
     --keys="asdfghjkl" \
     --game='balloon' \
-    --wordlist=2of12.txt \
-    --badwordlist=badwords.txt \
+    --wordlist=2of12.txt --badwordlist=badwords.txt \
     --order=2 \
     --output=homerowballoon.lesson
     
-../../lessonbuilder --make-key-lesson \
+../../lessonbuilder --key-lesson \
     --title="The Top Row" \
     --desc="This lesson teaches you the q, w, e, r, t, y, u, i, o and p keys \non the top row of the keyboard." \
     --keys="qwertyuiop" --base-keys="asdfghjkl" \
-    --wordlist=2of12.txt \
-    --badwordlist=badwords.txt \
+    --wordlist=2of12.txt --badwordlist=badwords.txt \
     --order=3 \
     --output=toprow.lesson
 
-../../lessonbuilder --make-key-lesson \
+../../lessonbuilder --key-lesson \
     --title="The Bottom Row" \
     --desc="This lesson teaches you the z, x, c, v, b, n and m keys \non the bottom row of the keyboard." \
     --keys="zxcvbnm" --base-keys="asdfghjklqwertyuiop" \
-    --wordlist=2of12.txt \
-    --badwordlist=badwords.txt \
+    --wordlist=2of12.txt --badwordlist=badwords.txt \
     --order=4 \
     --output=bottomrow.lesson
 
 # Generate left and right hand capital lessons.
-../../lessonbuilder --make-key-lesson \
+../../lessonbuilder --key-lesson \
     --title="Left Hand Capitals" \
     --desc="This lesson teaches you the CAPITAL letters which are typed by your left hand.\nThese are Q, W, E, R, T, A, S, D, F, G, Z, X, C, V and B." \
     --keys="QWERTASDFGZXCVB" \
     --base-keys="abcdefghijklmnopqrstuvwxyz" \
-    --wordlist=2of12.txt \
-    --badwordlist=badwords.txt \
+    --wordlist=2of12.txt --badwordlist=badwords.txt \
     --order=5 \
     --output=leftcapital.lesson
 
-../../lessonbuilder --make-key-lesson \
+../../lessonbuilder --key-lesson \
     --title="Right Hand Capitals" \
     --desc="This lesson teaches you the CAPITAL letters which are typed by your right hand.\nThese are Y, U, I, O, P, H, J, K, L, B, N, and M." \
     --keys="YUIOPHJKLBNM" \
     --base-keys="abcdefghijklmnopqrstuvwxyzQWERTASDFGZXCVB" \
-    --wordlist=2of12.txt \
-    --badwordlist=badwords.txt \
+    --wordlist=2of12.txt --badwordlist=badwords.txt \
     --order=6 \
     --output=rightcapital.lesson
diff --git a/lessons/en_US/MAKETESTLESSONS b/lessons/en_US/MAKETESTLESSONS
index 432617f..5ae8978 100755
--- a/lessons/en_US/MAKETESTLESSONS
+++ b/lessons/en_US/MAKETESTLESSONS
@@ -1,4 +1,4 @@
-../../lessonbuilder --make-game-lesson \
+../../lessonbuilder --game-lesson \
     --title="Balloon game test" \
     --desc="." \
     --keys="asdfghjkl" \
@@ -6,7 +6,7 @@
     --order=-2 \
     --output=balloon-test.lesson
 
-../../lessonbuilder --make-key-lesson \
+../../lessonbuilder --key-lesson \
     --title="Test lesson" \
     --desc="This lesson exists to test out obscure Typing Turtle features.\nPlease skip it by pressing the arrow button to the right." \
     --keys="æΩABbB" \
diff --git a/lessons/en_US/bottomrow.lesson b/lessons/en_US/bottomrow.lesson
index 2d512da..5432a61 100644
--- a/lessons/en_US/bottomrow.lesson
+++ b/lessons/en_US/bottomrow.lesson
@@ -1,5 +1,22 @@
 {
     "description": "This lesson teaches you the z, x, c, v, b, n and m keys \non the bottom row of the keyboard.", 
+    "medals": [
+        {
+            "accuracy": 60, 
+            "name": "bronze", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "silver", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "gold", 
+            "wpm": 60
+        }
+    ], 
     "name": "The Bottom Row", 
     "order": 4, 
     "steps": [
@@ -61,7 +78,7 @@
         {
             "instructions": "Wonderful! Time to type real words.", 
             "mode": "text", 
-            "text": "outclass waxy flannels mirror stubbly felicity cogently reinfect chef muteness mincing success fullback binding surcease picot soviet voluble suasion discern befogged cards meanness genii focus remiss clad libel beige capital embezzle popover inferno medullae grocery scanner flan concord sneering feverish view breakout banyan lawgiver audacity scarlet sunless relaxer earmuffs gizzard sitting pimply svelte scalper scruff fraction laminate then purveyor callous"
+            "text": "outclass waxy phoebe mirror donut felicity rampage reinfect cruelly complex mincing success jinxed binding anther fauvism soviet pardon suasion monist befogged overfill meanness genii focus wondrous clay libel beige capital embezzle popover inferno medullae grocery scanner caveat concord sneering feverish view breakout minnow lawgiver dribbler scarlet sunless harangue earmuffs gizzard sitting pimply bullfrog scalper ambition initial auburn then purveyor callous"
         }, 
         {
             "instructions": "$report", 
diff --git a/lessons/en_US/homerow.lesson b/lessons/en_US/homerow.lesson
index 69d273e..a0a93b7 100644
--- a/lessons/en_US/homerow.lesson
+++ b/lessons/en_US/homerow.lesson
@@ -1,5 +1,22 @@
 {
     "description": "This lesson teaches you the a, s, d, f, g, h, j, k and l keys \nin the middle of the keyboard.\nThese keys are called the Home Row.", 
+    "medals": [
+        {
+            "accuracy": 60, 
+            "name": "bronze", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "silver", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "gold", 
+            "wpm": 60
+        }
+    ], 
     "name": "The Home Row", 
     "order": 1, 
     "steps": [
@@ -66,7 +83,7 @@
         {
             "instructions": "Nice work. Time to type real words.", 
             "mode": "text", 
-            "text": "hag lag salad hall la fa half shh ad has alga gal sash aha ass half alga dad gaff has gall had gash sad gag salad ask as glass halal ha hajj sh shag glad shh ska dash sag shall gaga lass shh flak as sag ha flak gaga all ll sad da alga hajj ll sh shall shah salsa"
+            "text": "hag lag salad shad la fa hall shh ad has falls gag gaff flag ask hall falls dad ad has gall had lad lag gad salad halal da glass alfalfa ha slag hajj shag glass shh ska dash gal shall gaga lass shh sass as gal ha flak gaga glad alga lag flask falls hajj alga hajj shall shah salsa"
         }, 
         {
             "instructions": "$report", 
diff --git a/lessons/en_US/homerowballoon.lesson b/lessons/en_US/homerowballoon.lesson
index b3c47aa..982f3be 100644
--- a/lessons/en_US/homerowballoon.lesson
+++ b/lessons/en_US/homerowballoon.lesson
@@ -1,5 +1,22 @@
 {
     "description": "Practice the home row keys in this exciting game!\nDon\\'t let any balloons get by!", 
+    "medals": [
+        {
+            "accuracy": 60, 
+            "name": "bronze", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "silver", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "gold", 
+            "wpm": 60
+        }
+    ], 
     "name": "Home Row Balloon Practice", 
     "order": 2, 
     "type": "balloon", 
@@ -12,7 +29,6 @@
         "jag", 
         "hah", 
         "fa", 
-        "ass", 
         "ask", 
         "halal", 
         "alfalfa", 
@@ -41,7 +57,6 @@
         "ha", 
         "fall", 
         "la", 
-        "ll", 
         "alga", 
         "falls", 
         "hash", 
diff --git a/lessons/en_US/intro.lesson b/lessons/en_US/intro.lesson
index b911442..97d8d8d 100644
--- a/lessons/en_US/intro.lesson
+++ b/lessons/en_US/intro.lesson
@@ -1,10 +1,27 @@
 {
     "description": "Click here to begin your typing adventure.", 
+    "medals": [
+        {
+            "accuracy": 60, 
+            "name": "bronze", 
+            "wpm": 0
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "silver", 
+            "wpm": 0
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "gold", 
+            "wpm": 0
+        }
+    ], 
     "name": "Welcome", 
     "order": 0, 
     "steps": [
         {
-            "instructions": "Hihowareyah!  Ready to learn the secret of fast typing?\nAlways use the correct finger to press each key!\n\nNow, place your hands on the keyboard just like the picture below.\nWhen you're ready, press the SPACE bar with your thumb!", 
+            "instructions": "Hihowahyah!  Ready to learn the secret of fast typing?\nAlways use the correct finger to press each key!\n\nNow, place your hands on the keyboard just like the picture below.\nWhen you're ready, press the SPACE bar with your thumb!", 
             "mode": "key", 
             "text": " "
         }, 
diff --git a/lessons/en_US/leftcapital.lesson b/lessons/en_US/leftcapital.lesson
index a7c4726..e7fdcff 100644
--- a/lessons/en_US/leftcapital.lesson
+++ b/lessons/en_US/leftcapital.lesson
@@ -1,5 +1,22 @@
 {
     "description": "This lesson teaches you the CAPITAL letters which are typed by your left hand.\nThese are Q, W, E, R, T, A, S, D, F, G, Z, X, C, V and B.", 
+    "medals": [
+        {
+            "accuracy": 60, 
+            "name": "bronze", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "silver", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "gold", 
+            "wpm": 60
+        }
+    ], 
     "name": "Left Hand Capitals", 
     "order": 5, 
     "steps": [
diff --git a/lessons/en_US/rightcapital.lesson b/lessons/en_US/rightcapital.lesson
index 732f9a6..06045d1 100644
--- a/lessons/en_US/rightcapital.lesson
+++ b/lessons/en_US/rightcapital.lesson
@@ -1,5 +1,22 @@
 {
     "description": "This lesson teaches you the CAPITAL letters which are typed by your right hand.\nThese are Y, U, I, O, P, H, J, K, L, B, N, and M.", 
+    "medals": [
+        {
+            "accuracy": 60, 
+            "name": "bronze", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "silver", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "gold", 
+            "wpm": 60
+        }
+    ], 
     "name": "Right Hand Capitals", 
     "order": 6, 
     "steps": [
diff --git a/lessons/en_US/toprow.lesson b/lessons/en_US/toprow.lesson
index c8d11d3..ffc92b2 100644
--- a/lessons/en_US/toprow.lesson
+++ b/lessons/en_US/toprow.lesson
@@ -1,5 +1,22 @@
 {
     "description": "This lesson teaches you the q, w, e, r, t, y, u, i, o and p keys \non the top row of the keyboard.", 
+    "medals": [
+        {
+            "accuracy": 60, 
+            "name": "bronze", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "silver", 
+            "wpm": 60
+        }, 
+        {
+            "accuracy": 60, 
+            "name": "gold", 
+            "wpm": 60
+        }
+    ], 
     "name": "The Top Row", 
     "order": 3, 
     "steps": [
@@ -76,7 +93,7 @@
         {
             "instructions": "Wonderful! Time to type real words.", 
             "mode": "text", 
-            "text": "passport heater gist southpaw seraph dais prude ti ford stratify wheedler paisley sharpie satire kith flagpole sage defeater walrus halfway prepared lisp aerosol folktale tis ward estrous kiri pate liqueur depress sealer stalk powder litterer outsold flight hashish prideful treasury reforge hooker thud ratty skittish weal portage jollity togs you frigid teepee haggle lees disagree ferrous sorrily lewd disease prepare"
+            "text": "passport heater odiously southpaw kiddie dais prude ti ford whole wheedler paisley sharpie satire iodide flagpole skitter defeater foolish halfway prepared lisp aerosol folktale halfway ward estrous kiri pate liqueur depress sealer stalk equip litterer outsold flight hashish prideful treasury reforge thirties thud ratty sweetish weal portage jollity togs apathy theses teepee haggle whoreish disagree ferrous sorrily lewd disease weight"
         }, 
         {
             "instructions": "$report", 
diff --git a/lessonscreen.py b/lessonscreen.py
index 2fb9435..abf8ae9 100644
--- a/lessonscreen.py
+++ b/lessonscreen.py
@@ -466,6 +466,8 @@ class LessonScreen(gtk.VBox):
 
         lesson_name = self.lesson['name']
         
+        print self.total_time, self.wpm
+        
         # Add to the lesson history.
         report = { 
             'lesson': lesson_name,
diff --git a/medalscreen.py b/medalscreen.py
index cbb86ba..c73b078 100644
--- a/medalscreen.py
+++ b/medalscreen.py
@@ -53,11 +53,12 @@ class MedalScreen(gtk.EventBox):
         statbox.pack_start(accuracylabel, True)
         
         oklabel = gtk.Label()
-        oklabel.set_markup("<span size='10000'>" + _('Ok') + '</span>')
+        oklabel.set_markup("<span size='10000'>" + _('Press the ENTER key to continue.') + '</span>')
         okbtn = gtk.Button()
         okbtn.add(oklabel)
         okbtn.connect('clicked', self.ok_cb)
-        
+        okbtn.grab_focus()
+
         btnbox = gtk.HBox()
         btnbox.pack_start(okbtn, True, True, 100)
         
-----------------------------------------------------------------------


--
/home/olpc-code/git/activities/typing-turtle


More information about the Commits mailing list