mirror of
https://gitlab.com/kauron/jstudy
synced 2024-12-23 00:43:32 +01:00
Test: basis for counting errors and hits
This commit is contained in:
parent
3e48c5d7eb
commit
637bc33d2d
1 changed files with 5 additions and 2 deletions
|
@ -26,6 +26,7 @@ public class TestController implements Initializable {
|
||||||
|
|
||||||
private List<TestItem> list;
|
private List<TestItem> list;
|
||||||
private int total, current;
|
private int total, current;
|
||||||
|
private int done = 0, errors = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void initialize(URL url, ResourceBundle resourceBundle) {
|
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||||||
|
@ -50,11 +51,13 @@ public class TestController implements Initializable {
|
||||||
correctAnswer.setVisible(!right);
|
correctAnswer.setVisible(!right);
|
||||||
correctLabel.setVisible(!right);
|
correctLabel.setVisible(!right);
|
||||||
|
|
||||||
|
if (!right) errors++;
|
||||||
|
|
||||||
// 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 || !AppConfig.repeatWrong) {
|
if (right || !AppConfig.repeatWrong) {
|
||||||
list.remove(current);
|
list.remove(current);
|
||||||
progress.setProgress(progress.getProgress() + 1.0/total);
|
progress.setProgress(++done/(double)total);
|
||||||
progressLabel.setText((int) (progress.getProgress() * total) + "/" + total);
|
progressLabel.setText(done + "/" + total);
|
||||||
if (list.size() == 0) {
|
if (list.size() == 0) {
|
||||||
answer.setText("");
|
answer.setText("");
|
||||||
answer.setDisable(true);
|
answer.setDisable(true);
|
||||||
|
|
Loading…
Reference in a new issue