Generating Multiple Choice Tests

  • Thread starter Thread starter karst
  • Start date Start date
K

karst

I currently use Access 2003 to create tests. I am looking to use a grouping
and random sampling method to improve efficiency. In as much that I use
access to create tests now, is VBA an appropriate platform for randomizing
and group sampling or should I go to an independent language. Any advice
will be greatly appreciated.
 
karst,

******UNTESTED...

Something like...

SELECT TOP 1 Rnd([TestID]) AS Expr1, TestText
FROM tblTests
ORDER BY Rnd([TestID])

--
Gina Whipp
2010 Microsoft MVP (Access)

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm

I currently use Access 2003 to create tests. I am looking to use a grouping
and random sampling method to improve efficiency. In as much that I use
access to create tests now, is VBA an appropriate platform for randomizing
and group sampling or should I go to an independent language. Any advice
will be greatly appreciated.
 
I currently use Access 2003 to create tests. I am looking to use a grouping
and random sampling method to improve efficiency. In as much that I use
access to create tests now, is VBA an appropriate platform for randomizing
and group sampling or should I go to an independent language. Any advice
will be greatly appreciated.

You can get a pseudorandom subset of the records in a table using the Top
Values property of a query, with help from a little VBA. Put this little
function into a Module:

Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function

Then add a calculated field to your Query by typing

Shuffle: RndNum([fieldname])

in a vacant Field cell, where [fieldname] is any field in
your table - this forces Access to give a different random
number for each record.

Sort the query by Shuffle, and set its Top Values property
to the number of records you want to see.
 
Thank you so much for your help - I will experiment with this to modify my
current generator.
--
mhm


John W. Vinson said:
I currently use Access 2003 to create tests. I am looking to use a grouping
and random sampling method to improve efficiency. In as much that I use
access to create tests now, is VBA an appropriate platform for randomizing
and group sampling or should I go to an independent language. Any advice
will be greatly appreciated.

You can get a pseudorandom subset of the records in a table using the Top
Values property of a query, with help from a little VBA. Put this little
function into a Module:

Public Function RndNum(vIgnore As Variant) As Double
Static bRnd As Boolean
If Not bRnd Then
'Initialize the random number generator once only
bRnd = True
Randomize
End If
RndNum = Rnd()
End Function

Then add a calculated field to your Query by typing

Shuffle: RndNum([fieldname])

in a vacant Field cell, where [fieldname] is any field in
your table - this forces Access to give a different random
number for each record.

Sort the query by Shuffle, and set its Top Values property
to the number of records you want to see.
 
Thank you fjor all your help - I will begin to incorporate information from
both these replies.
 
Back
Top