[Tux4kids-commits] r814 - in tuxmath/trunk: data/missions/arcade data/missions/campaign/ace data/missions/campaign/cadet data/missions/campaign/commando data/missions/campaign/ranger data/missions/campaign/scout data/missions/lessons data/missions/multiplay doc src

dbruce-guest at alioth.debian.org dbruce-guest at alioth.debian.org
Thu Dec 18 01:56:18 UTC 2008


Author: dbruce-guest
Date: 2008-12-18 01:56:18 +0000 (Thu, 18 Dec 2008)
New Revision: 814

Modified:
   tuxmath/trunk/data/missions/arcade/ace
   tuxmath/trunk/data/missions/arcade/commando
   tuxmath/trunk/data/missions/arcade/ranger
   tuxmath/trunk/data/missions/arcade/scout
   tuxmath/trunk/data/missions/arcade/space_cadet
   tuxmath/trunk/data/missions/campaign/ace/ace
   tuxmath/trunk/data/missions/campaign/cadet/cadet
   tuxmath/trunk/data/missions/campaign/commando/commando
   tuxmath/trunk/data/missions/campaign/ranger/ranger
   tuxmath/trunk/data/missions/campaign/scout/scout
   tuxmath/trunk/data/missions/lessons/Makefile.am
   tuxmath/trunk/data/missions/lessons/descr_lessons
   tuxmath/trunk/data/missions/multiplay/ace
   tuxmath/trunk/data/missions/multiplay/commando
   tuxmath/trunk/data/missions/multiplay/ranger
   tuxmath/trunk/data/missions/multiplay/scout
   tuxmath/trunk/data/missions/multiplay/space_cadet
   tuxmath/trunk/doc/changelog
   tuxmath/trunk/src/mathcards.c
Log:
1. small fixes for remaining lesson files.
2. bugfix for COMPREHENSIVE method setting card.difficulty values to 0 for all questions



Modified: tuxmath/trunk/data/missions/arcade/ace
===================================================================
--- tuxmath/trunk/data/missions/arcade/ace	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/arcade/ace	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,8 +8,6 @@
 multiplication_allowed = 1
 division_allowed = 1
 allow_negatives = 1
-max_formula_nums = 2
-min_formula_nums = 2
 min_augend = -20
 max_augend = 20
 min_addend = -20
@@ -45,12 +43,17 @@
 format_div_answer_first = 1
 format_div_answer_middle = 1
 randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 250
+vary_list_length = 0
 max_answer = 400
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.25
 slow_after_wrong = 0
 max_questions = 25000

Modified: tuxmath/trunk/data/missions/arcade/commando
===================================================================
--- tuxmath/trunk/data/missions/arcade/commando	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/arcade/commando	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,8 +8,6 @@
 multiplication_allowed = 1
 division_allowed = 1
 allow_negatives = 1
-min_formula_nums = 3
-max_formula_nums = 4
 min_augend = -20
 max_augend = 20
 min_addend = -20
@@ -45,12 +43,16 @@
 format_div_answer_first = 1
 format_div_answer_middle = 1
 randomize = 1
-max_answer = 400
+comprehensive = 0
+min_formula_nums = 3
+max_formula_nums = 4
+avg_list_length = 250
+vary_list_length = 0
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 0.25
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.125
 slow_after_wrong = 1
 max_questions = 25000

Modified: tuxmath/trunk/data/missions/arcade/ranger
===================================================================
--- tuxmath/trunk/data/missions/arcade/ranger	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/arcade/ranger	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,8 +8,6 @@
 multiplication_allowed = 1
 division_allowed = 1
 allow_negatives = 0
-max_formula_nums = 2
-min_formula_nums = 2
 min_augend = 0
 max_augend = 20
 min_addend = 0
@@ -45,11 +43,18 @@
 format_div_answer_first = 1
 format_div_answer_middle = 1
 max_answer = 100
+randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 250
+vary_list_length = 0
+
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.2
 slow_after_wrong = 0
 max_questions = 25000

Modified: tuxmath/trunk/data/missions/arcade/scout
===================================================================
--- tuxmath/trunk/data/missions/arcade/scout	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/arcade/scout	2008-12-18 01:56:18 UTC (rev 814)
@@ -30,12 +30,18 @@
 format_sub_answer_last = 1
 format_sub_answer_first = 0
 format_sub_answer_middle = 0
+randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 250
+vary_list_length = 0
 max_answer = 20
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.15
 slow_after_wrong = 0
 max_questions = 5000

Modified: tuxmath/trunk/data/missions/arcade/space_cadet
===================================================================
--- tuxmath/trunk/data/missions/arcade/space_cadet	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/arcade/space_cadet	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,8 +8,6 @@
 multiplication_allowed = 0
 division_allowed = 0
 allow_negatives = 0
-max_formula_nums = 2
-min_formula_nums = 2
 min_augend = 0
 max_augend = 10
 min_addend = 0
@@ -23,12 +21,18 @@
 format_add_answer_last = 1
 format_add_answer_first = 0
 format_add_answer_middle = 0
+randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 121
+vary_list_length = 0
 max_answer = 10
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.1
 slow_after_wrong = 0
 max_questions = 5000

Modified: tuxmath/trunk/data/missions/campaign/ace/ace
===================================================================
--- tuxmath/trunk/data/missions/campaign/ace/ace	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/campaign/ace/ace	2008-12-18 01:56:18 UTC (rev 814)
@@ -5,6 +5,7 @@
 allow_negatives = 1
 max_formula_nums = 2
 min_formula_nums = 2
+comprehensive = 1
 question_copies = 1
 copies_repeated_wrongs = 1
 format_add_answer_last = 1
@@ -15,7 +16,8 @@
 extra_comets_per_wave = 3
 max_comets = 12
 speed = 1.2
+max_speed = 10
 speedup_factor = 1.1
 bonus_comet_interval = 20
-vary_list_length = 1
+vary_list_length = 0
 

Modified: tuxmath/trunk/data/missions/campaign/cadet/cadet
===================================================================
--- tuxmath/trunk/data/missions/campaign/cadet/cadet	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/campaign/cadet/cadet	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,6 +8,7 @@
 allow_negatives = 0
 max_formula_nums = 2
 min_formula_nums = 2
+comprehensive = 1
 question_copies = 1
 copies_repeated_wrongs = 1
 format_add_answer_last = 1
@@ -18,6 +19,7 @@
 extra_comets_per_wave = 2
 max_comets = 6
 speed = 1.00
+max_speed = 10.00
 speedup_factor = 1.1
 bonus_comet_interval = 10
 vary_list_length = 0

Modified: tuxmath/trunk/data/missions/campaign/commando/commando
===================================================================
--- tuxmath/trunk/data/missions/campaign/commando/commando	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/campaign/commando/commando	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,6 +8,7 @@
 allow_negatives = 1
 max_formula_nums = 5
 min_formula_nums = 2
+comprehensive = 0
 question_copies = 1
 copies_repeated_wrongs = 1
 format_add_answer_last = 1
@@ -18,7 +19,8 @@
 extra_comets_per_wave = 3
 max_comets = 12
 speed = 1.1
+max_speed = 10.00
 speedup_factor = 1.05
 bonus_comet_interval = 20
-vary_list_length = 1
+vary_list_length = 0
 

Modified: tuxmath/trunk/data/missions/campaign/ranger/ranger
===================================================================
--- tuxmath/trunk/data/missions/campaign/ranger/ranger	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/campaign/ranger/ranger	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,6 +8,7 @@
 allow_negatives = 1
 max_formula_nums = 2
 min_formula_nums = 2
+comprehensive = 1
 question_copies = 1
 copies_repeated_wrongs = 1
 format_add_answer_last = 1
@@ -18,7 +19,8 @@
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.0
+max_speed = 10.00
 speedup_factor = 1.2
 bonus_comet_interval = 20
-vary_list_length = 1
+vary_list_length = 0
 

Modified: tuxmath/trunk/data/missions/campaign/scout/scout
===================================================================
--- tuxmath/trunk/data/missions/campaign/scout/scout	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/campaign/scout/scout	2008-12-18 01:56:18 UTC (rev 814)
@@ -8,6 +8,7 @@
 allow_negatives = 0
 max_formula_nums = 2
 min_formula_nums = 2
+comprehensive = 1
 question_copies = 1
 copies_repeated_wrongs = 1
 format_add_answer_last = 1
@@ -17,6 +18,7 @@
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 8
+max_speed = 10
 speed = 1.00
 speedup_factor = 1.1
 bonus_comet_interval = 15

Modified: tuxmath/trunk/data/missions/lessons/Makefile.am
===================================================================
--- tuxmath/trunk/data/missions/lessons/Makefile.am	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/lessons/Makefile.am	2008-12-18 01:56:18 UTC (rev 814)
@@ -12,7 +12,6 @@
   lesson06 \
   lesson07 \
   lesson08 \
-  lesson08.1 \
   lesson09 \
   lesson10 \
   lesson11 \
@@ -52,15 +51,16 @@
   lesson45 \
   lesson46 \
   lesson47 \
-  lesson47.1 \
   lesson48 \
-  lesson48.1 \
   lesson49 \
   lesson50 \
   lesson51 \
   lesson52 \
   lesson53 \
-  lesson54
+  lesson54 \
+  lesson55 \
+  lesson56 \
+  lesson57
 
 EXTRA_DIST = descr_lessons \
   update-po.sh

Modified: tuxmath/trunk/data/missions/lessons/descr_lessons
===================================================================
--- tuxmath/trunk/data/missions/lessons/descr_lessons	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/lessons/descr_lessons	2008-12-18 01:56:18 UTC (rev 814)
@@ -24,56 +24,32 @@
 _("Multiples of 10")
 _("Multiplication: 0 to 10")
 _("Multiples of 11 and 12")
-_("Multiples of 11 and 12")
 _("Multiplication: 0 to 12")
-_("Multiplication: 0 to 12")
 _("Multiples of 13, 14, and 15")
-_("Multiples of 13, 14, and 15")
 _("Multiplication: 0 to 15")
-_("Multiplication: 0 to 15")
 _("Multiplication: Missing Numbers")
-_("Multiplication: Missing Numbers")
 _("Division by 2")
-_("Division by 2")
 _("Division by 3")
-_("Division by 3")
 _("Division by 4")
-_("Division by 4")
 _("Division by 5")
-_("Division by 5")
 _("Division: 1 to 5")
-_("Division: 1 to 5")
 _("Division by 6")
-_("Division by 6")
 _("Division by 7")
-_("Division by 7")
 _("Division by 8")
-_("Division by 8")
 _("Division by 9")
-_("Division by 9")
 _("Division by 10")
-_("Division by 10")
 _("Division: 1 to 10")
-_("Division: 1 to 10")
 _("Division by 11 and 12")
-_("Division by 11 and 12")
 _("Division: 1 to 12")
-_("Division: 1 to 12")
 _("Division by 13, 14, and 15")
-_("Division by 13, 14, and 15")
 _("Division: 1 to 15")
-_("Division: 1 to 15")
 _("Multiplication and Division Review")
-_("Multiplication and Division Review")
 _("Typing Negative Numbers")
-_("Typing Negative Numbers")
 _("Subtraction: Negative Answers")
-_("Subtraction: Negative Answers")
 _("Adding Negatives to Positives")
 _("Adding Positives to Negatives")
-_("Adding  Positives to Negatives")
-_("Adding Negatives to Positives")
 _("Subtracting Negatives From Positives")
+_("Subtracting Positives From Negatives")
 _("Adding Negatives to Negatives")
 _("Subtracting Negatives From Negatives")
 _("Negative and Positive Numbers Review")

Modified: tuxmath/trunk/data/missions/multiplay/ace
===================================================================
--- tuxmath/trunk/data/missions/multiplay/ace	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/multiplay/ace	2008-12-18 01:56:18 UTC (rev 814)
@@ -1,5 +1,6 @@
 # multiplay ace lesson file
 
+play_through_list = 0
 allow_speedup = 1
 use_feedback = 0
 addition_allowed = 1
@@ -7,8 +8,6 @@
 multiplication_allowed = 1
 division_allowed = 1
 allow_negatives = 1
-max_formula_nums = 2
-min_formula_nums = 2
 min_augend = -20
 max_augend = 20
 min_addend = -20
@@ -44,12 +43,17 @@
 format_div_answer_first = 1
 format_div_answer_middle = 1
 randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 250
+vary_list_length = 0
 max_answer = 400
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.25
 slow_after_wrong = 0
 max_questions = 25000

Modified: tuxmath/trunk/data/missions/multiplay/commando
===================================================================
--- tuxmath/trunk/data/missions/multiplay/commando	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/multiplay/commando	2008-12-18 01:56:18 UTC (rev 814)
@@ -1,5 +1,6 @@
 # multiplay commando lesson file
 
+play_through_list = 0
 allow_speedup = 1
 use_feedback = 0
 addition_allowed = 1
@@ -7,8 +8,6 @@
 multiplication_allowed = 1
 division_allowed = 1
 allow_negatives = 1
-min_formula_nums = 3
-max_formula_nums = 4
 min_augend = -20
 max_augend = 20
 min_addend = -20
@@ -19,12 +18,12 @@
 max_subtrahend = 20
 min_multiplier = -20
 max_multiplier = 20
-min_multiplicand = -20
-max_multiplicand = 20
+min_multiplicand = -10
+max_multiplicand = 10
 min_divisor = -20
 max_divisor = 20
-min_quotient = -20
-max_quotient = 20
+min_quotient = -10
+max_quotient = 10
 use_bkgd = 1
 demo_mode = 0
 save_summary = 1
@@ -44,14 +43,18 @@
 format_div_answer_first = 1
 format_div_answer_middle = 1
 randomize = 1
-max_answer = 400
+comprehensive = 0
+min_formula_nums = 3
+max_formula_nums = 4
+avg_list_length = 250
+vary_list_length = 0
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 0.25
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.125
-slow_after_wrong = 0
+slow_after_wrong = 1
 max_questions = 25000
 bonus_comet_interval = 20
 fraction_to_keep = 1

Modified: tuxmath/trunk/data/missions/multiplay/ranger
===================================================================
--- tuxmath/trunk/data/missions/multiplay/ranger	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/multiplay/ranger	2008-12-18 01:56:18 UTC (rev 814)
@@ -1,5 +1,6 @@
 # multiplay_ranger lesson file
 
+play_through_list = 0
 allow_speedup = 1
 use_feedback = 0
 addition_allowed = 1
@@ -7,8 +8,6 @@
 multiplication_allowed = 1
 division_allowed = 1
 allow_negatives = 0
-max_formula_nums = 2
-min_formula_nums = 2
 min_augend = 0
 max_augend = 20
 min_addend = 0
@@ -44,11 +43,18 @@
 format_div_answer_first = 1
 format_div_answer_middle = 1
 max_answer = 100
+randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 250
+vary_list_length = 0
+
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.2
 slow_after_wrong = 0
 max_questions = 25000

Modified: tuxmath/trunk/data/missions/multiplay/scout
===================================================================
--- tuxmath/trunk/data/missions/multiplay/scout	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/multiplay/scout	2008-12-18 01:56:18 UTC (rev 814)
@@ -1,5 +1,6 @@
 # multiplay_scout lesson file
 
+play_through_list = 0
 allow_speedup = 1
 use_feedback = 0
 addition_allowed = 1
@@ -29,12 +30,18 @@
 format_sub_answer_last = 1
 format_sub_answer_first = 0
 format_sub_answer_middle = 0
+randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 250
+vary_list_length = 0
 max_answer = 20
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.15
 slow_after_wrong = 0
 max_questions = 5000

Modified: tuxmath/trunk/data/missions/multiplay/space_cadet
===================================================================
--- tuxmath/trunk/data/missions/multiplay/space_cadet	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/data/missions/multiplay/space_cadet	2008-12-18 01:56:18 UTC (rev 814)
@@ -1,5 +1,6 @@
 # multiplay space cadet lesson file
 
+play_through_list = 0
 allow_speedup = 1
 use_feedback = 0
 addition_allowed = 1
@@ -7,8 +8,6 @@
 multiplication_allowed = 0
 division_allowed = 0
 allow_negatives = 0
-max_formula_nums = 2
-min_formula_nums = 2
 min_augend = 0
 max_augend = 10
 min_addend = 0
@@ -22,12 +21,18 @@
 format_add_answer_last = 1
 format_add_answer_first = 0
 format_add_answer_middle = 0
+randomize = 1
+comprehensive = 1
+min_formula_nums = 2
+max_formula_nums = 2
+avg_list_length = 121
+vary_list_length = 0
 max_answer = 10
 starting_comets = 2
 extra_comets_per_wave = 2
 max_comets = 10
 speed = 1.00
-max_speed = 10.00
+max_speed = 40.00
 speedup_factor = 1.1
 slow_after_wrong = 0
 max_questions = 5000

Modified: tuxmath/trunk/doc/changelog
===================================================================
--- tuxmath/trunk/doc/changelog	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/doc/changelog	2008-12-18 01:56:18 UTC (rev 814)
@@ -12,14 +12,7 @@
 
         David Bruce <davidstuartbruce at gmail.com>
 
-2008.Oct.16 (svn.debian.org/tux4kids - revision 763)
-	Credits: 
-          Changed Tim Holy's listing from "Additional Code" to "Lead
-          Programmer" to better acknowledge his major role over the last
-          year.
-
-        David Bruce <davidstuartbruce at gmail.com>
-008.Dec.11 (svn.debian.org/tux4kids - revision 796)
+2008.Dec.11 (svn.debian.org/tux4kids - revision 796)
 	Initial file reorganization to separate SDL-related code from more
 	infrastructural code. This is intended to allow us to create and
 	compile stand-alone programs that test specific functions (e.g.,

Modified: tuxmath/trunk/src/mathcards.c
===================================================================
--- tuxmath/trunk/src/mathcards.c	2008-12-17 02:06:46 UTC (rev 813)
+++ tuxmath/trunk/src/mathcards.c	2008-12-18 01:56:18 UTC (rev 814)
@@ -1163,8 +1163,10 @@
 void print_card(MC_FlashCard card)
 {
   printf("\nprint_card():");
-  printf("formula_string = %s, answer_string = %s\n",
-         card.formula_string, card.answer_string);
+  printf("formula_string = %s\nanswer_string = %s\ndifficulty = %d\n\n",
+         card.formula_string,
+         card.answer_string,
+         card.difficulty);
 }
 
 /* This sends the values of all "global" counters and the */
@@ -1596,15 +1598,12 @@
         r1 *= r2;
         ans = ret.difficulty;
       }
-    } while // Here is where we filter out invalid questions
-      (
-        (ans < 0 && !MC_GetOpt(ALLOW_NEGATIVES))
-      );
+    } while (ans < 0 && !MC_GetOpt(ALLOW_NEGATIVES) );
 
 
-//    mcdprintf("Constructing answer_string\n");
-    snprintf(ret.answer_string, max_answer_size + 1, "%d", ans);
-//    mcdprintf("Constructing formula_string\n");
+    mcdprintf("Constructing answer_string\n");
+    snprintf(ret.answer_string, max_answer_size+1, "%d", ans);
+    mcdprintf("Constructing formula_string\n");
     snprintf(ret.formula_string, max_formula_size, "%d %c %d",
              r1, operchars[op], r2);
     ret.answer = ans;
@@ -1682,22 +1681,17 @@
     snprintf(ret.answer_string, max_answer_size, "%d", ret.answer);
     ret.difficulty += (length - 1) + op;
   }
-
-  // Here we add the " = ?", and if desired, rearrange the string
-  // for a "missing answer" question
-  strncat(ret.formula_string, 
-          " = ?", 
-          max_formula_size - strlen(ret.formula_string));
-
-  if(0)//(reformat)
+  
+  if (reformat)
   {
     mcdprintf("Reformatting...\n");
     do {
       format = rand() % MC_NUM_FORMATS;
     } while (!MC_GetOpt(FORMAT_ANSWER_LAST + format) && 
-             !MC_GetOpt(FORMAT_ADD_ANSWER_LAST + op * 3 + format));
-
-    reformat_arithmetic(&ret, format);     
+             !MC_GetOpt(FORMAT_ADD_ANSWER_LAST + op * 3 + format) );
+   
+    strncat(ret.formula_string, " = ?", max_formula_size - strlen(ret.formula_string) );
+    reformat_arithmetic(&ret, format );     
   }
   return ret;
 }
@@ -2144,6 +2138,8 @@
 
 //NOTE end_of_list** needs to be doubly indirect because otherwise the end does not
 //get updated in the calling code
+//NOTE the difficulty is set as add = 1, sub = 2, mult = 3, div = 4, plus a 2 point
+//bonus if the format is a "missing number".
 MC_MathQuestion* add_all_valid(MC_ProblemType pt, MC_MathQuestion* list, MC_MathQuestion** end_of_list)
 {
   int i, j;
@@ -2175,6 +2171,7 @@
 
       snprintf(tnode->card.formula_string, max_formula_size, "%d", i);
       snprintf(tnode->card.answer_string, max_formula_size, "%d", i);
+      tnode->card.difficulty = 1;
       list = insert_node(list, *end_of_list, tnode);
       *end_of_list = tnode;
     }
@@ -2282,6 +2279,7 @@
             snprintf(tnode->card.answer_string, max_formula_size, "%d", ans);
             snprintf(tnode->card.formula_string, max_formula_size,
                      "%d %c %d = ?", i, operchars[k], j);
+            tnode->card.difficulty = k + 1;
             list = insert_node(list, *end_of_list, tnode);
             *end_of_list = tnode;
           }
@@ -2316,6 +2314,7 @@
             snprintf(tnode->card.answer_string, max_formula_size, "%d", i);
             snprintf(tnode->card.formula_string, max_formula_size,
                      "? %c %d = %d", operchars[k], j, ans);
+            tnode->card.difficulty = k + 3;
             list = insert_node(list, *end_of_list, tnode);
             *end_of_list = tnode;
           }
@@ -2349,6 +2348,7 @@
             snprintf(tnode->card.answer_string, max_formula_size, "%d", j);
             snprintf(tnode->card.formula_string, max_formula_size,
                      "%d %c ? = %d", i, operchars[k], ans);
+            tnode->card.difficulty = k + 3;
             list = insert_node(list, *end_of_list, tnode);
             *end_of_list = tnode;
           }
@@ -2383,6 +2383,7 @@
                  i < j ? "<" : 
                  i > j ? ">" : 
                          "=");
+        tnode->card.difficulty = 1;
         list = insert_node(list, *end_of_list, tnode);
         *end_of_list = tnode;
       }




More information about the Tux4kids-commits mailing list