1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2024-11-13 07:33:44 +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) {
answer.setText("");
int previous = current;
while (list.size() > 1 && current == previous)
do
current = (int) (Math.random() * list.size());
while (list.size() > 1 && current == previous);
question.setText(list.get(current).getQuestion());
answer.requestFocus();
}