|
-
May 13th, 2015, 07:51 AM
#1
Thread Starter
Junior Member
Really need help to figure how to finish my project
Hi I've been trying to figure out a way to make my radiobuttons popping up at the same time that my question randomize I have no idea how to make the answers Pop up everytime I click new question I puted all my question and answers as string and I randomize it and the question is good but the answers that pops up are not the right one need help to figure out what can I do for the answers
-
May 13th, 2015, 08:02 AM
#2
Hyperactive Member
Re: Really need help to figure how to finish my project
 Originally Posted by Mat97
I puted all my question and answers as string and I randomize it and the question is good but the answers that pops up are not the right one need help to figure out what can I do for the answers
There are two answers that come to mind when I look at this. If you would like to do strings you could set up an If statement like so
(not tested code)
vb.net Code:
Public Sub IfStatement() If TextBox1.Text = StringName1 Then TextBox2.Text = StringName2 End If End Sub
or what you could do is have your questions saved in a datagridview with your answers on the next column. When a question is pulled from the question column, get that row number and display the same row from the answer column in the other textbox
-
May 13th, 2015, 08:30 AM
#3
Thread Starter
Junior Member
Re: Really need help to figure how to finish my project
I don't use public sub due to having 25 answers from ABCd and 25 questions my questions are randomize but by accident I randomize my answers now it's not piping up correctly to my programs
-
May 13th, 2015, 08:31 AM
#4
Re: Really need help to figure how to finish my project
 Originally Posted by Mat97
I don't use public sub due to having 25 answers from ABCd and 25 questions my questions are randomize but by accident I randomize my answers now it's not piping up correctly to my programs
It's going to be pretty difficult getting you good useful help without knowing what you are doing. Without that, any help is going to be based on speculation at best. Please code relevant code.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
May 13th, 2015, 08:33 AM
#5
Thread Starter
Junior Member
Re: Really need help to figure how to finish my project
So should I post my codes it's in French but you will c that it's easy to figure it out
-
May 13th, 2015, 08:39 AM
#6
Re: Really need help to figure how to finish my project
You code is actually in VB.net (I hope). Its just your variable names are in french, and what the variables names are, really doesn't matter much. And, yes, if you want some help, post the code. Please limit it to what you think is relevant however. There is typically no reason to post the entire project. If you don't post enough code, some one will ask for more.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
May 13th, 2015, 08:42 AM
#7
Thread Starter
Junior Member
Re: Really need help to figure how to finish my project
-
May 13th, 2015, 08:45 AM
#8
Re: Really need help to figure how to finish my project
Are you going to post code? If not, I'll move on to the next thread.
Process control doesn't give you good quality, it gives you consistent quality.
Good quality comes from consistently doing the right things.
Vague general questions have vague general answers. A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.
______________________________ Last edited by kebo : Now. Reason: superfluous typo's
-
May 13th, 2015, 08:46 AM
#9
Thread Starter
Junior Member
Re: Really need help to figure how to finish my project
-
May 13th, 2015, 08:53 AM
#10
Thread Starter
Junior Member
Re: Really need help to figure how to finish my project
Déclaration des Question de 1 à 25
strQuestion(0) = "En 2012 quel équipe de la LNH à gagner la Coupe Stanley" & strReponseA(0) = True & strReponseB(0) = True
strQuestion(1) = "Dans quelle province canadienne est situé le lac Nipissing?"
strQuestion(2) = "En 2015 qui est le meilleur pointeur de la LNH"
strQuestion(3) = "Quelle province est le plus important producteur de pâte à papier du Canada?"
strQuestion(4) = "Dans la LNH Qui les Meilleur pointeur dans l'histoire du hockey"
strQuestion(5) = "Quelle est la devise du Québec?"
strQuestion(6) = "Quelle ville en grèce que les olympique sont crée?"
strQuestion(7) = "Combien l`Académie française compte-t-elle de membres?"
strQuestion(8) = "Quel joueur de la LNH surnommait-on Mr. Hockey?"
strQuestion(9) = "Quel pays a occupé le Cambodge de 1979 à 1989?"
strQuestion(10) = "Quel est le plus long fleuve de la France?"
'Déclaration des réponse de A
strReponseA(0) = " A: Le Canadiens de Montrèal"
strReponseA(1) = " A: Québec "
strReponseA(2) = " A: Alexander Ovechkin"
strReponseA(3) = " A: La Nouvelle Écosse"
strReponseA(4) = " A: Bobby Orr"
strReponseA(5) = " A: Je me souvien"
strReponseA(6) = " A: Athènes"
strReponseA(7) = " A: 47 "
strReponseA(8) = " A: Patrick Roy"
strReponseA(9) = " A: Viet Nam"
strReponseA(10) = " A: Le Nil "
'Déclaration des réponse de B
strReponseB(0) = " B: Les Lightnings de Tampa Bay"
strReponseB(1) = " B: Alberta"
strReponseB(2) = " B: Jamie Benn"
strReponseB(3) = " B: Québec"
strReponseB(4) = " B: Wayne Gretzky"
strReponseB(5) = " B: The Sunshine State"
strReponseB(6) = " B: Olympia"
strReponseB(7) = " B: 87"
strReponseB(8) = " B: Gordie Howe"
strReponseB(9) = " B: Canada"
strReponseB(10) = " B: Le fleuve St-Laurent"
'Déclaration des réponse de C
strReponseC(0) = " C: les Red Wings de Détroit"
strReponseC(1) = " C: Manitoba"
strReponseC(2) = " C: Jonathan Toews"
strReponseC(3) = " C: Ontario"
strReponseC(4) = " C: Maurice Richard"
strReponseC(5) = " C: Yours to explore"
strReponseC(6) = " C: Lesbos"
strReponseC(7) = " C: 40"
strReponseC(8) = " C: Wayne Gretzky"
strReponseC(9) = " C: Japon "
strReponseC(10) = " C: Fleuve Congo"
'Déclaration des réponse de D
strReponseD(0) = " D: Les Maple Leafs de Toronto"
strReponseD(1) = " D: Ontario"
strReponseD(2) = " D: Dustin Brown"
strReponseD(3) = " D: Yukon"
strReponseD(4) = " D: Zdeno Chara"
strReponseD(5) = " D: The Garden state"
strReponseD(6) = " D: Sophia "
strReponseD(7) = " D: 97"
strReponseD(8) = " D: Maurice¸Richard"
strReponseD(9) = " D: La Chine"
strReponseD(10) = "D: Fleuve Russe"
'Randomize les question
Randomize()
intQuestion(0) = Int((10 - 1 + 1) * Rnd() + 1)
lblQuestion.Visible = True
lblQuestion.Text = strQuestion((0))
'Générer les question
If (intQuestion(0) < 8) Then
intQuestion(0) = Int((10 - 1 + 1) * Rnd() + 1)
lblQuestion.Visible = True
lblQuestion.Text = strQuestion(intQuestion(0))
Else
'Premiere Question
Randomize()
strQuestion(0) = Int((10 - 1 + 1) * Rnd() + 1)
lblQuestion.Visible = True
lblQuestion.Text = strQuestion((0))
'Deuxieme question
Do
Randomize()
intQuestion(1) = Int((10 - 1 + 1) * Rnd() + 1)
lblQuestion.Text = strQuestion((1))
Loop While (intQuestion(1) = intQuestion(0))
'Troisième question
Do
Randomize()
intQuestion(2) = Int((10 - 1 + 1) * Rnd() + 1)
lblQuestion.Text = strQuestion((2))
Loop While (intQuestion(2) = intQuestion(1)) Or (intQuestion(2) = intQuestion(1))
'Quatrième question
Do
Randomize()
intQuestion(3) = Int((10 - 1 + 1) * Rnd() + 1)
lblQuestion.Text = strQuestion((3))
Loop While (intQuestion(3) = intQuestion(0)) Or (intQuestion(3) = intQuestion(1)) Or (intQuestion(3) = intQuestion(2))
End If
Randomize la Réponse A
Randomize()
strReponseA(0) = Int((10 - 1 + 1) * Rnd() + 1)
rndOpt1.Visible = True
rndop2.Visible = True
rndOpt3.Visible = True
rndOpt4.Visible = True
rndOpt4.Visible = True
rndOpt1.Text = strReponseA(intReponse(0))
'Générer la Réponse A
If (intReponse(0) < 8) Then
Randomize()
intReponse(0) = Int((10 - 1 + 1) * Rnd() + 1)
rndOpt1.Visible = True
rndop2.Visible = True
rndOpt3.Visible = True
rndOpt4.Visible = True
rndOpt4.Visible = True
rndOpt1.Text = strReponseA(intReponse(0))
Else
'La premiere réponse a
Randomize()
intReponse(0) = Int((10 - 1 + 1) * Rnd() + 1)
rndOpt4.Visible = True
rndOpt1.Visible = True
rndop2.Visible = True
rndOpt3.Visible = True
rndOpt4.Visible = True
rndOpt4.Visible = True
rndOpt1.Text = strReponseA(intQuestion(0))
2ieme A
Do
Randomize()
intReponse(1) = Int((10 - 1 + 1) * Rnd() + 1)
Loop While (intReponse(1) = intReponse(0))
'3ieme A
Do
Randomize()
intReponse(2) = Int((10 - 1 + 1) * Rnd() + 1)
Loop While (intReponse(2) = intReponse(0)) Or (intReponse(2) = intReponse(1))
'4ieme A
Do
Randomize()
intReponse(3) = Int((10 - 1 + 1) * Rnd() + 1)
Loop While (intReponse(3) = intReponse(0)) Or (intReponse(3) = intReponse(1)) Or (intReponse(3) = intReponse(2))
End If
'Randomize la Réponse B
Randomize()
strReponseB(0) = Int((10 - 1 + 1) * Rnd() + 1)
rndop2.Visible = True
rndop2.Text = strReponseB(intReponse(0))
-
May 13th, 2015, 08:54 AM
#11
Thread Starter
Junior Member
Re: Really need help to figure how to finish my project
So reponse a is my answers that you can choose in the quiz and all the reponsea(0).tosting is my answers that will be put in the game
Tags for this Thread
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
|