How to create a quiz in access?

Declan

Registered User.
Local time
Today, 16:20
Joined
Jan 17, 2016
Messages
38
Hi all,

Firstly, I know that there are other options that may be slightly easier, however the quiz is only part of my access project and so I wish to keep it IN ACCESS, so don't worry about suggesting alternatives.

Secondly, I put this in forms as I want the end quiz to be in a form for the user. Would I use 'Option Button' for each quiz option, if so how do I link them to the quiz, etc etc.

Thirdly, I do not currently have any tables or stuff relating to the quiz set up in the slightest, but the following details are what I currently wish to have.

I assumed I would have to do the following after trying to research it a tad (However it didn't really help much):

tbl_Quiz1 (Same layout for each separate quiz)
QuestionID (Auto-number, PK)
Question
Answer
UserAnswer

I'm under the idea that the database would go through the questions (in order, no need for a randomizer) and the user would click one of the four options. It would be a multiple choice quiz, only one answer being correct. The system would somehow check the UserAnswer against the Answer and do something, I don't know how the rest works.

What I want is after however many questions, the user would click complete or something, and then the database would calculate the percentage correct. If over 80% correct then they will be transported to another form where they enter their first name and surname into a box, which well then place that name onto a certificate I designed. (I was told to use a report and query for this? However I also have no clue at all about this aspect). If under 80%, they would move to a different form (the forms act as 'pages' which will allow them to quit or retry.

At the minute I'm using buttons, which when clicked runs a macro to close one form and open another. This method is fine for me, I just don't know how to sum the percentage, and then make the database direct the user towards a certain page depending on the score. I need help with coding for that too, if possible. For reference, the form names and such might be:

Forms:
Frm_QuizQuestion1 (2, 3, etc, although If I wanted to show one question at a time, would I have to create a separate form with a question on each, or is there an alternative method?)
Frm_UnsuccessfulCompletion
Frm_SuccessfulCompletetion (/Detail Entry for certificate)

Reports:
Rpt_Quiz1Certificate


Many thanks,
Daniel
 
As a general principle, only use one form.

How do I make the form display questions individually from a table? And how do I get the table to record the answers the user gives?
 
Will you want to store the user's answers?

Yes.

tbl_Quiz
QuestionID (Auto-number, PK)
Question
Answer
UserAnswer

I was told to have a table that it can store them, so I made that above. I don't know if that's how it should work or what, but yes, I do.

Well, only store until the end of the quiz, then it would calculate how many the user got correct and bring the user to a different form depending if they reached a certain score.
 
My question was if you wanted to store the users' answers. For clarity I meant all users, many users. However from your answer I understand that you only want to store the one time answers, for one use, a one time use, and then calculate on those answers. The answers would then be deleted providing an empty slot ready to store the answers of the next user. Does that sound about right?



That's it, yes. You grasped the concept perfectly. Calculations made and then appropriate macros bringing users to the correct forms depending on their score.


The only storage in any sense round be via a table that I wish to automatically update once the user has completed a quiz successfully. I have a table which each quiz, and a user table with a space to put completed quizzes, however unsure on the vba needed to link the two..
 
My project is about a training program. There's about 8 quizzes.

I've made forms which they choose which quiz through,and currently have s blank form for each quiz. (So 8 blank forms)

I was just going to take the advice you gave for one quiz and replicate it 7 more times.
 
There will be no need, it will only need to be stored temporarily. So that's no issue. :)
 
Questions will be a question that only has one correct answer. There will be four possible answers for the user to choose from, the method of choosing would be clicking an ‘option button’ with the label describing the answer. One will be correct, three incorrect. I did it this way to attempt to make it easier for the system to check if the answer is correct, seeing if option button 3 is clicked, etc. Is that satisfactory explanation?
 
I have the first quiz's questions and answers.

What does your role focus on during work?
A. Customer Service. (Correct)
B. High Profits
C. Efficiency.
D. Productivity.


What does we aim to provide?
A. A service to help children, teens and adults to borrow books and access computers that otherwise may not be able to.
B. A service for adults to borrow books and access computers that otherwise may not be able to.
C. A free service to help all children, teens and adults to borrow books and access computers that otherwise may not be able to. (Correct)
D. A free service to help children, teens and parents to borrow books and access computers that otherwise may not be able to.

How much does the library cost at point of service?
A. A small charge for joining, but free thereafter.
B. Nothing, it's free. (Correct)
C. A regular monthly payment of £2.99.
D. A regular monthly payment of £5.99.

What system does the library use?
A. Norton 3.1
B. Galaxy. (Correct)
C. Galaxy 2.0
D. RFID.

It's the induction (Hence why it's basic and so few questions), and there's a few form beforehand explaining the answers, the quiz comes at the end of the 'learning' forms to make sure they've read it all, etc.
 
There should never be more than 5 questions per quiz. :)
 
What you need to do is create a table for your questions, just two Fields, basically it will be an ID field "QuestionID" and a text field "QuestionText". Next you need to create the "answers table". Now the answers table is going to drive a subform on a main form so it has to have a particular structure. Call it "tblAnswer" and give it 5 fields:- AnswerID (long), QuestionID (Long), AnswerText (Short Text), AnswerIsCorrect (Boolean), AnswerAnswer (Boolean). Now create a form based on the question table this should just show two Fields. Next, create a form based on the answers table, and have this answers form in datasheet view. Drag the answers form on to the question form and they will link themselves together. You should now have the essence of what you want however there's a lot more to do yet!

Boolean? That isn't an option here. I'm using Access 2016, if that helps.

I shall start working on everything else now.
 
Thank you. And when you say 'Long', are you reffering to Long Text, regarding AnswerID and QuestionID's datatypes?

In tblQuestion, QuestionID was automatically set to autonumber, hence the ID. The same is for my AnswerID within tblAnswer. Do all of these need to be set to autonumber or long text? And I assume questionID in tblAnswer will be exactly the same as whatever questionID is in tblQuestion, being a foreign key?
 
The answers form, is that showing all fields?

I created both forms using form wizard, basing it off the tables. What do you mean datasheet view? I can put the original answers table in datasheet view, but not the form. The tbl_answers based form had only viewing options of 'form','layout' and 'design'.

When you say drag, what do you mean? I've tried literally clicking and holding the forms on the 'all acess objects' sidebar to ontop of the other, but it doesn't do anything. I've tried dragging the 'tab' that seperates each item open on the database, but again, to no avail.

(sorry for the huge number of questions!)
 
Ah.. There's autonumber or number. It's fieldsize allows me to choose long integer. It only allows one autonumber field per table however, so I've had to put questionID as number within tbl_Questions. Is that okay? Or..?

The answers form, is that showing all fields?

I created both forms using form wizard, basing it off the tables. What do you mean datasheet view? I can put the original answers table in datasheet view, but not the form. The tbl_answers based form had only viewing options of 'form','layout' and 'design'.

When you say drag, what do you mean? I've tried literally clicking and holding the forms on the 'all acess objects' sidebar to ontop of the other, but it doesn't do anything. I've tried dragging the 'tab' that seperates each item open on the database, but again, to no avail.

(sorry for the huge number of questions!)
 
Thank you for your video, that explained it well, aha. (Probably gonna sound creepy, but your voice is really nice to listen to. :D)

Okay. The answers form is now on the main questions form. How do I do from there?

I can't put questionsID within tblAnswers as a Autonumber, it says I can only have one per table. Would it work if I made a relationship between the questionsID in tblquestions and questionsID in tblanswers?


P.S.
Sorry for late reply in doing this, I'm back for the count now!
 
Oh, is there a way to check they're connected?

And eh, I could but that wasn't tooo bad. :D
 
I just wanted to make sure is all, if something can go wrong, it will.

Don't worry. So how should I go from here?
 
I have no clue on coding or queries.. Do you recommend any sites or know of anything that can help? :/
 

Users who are viewing this thread

Back
Top Bottom