[Tux4kids-commits] r1366 - tuxmath/branches/lan/server
David Bruce
dbruce-guest at alioth.debian.org
Wed Aug 5 12:02:18 UTC 2009
Author: dbruce-guest
Date: 2009-08-05 12:02:13 +0000 (Wed, 05 Aug 2009)
New Revision: 1366
Modified:
tuxmath/branches/lan/server/testclient.c
Log:
added reporting of wrong questions to test client
Modified: tuxmath/branches/lan/server/testclient.c
===================================================================
--- tuxmath/branches/lan/server/testclient.c 2009-08-05 08:13:46 UTC (rev 1365)
+++ tuxmath/branches/lan/server/testclient.c 2009-08-05 12:02:13 UTC (rev 1366)
@@ -34,7 +34,6 @@
int quit = 0;
int game_status = GAME_NOT_STARTED;
-MC_FlashCard flash; //current question
MC_FlashCard comets[TEST_COMETS]; //current questions
int remaining_quests = 0;
@@ -417,7 +416,15 @@
}
else //we got input, but not the correct answer:
{
+ int i = rand()%TEST_COMETS;
printf("Sorry, %s is incorrect. Try again!\n", buf);
+ // Can't tell which question was the 'wrong' one, so we
+ // a non-empty one at random. Note that this is just for
+ // purposes of testing LAN_NotAnsweredCorrectly()
+ while(-1 == comets[i].question_id)
+ i = rand()%TEST_COMETS;
+ fc = &comets[i];
+ LAN_NotAnsweredCorrectly(fc);
print_current_quests();
}
} //input wasn't any of our keywords
More information about the Tux4kids-commits
mailing list