quiz
Administer and take vocabulary quizzes
SYNOPSIS
quiz [ -i ] [ -t ] [ -r ] [ -h ] [ -n ] [ -p ] [ -l num ] [ file ... ]
PARAMETERS
-i
Ignores the first word of the question for sorting purposes. This is useful for lists where articles (like 'The' or 'A') might affect alphabetical order.
-t
Enables test mode, which prints both the question and its answer immediately, followed by a bell. This is helpful for debugging new or modified data files.
-r
Reverses the question and answer. The original answer becomes the question, and the original question becomes the answer, allowing for 'backwards' knowledge testing.
-h
Activates hard mode. If an answer is incorrect, the question is repeated in a much briefer format, rather than cycling through similar questions.
-n
Disables randomization. Questions are presented in the exact order they appear in the specified data file(s).
-p
Sets the scoring to percentage mode. The final score displays the percentage of correct answers achieved on the first attempt.
-l num
Limits the number of questions asked during the session to 'num'.
file ...
Specifies one or more custom data files to be used for questions. If no files are specified, the default data file is used.
DESCRIPTION
The quiz command is an interactive command-line utility designed to test a user's knowledge on various subjects. It reads questions and answers from specified data files, or a default file like /usr/share/games/quiz/quiz.k. The program presents questions one by one, awaiting the user's input. If an answer is incorrect, quiz may re-present a briefer form of the same question or a different question covering similar material until the correct answer is provided or the user opts to skip.
A score is maintained throughout the session, and at the end, the percentage of correct answers is displayed. Users can supply their own data files, which consist of lines with a question and its answer separated by a tab. Lines beginning with '#' are treated as comments, and empty lines are ignored.
CAVEATS
The default data file (/usr/share/games/quiz/quiz.k) is typically part of the bsdgames package and might not be installed by default on all Linux distributions. Custom data files must adhere to a simple format: question and answer separated by a tab.
FILES
/usr/share/games/quiz/quiz.k
This is the default data file used by the quiz command if no specific data files are provided as arguments.
AUTHORS
The original author of the quiz command is listed as unknown. The version distributed as part of bsdgames was rewritten by David F. Hirst.
HISTORY
A quiz command first appeared in Version 6 AT&T UNIX. The version commonly found in bsdgames on modern systems is a complete rewrite by David F. Hirst.