Tengine.sh is a shell script designed as a basic quiz engine.
Tengine.sh offers functionality for two types of questions: multiple-choice and fill-in-the-blank. To install the script, all steps must be performed as root. After downloading and unpacking tengine.tar.gz, you'll find a directory structure consisting of bin, data, and var. You can browse the sample question directories contained in the data folder to see the four-question files available under each directory, namely .h, .q, .a, and .c.
The header file contains four lines formatted with different information for each question asked, namely the QUESTION ID, TYPE, DIFFICULTY, and CATEGORY. While the QUESTION ID can be anything you like, the TYPE can only be either MULTI for multiple choice or BLANK for fill-in-the-blank. DIFFICULTY is not presently used but reserved for future development. Finally, CATEGORY displays the question category to the user.
The question file contains the actual question asked, while the answer file lists the possible answers, only relevant for multi-choice questions. Lastly, the correct answer is compared to the user's input, which is found in the correct answer file. It's essential to note that the script is designed for use as a login shell, and the results are deposited in a file under /usr/local/tengine/var/tmp.
When invoking the tengine.sh script, the user must provide their full name, which generates a results file under the /usr/local/tengine/var/tmp directory. The format for each question line in the results file is correct_answer - answer_given. The script performs better when there's a considerable pool of questions to choose from. If you plan to use the script as a login shell, uncomment the NUM_TO_ASK value and set it to a value less than or equal to the number of questions under the data directory tree. Finally, if you leave the variable commented out, the user will be prompted for the number of questions to attempt.