Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How i check the Ans of objective question using Radio Button

How i check the Ans of objective question using Radio Button

Scheduled Pinned Locked Moved C#
question
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Ravindra Bisen
    wrote on last edited by
    #1

    Dear, i have 10 questions in a form each question have 4 option. i made 10 group box for each question and putted 4 radio button into each. finally i have to calculate score of this test using a answer key. what is the process for this . (i am checking 40 radio button individually) but it is not good if we have 100 question. is there any solution ?.... thanks :rolleyes:

    M P 2 Replies Last reply
    0
    • R Ravindra Bisen

      Dear, i have 10 questions in a form each question have 4 option. i made 10 group box for each question and putted 4 radio button into each. finally i have to calculate score of this test using a answer key. what is the process for this . (i am checking 40 radio button individually) but it is not good if we have 100 question. is there any solution ?.... thanks :rolleyes:

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Create a custom control to service a question. It needs to receive a question object, bind the controls to the object and bind the response to the answer in the object. When completed the object should write the result back to the database. Then you just create one CC for each question and put it on the form. I would use a flowcontrol in winforms.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • R Ravindra Bisen

        Dear, i have 10 questions in a form each question have 4 option. i made 10 group box for each question and putted 4 radio button into each. finally i have to calculate score of this test using a answer key. what is the process for this . (i am checking 40 radio button individually) but it is not good if we have 100 question. is there any solution ?.... thanks :rolleyes:

        P Offline
        P Offline
        Pedram Behroozi
        wrote on last edited by
        #3

        Yes sure. As Mr. Holmes said, you can have a CC for your questions but not a CC for each one. You can have a CC for all your questions. If I were you, my CC would have a Label and 4 RadioButtons in it and I would set their values with my CC constructor, something like this:

        public myCC (string LabelValue, string[4] questions)
        {
        labelQuestion.Text = LabelValue;
        radiobuttonQuestions.Texts = questions; // You need a loop to do this. It's just a pseudo-code.
        }

        And everytime user clicks on Next button (or something similar) store the result in an array, create a new CC, set its values, show on your form and dispose the previous one. Your memory can breathe in this way :-D I hope I could help :) I learned something new today

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups