How i check the Ans of objective question using Radio Button
-
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:
-
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:
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
-
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:
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