Creating a multiple choice test

D

DPete14

I would like to create a multiple-choice test that the user can fill out and
then have the anwers result at the end (e.g., 88 out of 100 correct). Some
of the questions would need to have multiple correct answers (e.g., "Which
THREE are correct?"). Can somebody help me set this up, or is there a
better way/program to do this?

Thanks for any and all help.
 
G

Graham Mayor

If you use an on-line form format with checkbox fields for the possible
answers, and a text form field for the result, you could run a macro on
entry to the score text field (or probably better still from a toolbar
button) to evaluate the answers and total the result.

In the following macro example, assume two questions each with four possible
choices. The first question has check boxes 1-4 and the second 5-8. The
macro increments the score if the answers for question 1 are 1, 3 & 4 and
for question 2 5 & 7. The results are placed in a text form field - here
Text1

You could expand this to encompass all yoyr questions and possible answers.
the only thing to watch is the checkbox field bookmark names or it could all
run away from you. Instead of the default Check1 etc, use more meaningful
names such as Q1A Q1B Q1C Q1D Q2A Q2B etc.


Sub Score()
Dim Count As Variant
Count = 0
With ActiveDocument
If .FormFields("Check1").CheckBox.Value = True _
And .FormFields("Check3").CheckBox.Value = True _
And .FormFields("Check4").CheckBox.Value = True Then
Count = Count + 1
End If
If .FormFields("Check5").CheckBox.Value = True _
And .FormFields("Check7").CheckBox.Value = True Then
Count = Count + 1
End If
.FormFields("Text1").Result = Count
End With
End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top