Homework:
The MatrixTriviaQuiz.exe uses the images:
matrix0.jpg,
matrix1.jpg, matrix2.jpg,
matrix3.jpg, matrix4.jpg,
matrix5.jpg, matrix6.jpg,
matrix7.jpg, matrix8.jpg,
matrix9.jpg, matrix10.jpg,
and matrix11.jpg as well as
hhe quiz file: MatrixQuiz.txt
. 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/Debug 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.
- 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.
Due Dec. 6