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:
parent
ec418ce64e
commit
e9243520e4
1 changed files with 2 additions and 1 deletions
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue