public class ResultOfTest {
private int Result;
private boolean src;
public boolean testing(int a, int b){
src = false;
if(a == b){
src = true;
}else if(a != b){
src = false;
}
return src;
}
public int plusResult(){
if(src == true){
Result = Result + 10;
}
System.out.println(Result);
return Result;
}
}
public class UserInterface(){
Question quest;
ResultOfTest res;
private int radButt;
public void radioButtonChoose(){
if(radio1.isSelected()){
radButt = 1;
}else if(radio2.isSelected()){
radButt = 2;
}else if(radio3.isSelected()){
radButt = 3;
}else if(radio4.isSelected()){
radButt = 4;
}else if(radio5.isSelected()){
radButt = 5;
}else if(radio6.isSelected()){
radButt = 6;
}else if(radio7.isSelected()){
radButt = 7;
}else if(radio8.isSelected()){
radButt = 8;
}
}
class chButtonEvent implements ActionListener{
public void actionPerformed(ActionEvent e) {
radioButtonChoose();
res.testing(quest.testAnswer(), radButt());
res.plusResult();
quest.nextQuestion();
setMyInterface();
}
}
public int radButt(){
return radButt;
}
public void constr(){
quest = new Question();
res = new ResultOfTest();
}
}