[Tux4kids-commits] r392 - in tuxmath/trunk: doc src

tholy-guest at alioth.debian.org tholy-guest at alioth.debian.org
Mon Dec 24 14:19:24 UTC 2007


Author: tholy-guest
Date: 2007-12-24 14:19:23 +0000 (Mon, 24 Dec 2007)
New Revision: 392

Modified:
   tuxmath/trunk/doc/README.txt
   tuxmath/trunk/doc/changelog
   tuxmath/trunk/src/game.c
Log:
Add documentation on tuxmathadmin, and set things so that the help
text will hopefully be translated.


Modified: tuxmath/trunk/doc/README.txt
===================================================================
--- tuxmath/trunk/doc/README.txt	2007-12-24 12:55:31 UTC (rev 391)
+++ tuxmath/trunk/doc/README.txt	2007-12-24 14:19:23 UTC (rev 392)
@@ -371,13 +371,136 @@
   game summary files will be stored in a location specific to each
   user.
 
-  Setting this up is fairly simple:
+  Setting this up is fairly simple.  There are two ways to do it:
+  manually and using a separate program "tuxmathadmin".  The first
+  step is the same either way:
 
      1. Decide where you want this information stored.  You might want
         to put it on a central server.  In the appropriate place
         (let's say it's "/servervolume/"), create a directory which
         we'll call "tuxmath_users" for current purposes.
 
+  If you are using tuxmathadmin, here are the remaining steps:
+
+     2. Using a spreadsheet program, create a spreadsheet that
+        reflects the way you want to organize the login system.  The
+        following example should illustrate the syntax (try viewing
+        this with a fixed-width font if the spacing is unclear):
+
+        Col 1                  Col 2                           Col 3
+        1st Grade
+                               Mr. Jones
+                                                               KidA
+                                                               KidB
+                                                               KidC
+                               Mrs. Smith
+                                                               Kid1
+                                                               Kid2
+        2nd Grade
+                               Mrs. Wilson
+                                                               Kid a
+                                                               Kid b
+                                                               Kid c
+                                                               Kid d
+
+        This indicates that three kids (named "KidA", "KidB", and
+        "KidC") are in Mr.  Jones' 1st grade class; two kids ("Kid1"
+        and "Kid2") are in Mrs. Smith's 1st grade class, and there are
+        4 in Mrs. Wilson's 2nd grade class.
+
+	Note that it's flexible: you don't have to divide things by
+	grade, teacher, and kid; you could just do teacher & kid, or
+	just kids, or you could do something even more complicated
+	("East Campus", "1st grade", etc.). If you were just wanting
+	to set things up for home use with a single login you could
+	just list the names of your kids and that would be it.
+
+	Save the spreadsheet as a comma-separated-value file (.csv
+        file).  In case you have to prepare it manually (say, with a
+        text editor) the resulting CSV file would look like this:
+
+	"1st Grade",,
+	,"Mr. Jones",
+	,,"KidA"
+	,,"KidB"
+	,,"KidC"
+	,"Mrs. Smith",
+	,,"Kid1"
+	,,"Kid2"
+	"2nd Grade",,
+	,"Mrs. Wilson",
+	,,"Kid a"
+	,,"Kid b"
+	,,"Kid c"
+	,,"Kid d"
+
+     3. Create the directory hierarchy with the following command
+        (executed from the command line, aka shell):
+
+          tuxmathadmin --path /servervolume/tuxmath_users --createhomedirs userfile.csv
+
+	where "userfile.csv" is the name of the file that you created
+	in the previous step.  It should tell you that it's creating
+	all the user directories and complete without error.  Note
+	that "tuxmathadmin -h" gives help, including a list of the
+	things that tuxmathadmin can do.
+
+     4. Optionally, in "tuxmath_users" you can also create a file that
+        poses a question at each step of the hierarchy.  For the
+        example above, it might contain three lines:
+
+	Choose your grade:
+	Choose your teacher:
+	Who are you?
+
+	You need to save this as a raw text file with the name
+	"user_login_questions" ("user_login_questions.txt" on Windows)
+	in the top level of the user hierarchy directory
+	(/servervolume/tuxmath_users).  If you omit this file, then
+	students will simply be presented with the list without any
+	kind of prompt.
+
+     5. Decide on how you want users to compete for high scores.  For
+        the example above, suppose you want each student to compete
+        against the other kids in their same class.  You would
+        configure this with the following command:
+
+          tuxmathadmin --confighighscores --level 3
+
+	"tuxmathadmin -h" gives detail about the meaning of the
+	choices of different levels.
+
+     6. Finally, set it up so that tuxmath automatically finds the
+        user directory tree.  Find the global configuration file
+        (e.g., under Linux it would usually be
+        /usr/local/share/tuxmath/missions/options; on Mac OSX it is a
+        file called "options" in the .dmg bundle).  Set the "homedir"
+        property (at the very end of the file) to point to your home
+        directory tree.
+
+	Alternatively, you can employ the command line option
+        "--homedir /severvolume/tuxmath_users" (along with any other
+        options) upon launching tuxmath.  Note that an individual
+        classroom could make use of this school-wide service by
+        specifying (in the option-file syntax) homedir =
+        /servervolume/tuxmath_users/2nd\ grade/Mrs.\ Johnson so that
+        students in a particular classroom only have to choose among
+        their own class.
+
+     7. Optionally, at least under Linux (and probably other OSes) you
+        can also configure certain tasks to run automatically using
+        "cron."  For example, if you want to clear all the students'
+        gold stars on a daily basis, you can put a script that
+        executes
+
+           tuxmathadmin --cleargoldstars
+
+	in the /etc/cron.daily directory. 
+
+
+
+   If you instead choose to configure TuxMath manually, these are the steps:
+
      2. In tuxmath_users, create a text file called
         "user_menu_entries."  This file contains the list of choices
         that students will be presented with upon login, one entry per
@@ -397,15 +520,16 @@
         file matches the directory structure (although having extra
         directories will not cause a problem).
 
+	You have to make sure that all the write permissions are set
+	correctly for the students to be able to write to these
+	directories.
+
      5. At the finest level, create a menu item and one subdirectory
         for each student.
 
-     6. Optionally, in "tuxmath_users" you can also create a file
-        called "user_login_questions" that poses a question at each
-        step of the hierarchy.  For example, it might contain three
-        lines, "Choose your grade:", "Choose your teacher:", "Who are
-        you?" If you omit this file, then students will simply be
-        presented with the list without any kind of prompt.
+     6. Optionally, perform the tasks described above in step 4 of the
+        "tuxmathadmin" configuration (creation of the
+        user_login_questions file).
 
      7. Optionally, you can create an empty file called "highscores"
         ("highscores.txt" on Windows) at whatever level of the
@@ -417,20 +541,10 @@
         a private high score table.  (In case of multiple highscores
         files, the one at the lowest level of the hierarchy wins.)
 
-     8. Finally, adjust the global configuration file's "homedir"
-        property (at the very end of the file) to point to your
-	home directory tree.  Alternatively, you can employ the
-        command line option "--homedir /severvolume/tuxmath_users"
-        (along with any other options) upon launching tuxmath.  Note
-        that an individual classroom could make use of this
-        school-wide service by specifying (in the option-file syntax)
-	   homedir = /servervolume/tuxmath_users/2nd\ grade/Mrs.\ Johnson
-        so that students in a particular classroom only have to choose
-	among their own class.
+     8. Perform the tasks described above in step 6 of the
+        "tuxmathadmin" configuration (setting of the homedir property
+        in the global configuration file).
 
-  You have to make sure that all the write permissions are set
-  correctly.
-
   Note there is no security insuring that students select themselves.
 
 

Modified: tuxmath/trunk/doc/changelog
===================================================================
--- tuxmath/trunk/doc/changelog	2007-12-24 12:55:31 UTC (rev 391)
+++ tuxmath/trunk/doc/changelog	2007-12-24 14:19:23 UTC (rev 392)
@@ -1,3 +1,16 @@
+2007.Dec.24 (svn.debian.org/tux4kids - revision 382-392)
+    Code:
+      * Fix bugs that came with the new login system, including: fix
+	re-reading of highscores table, and several Valgrind-detected
+	memory leaks in the string processing associate with the login
+	system.
+      * Add the gettext macro in front of the help strings so they can
+	be internationalized (does it work?)
+    Documentation:
+      * Add documentation on tuxmathadmin in the README.txt file.
+	
+	Tim Holy <holy at wustl.edu>
+	
 2007.Dec.07 (svn.debian.org/tux4kids - revision 359)
 Version 1.5.9
       David Bruce <dbruce at tampabay.rr.com>

Modified: tuxmath/trunk/src/game.c
===================================================================
--- tuxmath/trunk/src/game.c	2007-12-24 12:55:31 UTC (rev 391)
+++ tuxmath/trunk/src/game.c	2007-12-24 14:19:23 UTC (rev 392)
@@ -658,7 +658,7 @@
   frame = 0;
 
   // Write the introductory text
-  game_set_message(&s1,"Welcome to TuxMath!",-1,50);
+  game_set_message(&s1,_("Welcome to TuxMath!"),-1,50);
 
 #ifndef NOSOUND
   if (Opts_UsingSound())
@@ -675,9 +675,9 @@
   if (quit_help)
     return;
 
-  game_set_message(&s2,"Your mission is to save your", left_edge, 100);
-  game_set_message(&s3,"penguins' igloos from the", left_edge, 135);
-  game_set_message(&s4,"falling comets.", left_edge, 170);
+  game_set_message(&s2,_("Your mission is to save your"), left_edge, 100);
+  game_set_message(&s3,_("penguins' igloos from the"), left_edge, 135);
+  game_set_message(&s4,_("falling comets."), left_edge, 170);
 
   frame_start = frame;
   while (frame-frame_start < 5*FPS && !(quit_help = help_renderframe_exit()));  // wait 5 more secs
@@ -696,10 +696,10 @@
     return;
 
   if (comets[0].alive == 1) {
-    game_set_message(&s1,"Stop a comet by typing",left_edge,100);
-    game_set_message(&s2,"the answer to the math problem",left_edge,135);
-    game_set_message(&s3,"and hitting 'space' or 'enter'.",left_edge,170);
-    game_set_message(&s4,"Try it now!",left_edge,225);
+    game_set_message(&s1,_("Stop a comet by typing"),left_edge,100);
+    game_set_message(&s2,_("the answer to the math problem"),left_edge,135);
+    game_set_message(&s3,_("and hitting 'space' or 'enter'."),left_edge,170);
+    game_set_message(&s4,_("Try it now!"),left_edge,225);
 
     speed = 0;
     while (comets[0].alive && !(quit_help = help_renderframe_exit()));
@@ -707,7 +707,7 @@
       return;
   }
 
-  game_set_message(&s1,"Good shot!",left_edge,100);
+  game_set_message(&s1,_("Good shot!"),left_edge,100);
   game_clear_message(&s2);
   game_clear_message(&s3);
   game_clear_message(&s4);
@@ -717,11 +717,11 @@
   while (frame-frame_start < 3*FPS && !(quit_help = help_renderframe_exit()));  // wait 3 secs
   
   speed = 2;
-  game_set_message(&s1,"If an igloo gets hit by a comet,",left_edge,100);
-  game_set_message(&s2,"it melts. But don't worry, the",left_edge,135);
-  game_set_message(&s3,"penguin is OK!",left_edge,170);
-  game_set_message(&s4,"Just watch what happens:",left_edge,225);
-  game_set_message(&s5,"(Press a key to start)",left_edge,260);
+  game_set_message(&s1,_("If an igloo gets hit by a comet,"),left_edge,100);
+  game_set_message(&s2,_("it melts. But don't worry, the"),left_edge,135);
+  game_set_message(&s3,_("penguin is OK!"),left_edge,170);
+  game_set_message(&s4,_("Just watch what happens:"),left_edge,225);
+  game_set_message(&s5,_("(Press a key to start)"),left_edge,260);
 
   key_pressed = 0;
   while (!key_pressed && !(quit_help = help_renderframe_exit()));
@@ -734,7 +734,7 @@
   while (!(comets[0].expl) && !(quit_help = help_renderframe_exit()));  // wait 3 secs
   if (quit_help)
     return;
-  game_set_message(&s4,"Notice the answer",left_edge,comets[0].y-100);
+  game_set_message(&s4,_("Notice the answer"),left_edge,comets[0].y-100);
   help_renderframe_exit();
   SDL_Delay(4000);
   game_clear_message(&s4);
@@ -744,9 +744,9 @@
   if (quit_help)
     return;
 
-  game_set_message(&s1,"If it gets hit again, the",left_edge,100);
-  game_set_message(&s2,"penguin leaves.",left_edge,135);
-  game_set_message(&s3, "(Press a key when ready)",left_edge,200);
+  game_set_message(&s1,_("If it gets hit again, the"),left_edge,100);
+  game_set_message(&s2,_("penguin leaves."),left_edge,135);
+  game_set_message(&s3,_("(Press a key when ready)"),left_edge,200);
 
   key_pressed = 0;
   while (!key_pressed && !(quit_help = help_renderframe_exit()));
@@ -765,8 +765,8 @@
     return;
   
   help_controls.laser_enabled = 1;
-  game_set_message(&s1,"You can fix the igloos",left_edge,100);
-  game_set_message(&s2,"by stopping bonus comets.",left_edge,135);
+  game_set_message(&s1,_("You can fix the igloos"),left_edge,100);
+  game_set_message(&s2,_("by stopping bonus comets."),left_edge,135);
   help_add_comet(2,MC_OPER_ADD,2,4);
   comets[0].bonus = 1;
   frame_start = frame;
@@ -775,11 +775,11 @@
     return;
   if (comets[0].alive)
     speed = 0;
-  game_set_message(&s3,"Zap it now!",left_edge,225);
+  game_set_message(&s3,_("Zap it now!"),left_edge,225);
   while (comets[0].alive && !(quit_help = help_renderframe_exit()));
   if (quit_help)
     return;
-  game_set_message(&s1,"Great job!",left_edge,100);
+  game_set_message(&s1,_("Great job!"),left_edge,100);
   game_clear_message(&s2);
   game_clear_message(&s3);
   frame_start = frame;
@@ -793,10 +793,10 @@
     return;
 
 
-  game_set_message(&s1,"Quit at any time by pressing",left_edge,100);
-  game_set_message(&s2,"'Esc' or clicking the 'X'",left_edge,135);
-  game_set_message(&s3,"in the upper right corner.",left_edge,170);
-  game_set_message(&s4,"Do it now, and then play!",left_edge,225);
+  game_set_message(&s1,_("Quit at any time by pressing"),left_edge,100);
+  game_set_message(&s2,_("'Esc' or clicking the 'X'"),left_edge,135);
+  game_set_message(&s3,_("in the upper right corner."),left_edge,170);
+  game_set_message(&s4,_("Do it now, and then play!"),left_edge,225);
 
   help_controls.x_is_blinking = 1;
   while (!help_renderframe_exit());




More information about the Tux4kids-commits mailing list