Jan 18 2004, 06:11 PM
Hi. I'm relatively new at Access programming, so please bear with me...
I'm trying to design a multiple choice test with random selection of questions and random sorting of answers. I've got the "random" part down on both counts, but I'm stuck trying to store a user's selected answer. I originally planned an append query that added each wrong answer to a "Wrong Answers" table as the user made each selection. However, I would prefer to allow the user to scroll back and forth through the test form and change their answers as necessary. I'm using a list box for answer selection, but I'm running into two problems:
1. Where do I store the selected entry? Do I need some kind of temporary table that stores the random questions and selected answers for later scoring?
2. Clicking on my list box doesn't select anything. I assume this problem is related to the first.
I've attached a copy of my DB in case my rambling explanation needs further clarification...
Thanks in advance.
Jan 18 2004, 07:05 PM
To create a multiple choice test, create your question table like so...
-IllustrationKey (Question Illustration filename)
-IllustrationPath (Path to locate illustrations)
Then, you're actual test is generated randomly and placed into a table like below.
-MyAnswer -The user's answer is inserted here
-MarkForReview Yes/No - Does the user want to return to review this question?
-QuestionAnswered Yes/No - Has the user attempted to answer this one, yet?
Join the two tables on the QuestionNumber and insert the user's answer into the MyAnswer field. Note: If you have several different sections of questions, use both the SectionNumber and the Question number as the unique index. Mark the answer correct (true) or incorrect(false) and you've got all of his answers and scores available.
Generate your random text and insert those question numbers in the Random test table. When an answer is correct, set its QuestionCorrect field to true. When the test is done, you can dump the results of the Random Test into a storage table that will display the questions that were answered correctly, incorrectly and (if you so desire, Marked for Review).
So, while you do append the test into an ExamHistory table, you don't need to store just the wrong answers. In this way, your users can go back and review every question, or change the answers on the questions marked False in the QuestionCorrect field.
Does this help?
Jan 18 2004, 07:15 PM
Wow! It'll take me a while to digest all that, but I think you've solved my problem. Thanks for your help.
Jan 18 2004, 07:28 PM
Actually, here's an example for you. This is a brief Coast Guard Marine Engineer's test. I built a complete version in Visual Basic, but this was a kind of prototype. I haven't included any of the random test generation code, but it sounds like you've got a handle on that. You'll see that the structure is really quite simple. This may give you more ideas, too.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here