1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2024-12-23 00:43:32 +01:00

TestController: while to do-while

This commit is contained in:
Carlos Galindo 2017-06-19 14:30:04 +02:00
parent ec418ce64e
commit e9243520e4
Signed by: kauron
GPG key ID: 83E68706DEE119A3

View file

@ -75,8 +75,9 @@ public class TestController implements Initializable {
private void onSkipAction(ActionEvent event) { private void onSkipAction(ActionEvent event) {
answer.setText(""); answer.setText("");
int previous = current; int previous = current;
while (list.size() > 1 && current == previous) do
current = (int) (Math.random() * list.size()); current = (int) (Math.random() * list.size());
while (list.size() > 1 && current == previous);
question.setText(list.get(current).getQuestion()); question.setText(list.get(current).getQuestion());
answer.requestFocus(); answer.requestFocus();
} }