Results 1 to 11 of 11

Thread: Really need help to figure how to finish my project

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2015
    Posts
    16

    Exclamation 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

  2. #2
    Hyperactive Member Frabulator's Avatar
    Join Date
    Jan 2015
    Location
    USA
    Posts
    409

    Re: Really need help to figure how to finish my project

    Quote Originally Posted by Mat97 View Post
    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:
    1. Public Sub IfStatement()
    2.         If TextBox1.Text = StringName1 Then
    3.             TextBox2.Text = StringName2
    4.         End If
    5.     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
    Oops, There it goes. Yep... my brain stopped...
    _________________________________

    Useful Things:

    How to link your VB.Net application to Excel

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2015
    Posts
    16

    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

  4. #4
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Really need help to figure how to finish my project

    Quote Originally Posted by Mat97 View Post
    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

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2015
    Posts
    16

    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

  6. #6
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    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

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Apr 2015
    Posts
    16

    Re: Really need help to figure how to finish my project

    No Visual Basic 2012

  8. #8
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    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

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Apr 2015
    Posts
    16

    Re: Really need help to figure how to finish my project

    I'll post it

  10. #10

    Thread Starter
    Junior Member
    Join Date
    Apr 2015
    Posts
    16

    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))

  11. #11

    Thread Starter
    Junior Member
    Join Date
    Apr 2015
    Posts
    16

    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
  •  



Click Here to Expand Forum to Full Width