A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Random test generator



 
 
Thread Tools Display Modes
  #1  
Old October 23rd, 2009, 05:31 AM posted to microsoft.public.access.tablesdbdesign
Billiam
external usenet poster
 
Posts: 174
Default Random test generator

Hi,
Can anyone reccomend a sample question and answer database example. My needs
a
Choose from a sample of 150 questions, multiple choice answer, to produce a
test of 50 questions (no duplicates) AND be able to 'mark" the test somehow?
I was thinking of using the electronic form method to send the test to be
filled in, and then data mined to be scored somehow?
Thanks,
Billiam
  #2  
Old October 23rd, 2009, 06:48 AM posted to microsoft.public.access.tablesdbdesign
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Random test generator

On Thu, 22 Oct 2009 21:31:02 -0700, Billiam
wrote:

Hi,
Can anyone reccomend a sample question and answer database example. My needs
a
Choose from a sample of 150 questions, multiple choice answer, to produce a
test of 50 questions (no duplicates) AND be able to 'mark" the test somehow?
I was thinking of using the electronic form method to send the test to be
filled in, and then data mined to be scored somehow?
Thanks,
Billiam


For part of the problem, You can use 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.

This will give you a random, nonrepeating subset of the questions, in an
editable query.
--

John W. Vinson [MVP]
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.