back to qz Home Page
qz
Table of Contents
qz is a flexible, general-purpose quiz program originally
intended for use as a word study program for serious word game players.
It is written entirely in Perl, and has been tested on Macintosh, Unix,
DOS and Windows systems with versions 4 and 5 of Perl.
Useful features include:
To get started, please continue with the next section.
Here's what you have to do to get started with qz.
- Install a copy of Perl, if you don't already have one.
- OS/X comes with Perl.
- On a Classic Mac, use
Find File
to look for an application called
MacPerl
. If not, you can
download
a copy here.
- On a Unix system, try typing
perl -v
at the shell prompt.
If you don't have a copy, bug your system administrator.
- On a DOS or Windows system, download a free copy of ActivePerl from
ActiveState.
- Download a copy of
qz.pl. You can rename it if you like, say to just
qz.
- On a Classic Mac, make sure you download it as a text file. If you
don't, when you first open the file, all you'll see is one long line
starting with
#!
. (If it does appear as one long line,
you can open it with BBEdit, and Save it As a file with [Options] Mac
line breaks to fix the problem.) Once you've downloaded it, open it
once with MacPerl and save it again as a droplet
(a type
of mini-application).
- On an OS/X or Unix system, make sure you put the downloaded file in your
execution path, the colon-separated list of directories that
you see when you type
echo $PATH
. Most people will want
to put it in ~/bin
. Once you've downloaded the file, make
it executable by typing chmod u+x filename
.
- On a DOS or Windows system, ?.
- Download a copy of
sample.qz.
This sample qz file is set up to test you on the TWL96 words
to be found in the top hundred (productive) seven-letter racks.
- Download a copy of notes.txt. This file contains commentary on the seven-letter racks that will be displayed after each correct answer.
- Run qz.pl:
- On a Classic Mac, make sure sample.qz and qz.pl
are in the same folder, and double-click on
qz.pl
.
- On an OS/X or Unix system, change directory to
the one in which you placed sample.qz,
and type
qz.pl
.
- On a DOS system, change directory to the one in which you
placed your quiz files and type
perl sample.qz
.
- On a Windows system,
open a DOS window (enter 'command' in the 'Run...' prompt in the 'Start'
menu) and then follow the directions for DOS systems.
When you take a quiz, questions will be selected according to the
program that you have chosen, and displayed
on your screen. Here's an example:
[12] aeilnrs:
The number 12
tells you how many questions you have answered
so far: this is the 12th. The rest of the line aeilnrs
is
the question that you are to answer: in the sample database, the correct
answer is the list of TWL96 seven-letter words that can be made from these
letters.
At this point, you can do one of several things:
- Press control-D (Windows users press control-Z) to end the quiz.
- Enter the complete answer, if you know it:
aliners nailers
renails
and press return.
- If the question is tagged with the O flag
you can enter a partial answer, and you'll be prompted for the rest.
- Just press return to give up on this question and see the answer.
- Enter a '+' followed by a note to append to the note for the previous
question. Suppose in answering this question, you incorrectly guess that
'snailer' is a word. Enter
+snailer*
to remind you from
now on that it's a phoney.
You can also enter either <p>
or <br>
in the text of a note,
to represent a line break.
- Power users can enter '!' followed by a shell command or ';' followed
by a Perl expression.
If you enter a correct answer, you'll see a line like:
Correct. (12 d:68-45)
This means that you got the right answer, the last time you did so was
twelve days ago, and that the difficulty rating
of this question has been downgraded from 68 to 45.
On the other hand, if you get the answer wrong, you'll see something like:
The correct answer is 'aliners nailers renails' (68-100)
This means that you did not answer correctly, and that the difficulty rating
of this question has been raised to 100. In either case, if there's a note
attached to the question, it will be displayed on the next line.
New to version 2 of qz is the ability to work simultaneously
with multiple quiz files. You can for instance keep your seven-letter
words organized by frequency by hundreds, and then ask qz
to pick randomly from the fifth, sixth and seventh sets, tossing in
perhaps the occasional anamonic or word from a completely different list
for a change.
In general, if you run qz and don't tell it what quiz files
you want to use, it will use all the quiz files in the current folder
(Classic Mac) or directory (OS/X or Unix or DOS). If there are sets of files that you
often like to run together, you may like to keep them together in
folders. If you want to have the same quiz file appear in different
folders/directories, you can use aliases or symbolic links.
To explicitly choose which quiz files you want to run:
- On a Classic Mac, drag the quiz files onto the qz droplet
application.
- With OS/X, DOS or Unix, list the quiz files on your command line:
qz file1.qz file2.qz...
.
As of version 3.0.7 you can also specify folder/directory names
(or drag folders) instead of files to quiz yourself on groups of
quiz files contained in them.
qz lets you decide how it chooses questions for you.
At present, it has the following basic methods for choosing questions,
which you can combine in different ratios to make a 'program':
- oldest
- Pick the question whose last correct answer was longest ago.
Picking questions this way makes sure each question gets asked
at least once in a while, no matter how easy it is.
- hardest
- Pick the question that has the highest difficulty rating.
Picking questions this way helps you learn new information,
so it's more useful when you're first beginning to work with
a new set of questions.
- random
- Pick a question at random, with the chance that a question
will be picked being proportional to its difficulty. This is
good for reviewing questions, because it concentrates on the
questions with which you've historically had trouble.
- review
- Pick the question which was answered incorrectly least
recently in this session. Picking some of these gives you a chance
to review your mistakes while they're fresh in your mind.
A 'program' is a name for a set of probabilities describing how
often qz will choose which basic method. At present,
the default program (jjc) picks the hardest question
30% of the time, the oldest 20%, a random one 40%, and a review
question 10%. The programs named oldest, hardest
and random each choose 100% according to their
respective methods.
To choose a method:
As of version 3.0.14, you can use regular expressions (or any other
Perl syntax) to select questions from a set which match a certain pattern.
Use qz -m pattern
to select only those questions whose
question text matches the given pattern, or
qz -M pattern
to select only those questions whose
answer text matches the given pattern. Here are some examples,
written for the Unix command line. Quoting conventions may differ
for other operating systems.
qz -m /q/ words.qz |
Quiz the words in words.qz which contain a q. |
qz -m '/[jqxz]/' words.qz |
Quiz the words in words.qz which contain a j, q, x or z. The quotation marks are necessary to prevent Unix shells from trying to match files in the current directory against the pattern. |
qz -m '/q/ && !/u/' words.qz |
Quiz the words in words.qz which have a q but no u. This could also be written as qz -m '/^[^u]*q[^u]*$/' words.qz. |
qz -M '/\bz/' words.qz |
Quiz the words in words.qz which have at least one answer starting with a z. The regular expression element \b matches a word break, so it will catch a z at the beginning of any of the words in the answer. |
qz -M '/ing\b/' words.qz |
Quiz the words in words.qz which have at least one answer ending with ing. |
qz -M '/ .* /' words.qz |
Quiz the words in words.qz which have at least three anagrams. The words in the answer are separated by spaces, and this pattern searches for a space, followed by anything, followed by another space. |
I'm still finding and fixing bugs in qz. If you see one
or can think of a feature you'd like to see added, let me know.
The change log is now in a separate file.