This is some spaghetti I have been working on. It's poorly documented and not very structured at the moment, but it works nicely so far..
Here is how to build it:
Step 1: Type make. Enter the directory where you put the .__t files when
you are asked.
Step 3: Copy the quiz binary to whatever directory you like that is in your
PATH. Check to see that it is still executable.
Step 4: Run quiz. A list of quizzes should pop up if you have any of the
.__t files in the directory you specified in Step 1. If not, the
test will whine and exit.
There is a small shell script called create.test. It will create or append to a quiz in the current directory, so cd to wherever, and run create.test and follow the prompts. This script is very primitive, so you might have better luck with vi.
Here is how the quiz (.__t) files are formatted. The formatting is very important as I am not really doing much error checking when reading them in, so be careful.
tTitle of the quiz
qWhy did the chicken cross the road?
aTo get to the other side.
nBecause he felt like it.
nHe was stapled to the punk.
nTo make a drug deal.
eThis is a common riddle which should not require and explanation.
xThis is something to put up if they get it RIGHT.
There is one "t" line per quiz file. It needs to be the top line. Each item must have a "q" or "Q" line. "q" means that the answers are allowed to be randomized, and "Q" means don't randomize. A question where you would put "Q" would be for instance one with an answer such as "Both A and B" as rearranging such an item would make it nonsense. After the "q" or "Q" you need at least one "a" line. This is an answer that is to be marked. You can have more than one "a" line, for example, an item that has more than one correct answer and they must choose them all. After the "a" lines, you have zero or more "n" lines. You do not need an "n" line but it would be kind of silly to not have one because the test will tell them how many answers to pick and it would be a gimme. After the [Qq], a, and n lines, you can have an "e" line, which is an optional explanation. The "e" lines are not mandatory. The "x" lines work similarly to the "e" lines except they get put up when the quizee answers the question correctly instead of wrong.
You can also mix the "a" and "n" entries like so:
t....
Q....
n....
n....
a....
n....
e....
x....
That way you can "force" answer c to be the right answer all the time for this question. Remember, Q means don't rearrange the answers at random and q means to do so.
t mandatory Top line of file, one and only one of these.
q mandatory Each item must start with a question.
a mandatory Each item must have at least one correct answer.
a not mandatory
a not mandatory
n not mandatory
n not mandatory
e not mandatory
x not mandatory
These must be in order.
Do not put a blank line at the end of the quiz file.
If you write a quiz and you want it to be distributed with the program, send it in and let me know!! You'll get credit for it, of course.
If you have any changes or additions to make or want made, email me at dentar@dentar.com. All emails will be at least answered. Flames will be > /dev/null.
