mirror of
https://gitlab.com/kauron/jstudy
synced 2024-12-22 08:23:33 +01:00
Interface consistency bugs
This commit is contained in:
parent
d3d07b7541
commit
7d835018e3
2 changed files with 12 additions and 5 deletions
|
@ -66,7 +66,10 @@ public class Controller implements Initializable {
|
|||
} else { // update if in table tab
|
||||
tabIsTable.set(tabMap.get(n) != null);
|
||||
menuCloseTab.setDisable(!n.isClosable());
|
||||
menuSave.disableProperty().unbind();
|
||||
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);
|
||||
|
|
|
@ -44,7 +44,6 @@ public class TestController implements Initializable {
|
|||
void setList(List<TestItem> list) {
|
||||
this.list = list;
|
||||
int total = list.size();
|
||||
progress.setProgress(0);
|
||||
progressLabel.textProperty().bind(Bindings.format(
|
||||
String.format("%%.2f%%%% %%d / %d %%d mistakes", total),
|
||||
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
|
||||
if ((right && !correctingError.get()) || !AppPrefs.repeatWrong.get()) {
|
||||
list.remove(item.get());
|
||||
if (right || !AppPrefs.repeatWrong.get()) {
|
||||
if (!correctingError.get())
|
||||
done.set(done.get() + 1);
|
||||
correctingError.set(!right && AppPrefs.repeatImmediately.get());
|
||||
list.remove(item.get());
|
||||
if (list.size() == 0) {
|
||||
onEndAction(null);
|
||||
return;
|
||||
}
|
||||
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();
|
||||
}
|
||||
correctingError.set(!right && AppPrefs.repeatImmediately.get());
|
||||
answer.setText("");
|
||||
answer.requestFocus();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue