View Single Post
  #2  
Old June 22nd, 2006, 09:40 AM posted to microsoft.public.access.tablesdbdesign
external usenet poster
 
Posts: n/a
Default Teat and Answer random Generator

First a couple of pedantic observations:

The "best" will always be a matter of opinion or agreeing to criteria
and then measuring... I'll propose part of one method below.

Your word "previous" leaves the world hanging awaiting the revelation
of the benchmark. Previous what? When? Do you mean that you want to
keep a record of what you did last time and then make sure you do
something different this time? Are you running your tests off in
batches - generating the tests and then making sufficient copies for
everyone or, as my daughter said she would like - run a different
sequence of tests for each student, printing the student's name on the
test paper so that copying or sharing results in exam conditions would
be unlikely.

The magic solution is to use a STATIC function procedure in a standard
module and call it repeatedly from a query. All required arguments
are passed into the function procedure at each call. You can refer
back to values on the form you used to launch the Report or Query in
the function call. Upon entry, the query will test a "BeenHereBefore"
flag. If it is false, as it will be on the first time through, then
do the initialization such as setting up your selection mechanism and
the random number. On subsequent calls, "BeenHereBefore" will be true
and the procedure runs the iterative portion of the code as required.
Each time the function procedure returns it has set itself to the
value of the selected record. That's what that column of the query
will see..

The above is the core of a mechanism that will serve most cases. You
can surround the concept with other functionality to get the results
you want.

HTH
--
-Larry-
--

"76Jarhead" wrote in message
...
What would be the best method to produce a random question test

generator
using MS Access 2003? My problem is this...I ave a pool of

different tests
with many questions and answerssd but have no easy method of

generating a
test which is different from the previous to prevent cheating or

memorizing
the test for others.

Any suggestions would be appreciated.