|
-
Sep 16th, 2000, 07:50 PM
#1
Hello. I am taking a vb course in school this year. Our first assignment is to create a program that is a quiz consisting of 5 questions, with each question being 1 form. Very simple. Here is my situation. I have a question, and four (4) command buttons. This is what i want to happen: If the person clicks on the correct button, i want the next question to pop up (on the next form). I would also like to make a report at the end telling them what they got right. I thought I could just print a message to another form by doing this:
form1.hide
form6.show
print "you got question 1 right"
form6.hide
form2.show
Where form1 is question 1, form6 is the report, and form2 is question 2. However, I can't seem to do it. If you have a solution, or think you might and are just confused, e-mail me (preffered)or post here as soon as you can. Thanks.
-Steve
[Edited by sdennett on 09-16-2000 at 08:52 PM]
-
Sep 16th, 2000, 08:01 PM
#2
Hyperactive Member
i'd use a module to store weather the person got each question right.
kind of like:
Code:
'in a module
Dim Question1 as Booleen
'and the same with each
Public Function HoldQuestion1(Question1Answer as Booleen)
'to store data in this put HoldQuestion1() on the form that askes the question and put true or false in the brackets depending on if they got the question right
Question1 = Question1Answer
end function
'and the same with each
Public Function Results(Result as Booleen)
If Result = "Q1"
then Results = Question1
end if
and again do this for each
when you want to find out if a person got a question right or wrong do:
Code:
Results() 'put the fixed value ("Q1" for example) in the brackets
'so to get results for question 1 do:
x = Results("Q1")
'x now has true or false weather the question is right or wrong.
hope this helps
(and you can unload the form when its done if you want
[Edited by HAVocINCARNATE29 on 09-16-2000 at 09:03 PM]
-
Sep 16th, 2000, 08:14 PM
#3
ummmm. Im extremely new. this is really confusing to me. Any other solutions?
-Steve
-
Sep 16th, 2000, 08:22 PM
#4
Hyperactive Member
give me a second and i'll make a working project you can look at and see what i mean...
-
Sep 16th, 2000, 08:39 PM
#5
Hyperactive Member
i made the project.
whats your email addy?
-
Sep 16th, 2000, 09:02 PM
#6
Conquistador
you could have the code change a label on form6, depending on whether they got it right.
-
Sep 17th, 2000, 01:27 PM
#7
Thank you to both of you. I made the app by changing a label. It turned out great!
-Steve
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|