View Single Post
  #6   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default change test questions to reverse order

Probably makes marking the results harder than doing the testg

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"John McGhie [MVP - Word and Word Macintosh]" wrote in
message ...
Hi Doug:

Oi!!! You're hurting my sales :-)

That's very neat... And very eloquent :-)

Cheers

On 27/8/06 4:32 PM, in article ,
"Doug
Robbins - Word MVP" wrote:

Here is a macro that will put the questions into a different random order
for each student:

Dim i As Integer, j As Integer, k As Integer, Source As Document, Target
As
Document, students As Integer

Dim Message, Title, question As Range

Message = "Enter number of students" ' Set prompt.

Title = "Randomizer" ' Set title.

' Display message, title

students = InputBox(Message, Title)



For k = 1 To students

Set Source = Documents.Open("E:\Worddocs\source1.doc")

Set Target = Documents.Add

For i = 100 To 0 Step -1

j = Int((i * Rnd) + 1)

Set question = Source.Paragraphs(j).Range

Target.Range.InsertAfter question

question.Delete

Next i

' Print and Close Document with random list of questions

Target.PrintOut

' Target.SaveAs ("E:\worddocs\student" & k & ".doc")

Target.Close SaveChanges:=wdDoNotSaveChanges

Source.Close SaveChanges:=wdDoNotSaveChanges

Next k


--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410