1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2024-11-13 07:33:44 +01:00

Interface consistency bugs

This commit is contained in:
Carlos Galindo 2019-09-12 23:34:33 +02:00
parent d3d07b7541
commit 7d835018e3
Signed by: kauron
GPG key ID: 83E68706DEE119A3
2 changed files with 12 additions and 5 deletions

View file

@ -66,7 +66,10 @@ public class Controller implements Initializable {
} else { // update if in table tab } else { // update if in table tab
tabIsTable.set(tabMap.get(n) != null); tabIsTable.set(tabMap.get(n) != null);
menuCloseTab.setDisable(!n.isClosable()); menuCloseTab.setDisable(!n.isClosable());
menuSave.disableProperty().unbind();
menuSave.setDisable(!tabMap.containsKey(n) || tabMap.get(n).saved.get()); menuSave.setDisable(!tabMap.containsKey(n) || tabMap.get(n).saved.get());
if (tabMap.containsKey(n))
menuSave.disableProperty().bind(tabMap.get(n).saved);
} }
}); });
tabPane.getTabs().removeListener((ListChangeListener<Tab>) c -> theTest = null); tabPane.getTabs().removeListener((ListChangeListener<Tab>) c -> theTest = null);

View file

@ -44,7 +44,6 @@ public class TestController implements Initializable {
void setList(List<TestItem> list) { void setList(List<TestItem> list) {
this.list = list; this.list = list;
int total = list.size(); int total = list.size();
progress.setProgress(0);
progressLabel.textProperty().bind(Bindings.format( progressLabel.textProperty().bind(Bindings.format(
String.format("%%.2f%%%% %%d / %d %%d mistakes", total), String.format("%%.2f%%%% %%d / %d %%d mistakes", total),
done.multiply(100.0).divide(total), done, errors)); done.multiply(100.0).divide(total), done, errors));
@ -75,18 +74,23 @@ public class TestController implements Initializable {
} }
// Remove the question from the pool if the question was correctly answered or there is no repetition // Remove the question from the pool if the question was correctly answered or there is no repetition
if ((right && !correctingError.get()) || !AppPrefs.repeatWrong.get()) { if (right || !AppPrefs.repeatWrong.get()) {
if (!correctingError.get())
done.set(done.get() + 1);
correctingError.set(!right && AppPrefs.repeatImmediately.get());
list.remove(item.get()); list.remove(item.get());
done.set(done.get() + 1);
if (list.size() == 0) { if (list.size() == 0) {
onEndAction(null); onEndAction(null);
return; return;
} }
chooseQuestion(); chooseQuestion();
} else if (!AppPrefs.repeatImmediately.get()) { } else if (AppPrefs.repeatImmediately.get()) {
correctingError.set(true);
item.set(new TestItem(item.get()));
list.add(item.get());
} else {
chooseQuestion(); chooseQuestion();
} }
correctingError.set(!right && AppPrefs.repeatImmediately.get());
answer.setText(""); answer.setText("");
answer.requestFocus(); answer.requestFocus();
} }