[email protected]
[Top] [All Lists]

Bug#296065: marked as forwarded (bsdgames: quiz gives out full solution

Subject: Bug#296065: marked as forwarded bsdgames: quiz gives out full solution after correct answer
From: Debian Bug Tracking System
Date: Mon, 21 Feb 2005 15:04:06 -0800
Your message dated Mon, 21 Feb 2005 17:59:53 -0500
with message-id <[email protected]>
has caused the Debian Bug report #296065,
regarding bsdgames: quiz gives out full solution after correct answer
to be marked as having been forwarded to the upstream software
author(s) [email protected]

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

---------------------------------------
Received: (at 296065-forwarded) by bugs.debian.org; 21 Feb 2005 22:57:18 +0000
>From [email protected] Mon Feb 21 14:57:18 2005
Return-path: <[email protected]>
Received: from kitenet.net [64.62.161.42] (postfix)
        by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
        id 1D3MUQ-00064D-00; Mon, 21 Feb 2005 14:57:18 -0800
Received: from dragon.kitenet.net (unknown [66.168.94.144])
        (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
        (Client CN "Joey Hess", Issuer "Joey Hess" (verified OK))
        by kitenet.net (Postfix) with ESMTP id 8655217DF7;
        Mon, 21 Feb 2005 22:57:17 +0000 (GMT)
Received: by dragon.kitenet.net (Postfix, from userid 1000)
        id 03C566F031; Mon, 21 Feb 2005 17:59:53 -0500 (EST)
Date: Mon, 21 Feb 2005 17:59:53 -0500
From: Joey Hess <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: FWD: Bug#296065: bsdgames: quiz gives out full solution after correct 
answer
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
        protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62"
Content-Disposition: inline
User-Agent: Mutt/1.5.6+20040907i
Delivered-To: [email protected]
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
        (1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-11.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
        HAS_PACKAGE autolearn=ham version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 


--+QahgC5+KEYLbs62
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

I think this is a great idea, but it's not the kind of change I like to
make to the Debian bsd-games package. So hopefully you can apply it.

----- Forwarded message from Ulf Schaper <[email protected]> -----

=46rom: Ulf Schaper <[email protected]>
Date: Sun, 20 Feb 2005 00:54:58 +0100
To: Debian Bug Tracking System <[email protected]>
Subject: Bug#296065: bsdgames: quiz gives out full solution after correct a=
nswer
Reply-To: Ulf Schaper <[email protected]>, [email protected]
X-Mailer: reportbug 3.8

Package: bsdgames
Version: 2.16-5
Severity: wishlist


Hi everyone,

I've been learning the US presidents by heart using quiz. However, I
have problems with the first names because quiz is satisfied if one
enters just their lastnames. With this patch, quiz gives out the whole
answer if the user answered correctly, this means in the case of the
presidents that the program is going to tell me the whole name even if I
only know the last name.

As this is the first patch I ever wrote, please apologize any
imperfection and tell me about it :-)

Best wishes,
Ulf Schaper

*** patch_answer
--- bsd-games.orig/quiz/quiz.6.in       2005-02-19 21:19:25.000000000 +0000
+++ bsd-games-2.17/quiz/quiz.6.in       2005-02-19 23:02:41.000000000 +0000
@@ -42,6 +42,7 @@
 .Nm
 .Op Fl t
 .Op Fl i Ar file
+.Op Fl a
 .Op Ar question answer
 .Sh DESCRIPTION
 The
@@ -60,6 +61,11 @@
 to help you learn the older ones.
 .It Fl i
 Specify an alternative index file.
+.It Fl a
+Show the (full!) answer even if you answered correctly.=20
+Remember that in some categories (such as ``quiz term president'') it is
+possible to be "right" by giving a part of the answer: If you use this
+option and say "Kennedy", quiz will add "John Fitzgerald Kennedy".
 .El
 .Pp
 Subjects are divided into categories.
--- bsd-games.orig/quiz/quiz.c  2005-02-19 21:19:25.000000000 +0000
+++ bsd-games-2.17/quiz/quiz.c  2005-02-19 22:24:07.000000000 +0000
@@ -62,7 +62,7 @@
 #include "pathnames.h"
=20
 static QE qlist;
-static int catone, cattwo, tflag;
+static int catone, cattwo, tflag, aflag;
 static u_int qsize;
=20
 char   *appdstr(char *, const char *, size_t);
@@ -88,7 +88,7 @@
        setregid(getgid(), getgid());
=20
        indexfile =3D _PATH_QUIZIDX;
-       while ((ch =3D getopt(argc, argv, "i:t")) !=3D -1)
+       while ((ch =3D getopt(argc, argv, "i:t:a")) !=3D -1)
                switch(ch) {
                case 'i':
                        indexfile =3D optarg;
@@ -96,6 +96,9 @@
                case 't':
                        tflag =3D 1;
                        break;
+               case 'a':
+                       aflag =3D 1;
+                       break;
                case '?':
                default:
                        usage();
@@ -290,7 +293,14 @@
                        answer[len - 1] =3D '\0';
                        downcase(answer);
                        if (rxp_match(answer)) {
-                               (void)printf("Right!\n");
+                               if (!aflag)  {
+                                   // Normal mode: just say "right"
+                                   (void)printf("Right!\n");
+                                 } else {
+                                   // answer mode: Give out the answer
+                                   // although the user was right.
+                                   (void)printf("Right! %s.\n",t);
+                                 }
                                ++rights;
                                qp->q_answered =3D TRUE;
                                break;
@@ -383,6 +393,6 @@
 void
 usage()
 {
-       (void)fprintf(stderr, "quiz [-t] [-i file] category1 category2\n");
+       (void)fprintf(stderr, "quiz [-t] [-i file] [-a] category1 category2\n");
        exit(1);
 }


-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.4.27ulf1
Locale: LANG=3DC, LC_CTYPE=3DC (charmap=3DANSI_X3.4-1968)

Versions of packages bsdgames depends on:
ii  libc6                       2.3.2.ds1-20 GNU C Library: Shared librarie=
s an
ii  libgcc1                     1:3.4.3-7    GCC support library
ii  libncurses5                 5.4-4        Shared libraries for terminal =
hand
ii  libstdc++5                  1:3.3.5-8    The GNU Standard C++ Library v3
ii  wamerican [wordlist]        5-4          American English dictionary wo=
rds=20
ii  wenglish                    5-4          American English dictionary wo=
rds=20

-- no debconf information


----- End forwarded message -----

--=20
see shy jo

--+QahgC5+KEYLbs62
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCGmfpd8HHehbQuO8RApGcAJ40fJkWmevSWgwcicyOrOPAUPNjmwCgy+3V
PNmSIT5BvrMonvC4+Fahpus=
=rFnj
-----END PGP SIGNATURE-----

--+QahgC5+KEYLbs62--


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

<Prev in Thread] Current Thread [Next in Thread>
  • Bug#296065: marked as forwarded (bsdgames: quiz gives out full solution after correct answer), Debian Bug Tracking System <=