quiz
Administer and take vocabulary quizzes
SYNOPSIS
quiz [-i] [-n questions] [-f quizfile]
PARAMETERS
-i
Ignore case when comparing answers.
-n questions
Ask only the specified number of questions.
If 'questions' is a negative number, the quiz will skip the first abs(questions) questions.
-f quizfile
Specify a different quiz data file instead of the default `/usr/share/games/bsdgames/capitals`.
DESCRIPTION
The `quiz` command presents a geography quiz to the user. It reads questions and answers from a data file (typically `/usr/share/games/bsdgames/capitals`) and presents them one at a time. The user types in their answer, and the program checks it against the correct answer. The program provides feedback, indicating whether the answer was correct or incorrect. It continues until the user interrupts the program (e.g., by pressing Ctrl+C) or until all questions in the data file have been presented. The program keeps track of the number of questions asked and the number of correct answers and displays the score when the program exits. While seemingly simple, `quiz` serves as a good example of text-based interactive programs in a terminal environment. The default database can be overridden with the -f flag. The quiz file consists of lines of the form: QUESTION : ANSWER.
CAVEATS
The quality of the quiz depends entirely on the data file used. The program assumes a specific format for the data file (QUESTION : ANSWER), and any deviation from this format can lead to unexpected results.
DATA FILE FORMAT
The quiz data file is a plain text file where each line represents a question and answer pair. The format is `QUESTION : ANSWER`. The QUESTION part is the question to be asked, and the ANSWER part is the correct answer. Colons within the question or answer may cause unexpected behaviour.
HISTORY
The `quiz` command has been a part of BSD-derived systems for a long time, offering a simple and engaging way to test geographical knowledge. It's a classic example of the kind of interactive educational games that were common on early Unix systems. Over time, the command has remained relatively unchanged, retaining its simplicity and functionality.
SEE ALSO
learn(6)