A multiple-choice exercise usually consists of single
answers. This can done using radio buttons. Another type of multiple-choice
application can be made of single and multiple answers. In such a program, the
user can be presented with two types of questions, some requiring one
answer out of many options, and some others allowing the user to select more
than one answer. When creating the application, you must find a way to alternate
the questions. Furthermore, you may want to randomly present the questions.
There are different ways you can do this.
Practical Learning: Creating a Multiple-Choice Test
|
|
- Start Microsoft Visual C# and create a Windows Application named CSharpKnowledge1
- Design the form as follows:
 |
Control |
Text |
Name |
Additional Properties |
Label |
Number of Questions: |
|
|
NumericUpDown |
|
nudQuestions |
Maximum: 20
Value: 5 |
Button |
Start |
btnStart |
|
Button |
Close |
btnClose |
|
|
- Save all
Single and Multi-Answer Questions |
|
If you want to create a multiple-choice application, you
must find a way to alternate questions. There are various ways you can do this.
You can create a series of radio buttons and check boxes. Then, when asking a
question that expects a single answer, you can present only the radio buttons.
When a question expects more than one answer, you can present the check boxes.
Because of the way controls are built, you can use group boxes to group controls
so that, when a series of controls is needed, you can display its corresponding
group of questions and hide the other group box.
|
|