Thursday
The Matrix Quiz.
MatrixQuizZip.zip (images, text file and exe)
Questions and answers taken from
http://www.triv.net/html/Users6/u15218.shtml
- Design a form like that shown above:
- upper left, a label for the question
- lower left, a panel with four radiobuttons for the possible answers
- upper right, a picturebox
- middle right, two buttons, one to check answers, one to proceed to the next question
- lower right, a label for the results
- In the Form's Load method, read the Matrix Quiz file which you have placed in the
bin folder of the project.
- Read and parse the file based on lines, place these in an array (declared at
the class level, i.e. at the top).
- Shuffle the lines so that they are in random order. We will proceed
through them one by one, thus we will need a counter (as in Art Slide Show).
- Load the first matrix image file into the picturebox.
- When the Next button (which initially says "Start Quiz") is clicked,
- Take the current line under consideration and parse it on a "/". The first token
is the question, the second token in the correct answer, and the third token is a
comma-separated string of possible answers.
- Parse the comma-separated string of possible answers on a comma to obtain
an array of possible answers, shuffle them, load them into the radiobuttons.
- Make sure none of the radiobuttons are selected by setting their Checked
property to False.
- If it is not the first time the button is being clicked, display the number
of correct answers and the number of questions asked so far.
- Disable the Next button and Enable the Check button.
- If you are out of questions, then disable the Check button as well.
- Increment your counter and change the picture. There are more questions
than pictures, so the pictures have to be cycled around.
- When the Check button is clicked,
- Enable the next button and disable the check button.
- Compare the user's guess as indicated by the radiobuttons, to the correct
answer. If they match, display a "Correct" message. If they don't match, display an "Incorrect" message and tell the user the correct answer.
- Keep track of the number of correct answers.