Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# GemQuiz | ||
Quiz program in Ruby | ||
Uses Tk | ||
|
||
I made this small program when I was playing with Ruby and Tk. You'll need Tk installed in order to get the GUI. | ||
The program is a very primitive quiz type of a program. When the program starts, click on **File | Open** and select a text file with the questions and answers. A sample quiz with 5 questions is provided (test.txt). | ||
At the end you'll get how many questions you guessed correctly and the percentage overall. | ||
|
||
![GemQuiz](gemquiz.png) | ||
|
||
The quiz has to be in the following format, no blank lines are allowed | ||
|
||
Question number | ||
Question text (one continuous line, the program takes care of the wrapping) | ||
Four possible answers, each line starts with A., B., C. and D. | ||
Answer(s) line that starts with the words "Answer: " (no quotes) and the correct answer | ||
The program takes care of single/multiple choice answer widgets | ||
|
||
e.g. | ||
|
||
Q1. | ||
Leveraged loans are loans provided to companies that already have a significant amount of outstanding debt. | ||
As a banker, how might you compare a leveraged loan to other loans in your portfolio? | ||
A. Higher risk to the lender but less costly to the borrower. | ||
B. Lower risk to the lender and less costly to the borrower. | ||
C. Lower risk to the lender but more costly to the borrower. | ||
D. Higher risk to the lender and more costly to the borrower. | ||
Answer: D | ||
|
||
This example will create a quiz with 4 radio buttons. If the answer line was Answer: B,C then the program will show four check buttons instead. | ||
|
||
**NOTE:** The question in this example is two lines. In the file, it should be one continuous line | ||
|
||
**NOTE:** Do not leave ANY blank lines. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.