Simple Quiz program

Urgent help needed.

Page 1 of 1

8 Replies - 45334 Views - Last Post: 13 February 2007 - 12:56 PM Rate Topic: -----

#1 chazza07  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 12-January 07

Simple Quiz program

Posted 12 January 2007 - 01:59 PM

Hi,

I've got an assignment from my tutor to create a simple quiz game with 6 questions. I'm really struggling with this, I like programing but I'm finding it hard. I have started on it, this is what I have so far (with the help of my friends)
I have the front page, and instructions page linked to the front page by a button, the 6 questions to display and 3 radio buttons as the answers. However I have no idea how to make it check if the answers are correct, or how to reset each question so the radio buttons are not checked.

I also have another form which I want to display after the last question is answered, on this form I want it to display the users score.

Can any body help me with this, even if it is just a little I'd be really grateful. I need to have it done or at least improved by Tuesday.
Thanks
Charlie

Is This A Good Question/Topic? 1

Replies To: Simple Quiz program

#2 KeyWiz  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 438
  • Joined: 26-October 06

Re: Simple Quiz program

Posted 12 January 2007 - 02:59 PM

if you create the radio buttons as an array you could use a Select Case routine to check which one is checked.

create an array for your questions and answers.

Dim Question(6,2) as String

Question(0,0) = "Are you a Human?"
Question(0,1) = "1"

etc.

This post has been edited by KeyWiz: 12 January 2007 - 02:59 PM

Was This Post Helpful? 1

#3 chazza07  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 12-January 07

Re: Simple Quiz program

Posted 13 January 2007 - 11:47 AM

[quote name='KeyWiz' date='12 Jan, 2007 - 02:59 PM' post='195658']
if you create the radio buttons as an array you could use a Select Case routine to check which one is checked.

create an array for your questions and answers.

Dim Question(6,2) as String

Question(0,0) = "Are you a Human?"
Question(0,1) = "1"



Hi, thanks for that.

Your gonna think I'm thick for asking this but, how do I create an array?

Would it help if I posted the code I have already scraped together.
Thanks again.
Was This Post Helpful? 0
  • +
  • -

#4 KeyWiz  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 438
  • Joined: 26-October 06

Re: Simple Quiz program

Posted 13 January 2007 - 11:53 AM

read this article http://www.dreaminco...wtopic20197.htm

and download and look at this code

http://www.dreaminco.../snippet643.htm

This post has been edited by KeyWiz: 13 January 2007 - 11:55 AM

Was This Post Helpful? 0
  • +
  • -

#5 chazza07  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 12-January 07

Re: Simple Quiz program

Posted 13 January 2007 - 04:05 PM

Hi, me again

I've done an array (thanks for that info btw), however I'm puzzled by the select case bit now.

After this it should be finished, I just need to make it calculate the users score at the end by adding up each question, this is the bit I'm really struggling with. Will the select case do this for me?

Thanks

Any helped greatly received.
Was This Post Helpful? 0
  • +
  • -

#6 KeyWiz  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 438
  • Joined: 26-October 06

Re: Simple Quiz program

Posted 13 January 2007 - 10:20 PM

Select-Case was designed to do away with the need to compare one term to many options. For instance here is a series of If-Then statements:
If a = 1 Then b = a+1
If a = 2 Then b = a+9
If a = 3 Then b = a+5
If a = 4 Then b = a+7
If a = 5 or a = 6 or a = 7 Then b = a+3
If a = 8 or a = 9 Then b = a+5



Now, this is fine and works perfectly, but extend it and you can see that this would take a lot of processing time to execute.
So Select-Case was created to speed it up, here is the same code as above, but in Select-Case
Select Case a
	Case = 1
		b=a+1
	Case = 2 
		b = a+9
	Case = 3 
		b = a+5
	Case = 4
		b = a+7
	Case = 5, 6, 7
		b = a+3
	 Case = 8, 9 
		b = a+5
End Select



The BIG difference, besides cutting down on typing, is the Select Case will automatically jump past all non-matching cases and is much faster than the If-Then series.
Was This Post Helpful? 0
  • +
  • -

#7 chazza07  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 12-January 07

Re: Simple Quiz program

Posted 19 January 2007 - 01:14 PM

Thanks, I've done all the code now.

Thanks for all your help.


Do you know how I can create test data for my program, I have been asked to do this but I'm not sure how.
Was This Post Helpful? 0
  • +
  • -

#8 KeyWiz  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 8
  • View blog
  • Posts: 438
  • Joined: 26-October 06

Re: Simple Quiz program

Posted 19 January 2007 - 06:07 PM

View Postchazza07, on 19 Jan, 2007 - 01:14 PM, said:

Thanks, I've done all the code now.

Thanks for all your help.


Do you know how I can create test data for my program, I have been asked to do this but I'm not sure how.


you simply input the KIND of data called for, make it up.
Was This Post Helpful? 0
  • +
  • -

#9 law  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 13-February 07

Re: Simple Quiz program

Posted 13 February 2007 - 12:56 PM

Is there any chance you could show me your code, i have done my array and have started my select case but really stuck thanks laura
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1