mirror of
https://gitlab.com/kauron/jstudy
synced 2024-11-13 07:33:44 +01:00
Test: no direct repetitions
This commit is contained in:
parent
1cf4477c10
commit
3e48c5d7eb
1 changed files with 3 additions and 1 deletions
|
@ -69,7 +69,9 @@ public class TestController implements Initializable {
|
|||
private void onSkipAction(ActionEvent event) {
|
||||
feedback.setVisible(AppConfig.showFeedback);
|
||||
answer.setText("");
|
||||
current = (int) (Math.random() * list.size());
|
||||
int previous = current;
|
||||
while (list.size() > 1 && current == previous)
|
||||
current = (int) (Math.random() * list.size());
|
||||
question.setText(list.get(current).getQuestion());
|
||||
answer.requestFocus();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue