![]() |
|
![]() | ||
|
Subject:
Micorsft Access programming database for multiple choice questions and exams
Category: Computers > Software Asked by: andrewp2003-ga List Price: $10.00 |
Posted:
02 Oct 2004 12:22 PDT
Expires: 01 Nov 2004 11:22 PST Question ID: 409385 |
I have designed an Access 2000 database to store multiple choice questions and answers which are stored within one table. Each question has five possible answers, and these are stored in a table along with the question and answers for the distractors (other possible answers but not correct ones). I can make a nice report that prints out the questions, but this always gives the correct answer as option A. Making it easy for a student to quickly work out that the first answer is always the right one. I have done some VBA programming before but very crudely as I am not a real programmer. I think this requires using some sort of random function and then putting it into a form or report but I don't know how to do that! (i) How can I randomly select questions from the database, say perhaps 50 from a possible 200; and, (ii) then produce a report that will randomly place the correct answer amongst the incorrect ones so that I could print it out on paper for a student exam? | |
| |
| |
|
![]() | ||
|
There is no answer at this time. |
![]() | ||
|
Subject:
Re: Micorsft Access programming database for multiple choice questions and exams
From: dreamboat-ga on 02 Oct 2004 20:00 PDT |
Hi, Andrew. answerguru is right, unfortunately. However, you could do a dirty little workaround. Throw your data out to Excel. Add a column and put an X next to the correct answer. Use =rand() to sort the answers and distractors in a random order. (Note there may be a bug if you have 2003: http://www.pcmag.com/article2/0,1759,1544551,00.asp) Then import the data back into Access and run a report. If you constantly need new random order of distractors, then yes, VBA is your answer. Or perhaps you can just use this? http://support.microsoft.com/?kbid=208855 Good luck to you! (I hate Access. I am an Excel and Word geek. But I was involved in the development of about a half-dozen tests for www.Brainbench.com, and we do them in Access databases.) |
Subject:
Re: Micorsft Access programming database for multiple choice questions and exams
From: sebastienm-ga on 09 Oct 2004 23:09 PDT |
Hi, I have done sampling in Access using some very easy vba function for dealing with Randomness. I'll try to describe as much as i can here... last time i used it was years ago. To Return 50 Random Rows: -------------------------- 1. The Rnd() function returns a random number. 2. Create a query like: SELECT Rnd() AS F3, Table1.field1 FROM Table1 The second field will be a random number. However, since the function does not have parameter, vba thinks that nothing changes, so it is constant, that is 'no need to call the function for every record'. As a result, the same number appear on each row. 3. To bypass the above problem, in a vba module add the function: Public Function MyRnd(Val1 As Variant) As Double MyRnd = Rnd() End Function Now try : SELECT MyRnd([Field1]) AS F3, Table1.field1 FROM Table1 Sort MyRnd() Descending With Properties (menu View > Properties) TopValue : 50 Run the query and you can see it returns only 50 records based on the Descending random number. 4. One thing about the above function is that it the Val1 parameter is not used. If we had defined MyRnd as ...MyRnd() As.... Since it has no parameter, as with the Rnd() it would not be called for each record. Adding a parameter makes vba call the function because a parameter means the function varies.... or something like that. ANYWAY, this should take 2 minutes to implement. I haven't given a thought for mixing the 'questions' order within a record yet. I hope this helps, Regards, Sebastien |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
Search Google Answers for |
Google Home - Answers FAQ - Terms of Service - Privacy Policy |