Results 1 to 4 of 4

Thread: Quiz creation using Visual Studio 2015

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2017
    Posts
    1

    Quiz creation using Visual Studio 2015

    Hello

    I am currently studying IT in college, and am currently working on game design.

    First of, apologies if I have posted this in the wrong place, i just lack the knowledge of a function I need within my code an am wondering if I am in the right place to get the help I need?

    So, i am trying to get it so that when the user selects the correct answer, they will be forwarded to the next questions, whereas if they select the wrong answer they will be forwarded to a 'Incorrect answer' form. So far, i have my array of questions but that's about it - the last question i inputted to the array is constantly on display within my form, so i need to get it so the first question is on display and gradually progress through the next questions if the previous questions are answered correctly.

    I have probably explained this awfully - but any reply or help will be appreciated!

    Thanks

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,344

    Re: Quiz creation using Visual Studio 2015

    The function you're looking for is called an If statement.

  3. #3
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,479

    Re: Quiz creation using Visual Studio 2015

    Quote Originally Posted by Spudd98 View Post
    Hello

    I am currently studying IT in college, and am currently working on game design.

    First of, apologies if I have posted this in the wrong place, i just lack the knowledge of a function I need within my code an am wondering if I am in the right place to get the help I need?

    So, i am trying to get it so that when the user selects the correct answer, they will be forwarded to the next questions, whereas if they select the wrong answer they will be forwarded to a 'Incorrect answer' form. So far, i have my array of questions but that's about it - the last question i inputted to the array is constantly on display within my form, so i need to get it so the first question is on display and gradually progress through the next questions if the previous questions are answered correctly.

    I have probably explained this awfully - but any reply or help will be appreciated!

    Thanks
    For a more in-depth answer, you should show us your code that you have so far, and we'll help you to progress from there...

  4. #4
    Frenzied Member jdc20181's Avatar
    Join Date
    Oct 2015
    Location
    Indiana
    Posts
    1,168

    Re: Quiz creation using Visual Studio 2015

    Alright, so I will give you some hints -


    Initialize your question, usually when doing something like that I use Re-usable public subs, so if I need to reuse it I can.


    Code:
    Public Sub IsItRight()
    
    
    If Textbox1.text = "1" then
    
    Label1.text = "Correct"
    
    Else
     
      Label1.text ="Sorry, that is not correct"
    
    End sub
    An If Then statement works like this:

    If X = Y Then Y=X Else Y=Z then X=Y is false (Return a error)

    Basically you want to make sure the answer (user input) matches Answer(Answer-key/Real answer) then, you can go on to the next one.
    Disclaimer: When code is given for example - it is merely a example.




    Unless said otherwise indicated - All Code snippets advice or otherwise that I post on this site, are expressly licensed under Creative Commons Attribution 4.0 International Please respect my copyrights.

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