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

Test: no direct repetitions

This commit is contained in:
Carlos Galindo 2016-06-12 15:01:37 +02:00
parent 1cf4477c10
commit 3e48c5d7eb
Signed by: kauron
GPG key ID: 83E68706DEE119A3

View file

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