How to create a quiz in access? (1 Viewer)

Declan

Registered User.
Local time
Today, 08:56
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
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
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?)

As a general principle, only use one form.
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
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?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
Will you want to store the user's answers?
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
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.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
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?
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
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..
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
>>> I have a table which each quiz, <<<<

I got the impression there was only one quiz? Now it looks like you want to cater for multiple quizzes please clarify
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
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.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
I'm beginning to see a structure that that should be suitable for your quiz. I'm a bit apprehensive because I read somewhere that quizzes are notoriously difficult to construct in a database. Not having done one myself I'm not 100% sure if this is the truth or an old wives tale. I get the impression that you do not want to store the answers the user provides for any length of time. As soon as the student has got their diploma, then you will delete their answers and allow the database to be used by another student.

Now this is important for you to answer because there's a fork in the road so to speak. If we go one way, storing the answers temporarily, then you won't be able to change it later to store all of the uses answers.

It's like when someone builds a boat in their basement, they finish building the boat and then they realise that there's no way to get the boat out of the basement without lifting the house off to remove the boat. A lot of time trouble and expense you don't really want to be lumbered with. The person building the boat should have chosen a different location.

This is the case for this decision, if you choose the temporary storage method then you will have to redesign the database from scratch if you decide to change it later.
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
There will be no need, it will only need to be stored temporarily. So that's no issue. :)
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
Can you describe the structure of your questions/answers?
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
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?
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
Do you have a list of questions and answers, the correct answer and the three incorrect answers?
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
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.
 

Declan

Registered User.
Local time
Today, 08:56
Joined
Jan 17, 2016
Messages
38
There should never be more than 5 questions per quiz. :)
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 08:56
Joined
Jul 9, 2003
Messages
16,282
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!
 

Users who are viewing this thread

Top Bottom