hey guys/...am stuck at one point....help me please! ! !
its a quiz progg... one ques...4 options...
i have one button---NEXT QUES--- It should display the next ques--it should also take the user selected option, compare it with the correct option and show if the Answer is right or wrong
else if(ae.getSource()==b1)
{
if(answer==Answercheck.correct) // checking if answer is correct or not
{
System.out.println("YOUR ANSWER IS CORRECT");
}
else
{
System.out.println("YOUR ANSWER IS WRONG");
}
if(option1.isSelected())
{
System.out.println("Option 1");
answer = option1.getText();
System.out.println(" User Selected ANSWER IS : : : : "+answer);
}
else if(option2.isSelected())
{
System.out.println("Option 2");
answer = option2.getText();
System.out.println(" User Selected ANSWER IS : : : : "+answer);
}
else if(option3.isSelected())
{
System.out.println("Option 3");
answer = option3.getText();
System.out.println(" User Selected ANSWER IS : : : : "+answer);
}
else if(option4.isSelected())
{
System.out.println("Option 4");
answer = option4.getText();
System.out.println(" User Selected ANSWER IS : : : : "+answer);
}
v1=v1+1;//next ques from database
displayQuestion(v1);//gets the ques from the database and the options also
Answercheck.check(v1); // this only gets the correct answer!!
}
}
also..
v1=0;
so when i run the progg...no ques is displayed..only after i click on b1, is the first question displayed.....
i guess only the order of things is wrong...help me plzzzz!!!