Nikki said:
But that is still time consuming. I'm looking for a way to randomly scramble
all of them (sometimes 50 questions and the respective answers) at one shot.
This seems to work on Word's outline. (Word2000)
I assumed four answers per question.
The randomization isn't always effective, but running multiple times
seems to do the trick.
Sub RandomizeAnswers()
'Randomizes multiple choise questions in outline format.
'Case statements from Klaus Linke in a NG message dated Feb 19 2002.
'By David Sisson May 2005
Dim tPara, NumAns, PickValue As Long
Dim A As Integer
tPara = ActiveDocument.Paragraphs.Count
NumAns = 4 'Can be changed to 3, but not tested
For A = tPara To 1 Step -1
With ActiveDocument.Paragraphs(A)
Select Case .Range.ListFormat.ListType
Case wdListNoNumbering
'MsgBox "no numbering"
Case wdListBullet
'MsgBox "Bullet"
Case wdListSimpleNumbering
'MsgBox "Simple numbering"
PickValue = Int((NumAns * Rnd) + 1)
Counter = Counter + 1 'Keeps movement of answers inside Question
Select Case Counter
Case 1
'.Range.Relocate wdRelocateUp
Case 2
.Range.Relocate wdRelocateUp
If PickValue Mod 2 = 0 Then
.Range.Relocate wdRelocateUp
End If
Case 3
.Range.Relocate wdRelocateDown
If Counter >= NumAns Then Counter = 0
Case 4
.Range.Relocate wdRelocateDown
If PickValue Mod 2 = 1 Then
.Range.Relocate wdRelocateDown
End If
If Counter >= NumAns Then Counter = 0
End Select
Case wdListOutlineNumbering
'MsgBox "Outline numbering"
Case wdListListNumOnly
'MsgBox "LISTNUM field"
Case wdListMixedNumbering
'MsgBox "Mixed numbering"
Case Else
'MsgBox "Unknown constant"
End Select
End With
Next A
End Sub
Sub PrintAnswerKey()
'Add hidden text to indicate correct answer and run this sub.
'This way, no matter how the answers get rearranged, you'll
'always be able to print a key.
A = MsgBox("Print Answer Key", vbYesNo, "Select Yes/No")
If A = 6 Then
Options.PrintHiddenText = True
ActiveDocument.PrintOut
Options.PrintHiddenText = False
End If
End Sub