Package: kdrill
Version: 6.4-1
Severity: minor
Tags: patch

hi,

when using the timer option, there is no miss accounted if I do not
answer in time. Looking at the source, it looks like it should.
I have attached a patch which actually adds the missing call from
the timeout callback

maybe "totalguessed" should not be increased in the case of a
"guess" due to an timeout..

cu
Maurice Massar

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (400, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686-smp
Locale: LANG=C, LC_CTYPE=ja_JP.UTF-8 (charmap=UTF-8)

Versions of packages kdrill depends on:
ii  debconf                   1.4.41         Debian configuration management sy
ii  libc6                     2.3.2.ds1-18   GNU C Library: Shared libraries an
ii  libice6                   4.3.0.dfsg.1-8 Inter-Client Exchange library
ii  libsm6                    4.3.0.dfsg.1-8 X Window System Session Management
ii  libx11-6                  4.3.0.dfsg.1-8 X Window System protocol client li
ii  libxaw7                   4.3.0.dfsg.1-8 X Athena widget set library
ii  libxext6                  4.3.0.dfsg.1-8 X Window System miscellaneous exte
ii  libxmu6                   4.3.0.dfsg.1-8 X Window System miscellaneous util
ii  libxpm4                   4.3.0.dfsg.1-8 X pixmap library
ii  libxt6                    4.3.0.dfsg.1-8 X Toolkit Intrinsics
ii  xlibs                     4.3.0.dfsg.1-8 X Window System client libraries m

-- debconf information excluded
diff -ur kdrill-6.4-dist/game.c kdrill-6.4/game.c
--- kdrill-6.4-dist/game.c      2005-01-08 07:49:05.000000000 +0100
+++ kdrill-6.4/game.c   2005-01-26 09:48:13.000000000 +0100
@@ -379,7 +379,8 @@
 {
        TRANSLATION kanjiP;
 
-       kanjiP = values[guess];/* for setting "incorrect" flag */
+       if (guess != -1)
+               kanjiP = values[guess];/* for setting "incorrect" flag */
 
        totalguessed+=1;
 
@@ -412,13 +413,15 @@
         *  once for the quiz meaning you missed,
         *  and once for the incorrect kanji you thought it was
         */
-       Beep();
-       setstatus("Incorrect.");
-
-       /* Note that markasmissed also increments numberincorrect,
-        *  *IFF* needed
-        */
+       
        if(guess != -1){
+               /* Timeout already handles message */
+               Beep();
+               setstatus("Incorrect.");
+
+               /* Note that markasmissed also increments numberincorrect,
+                *  *IFF* needed
+                */
                markasmissed(kanjiP);
        }
 
diff -ur kdrill-6.4-dist/mainwindow.c kdrill-6.4/mainwindow.c
--- kdrill-6.4-dist/mainwindow.c        2003-08-23 08:26:10.000000000 +0200
+++ kdrill-6.4/mainwindow.c     2005-01-26 09:49:28.000000000 +0100
@@ -121,7 +121,6 @@
  *     NOTE:
  *     we get passed the value (key-1)
  */
-/* note that "-1" means "default due to time" */
 void Guessvalue(Widget w,XEvent *event,String *params,Cardinal *num_parags)
 {
        int value;
diff -ur kdrill-6.4-dist/timeout.c kdrill-6.4/timeout.c
--- kdrill-6.4-dist/timeout.c   2001-08-31 01:26:20.000000000 +0200
+++ kdrill-6.4/timeout.c        2005-01-26 09:48:53.000000000 +0100
@@ -149,6 +149,7 @@
 void handletimeout(XtPointer closure, XtIntervalId *timerid){
        Beep();
        setstatus("TIME IS UP!");
+       guessvalue(-1);
        cheatcallback(NULL, (XtPointer)1, NULL);
        in_use=0;
 

Reply via email to