From 5d5e714b5e5efb3687f1b3ae6f2e18806aac03a5 Mon Sep 17 00:00:00 2001 From: Carlos Galindo Date: Sun, 12 Jun 2016 17:01:17 +0200 Subject: [PATCH] Test: Answer style and better layout --- .../java/es/kauron/jstudy/controller/TestController.java | 9 +++++++-- src/main/resources/es/kauron/jstudy/css/test.css | 3 +++ src/main/resources/es/kauron/jstudy/view/test.fxml | 6 +++--- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 src/main/resources/es/kauron/jstudy/css/test.css diff --git a/src/main/java/es/kauron/jstudy/controller/TestController.java b/src/main/java/es/kauron/jstudy/controller/TestController.java index 98f5122..9cfc111 100644 --- a/src/main/java/es/kauron/jstudy/controller/TestController.java +++ b/src/main/java/es/kauron/jstudy/controller/TestController.java @@ -30,7 +30,7 @@ public class TestController implements Initializable { @Override public void initialize(URL url, ResourceBundle resourceBundle) { - feedback.setVisible(AppConfig.showFeedback); + feedback.setVisible(false); } void setList(List list) { @@ -51,7 +51,12 @@ public class TestController implements Initializable { correctAnswer.setVisible(!right); correctLabel.setVisible(!right); - if (!right) errors++; + if (!right) { + errors++; + prevAnswer.setStyle("-fx-text-fill: #C40000;"); + } else { + prevAnswer.setStyle("-fx-text-fill: #00C400;"); + } // Remove the question from the pool if the question was correctly answered or there is no repetition if (right || !AppConfig.repeatWrong) { diff --git a/src/main/resources/es/kauron/jstudy/css/test.css b/src/main/resources/es/kauron/jstudy/css/test.css new file mode 100644 index 0000000..235fe8a --- /dev/null +++ b/src/main/resources/es/kauron/jstudy/css/test.css @@ -0,0 +1,3 @@ +.answer { + -fx-font-weight: bold; +} \ No newline at end of file diff --git a/src/main/resources/es/kauron/jstudy/view/test.fxml b/src/main/resources/es/kauron/jstudy/view/test.fxml index 6b1cc79..0c9d276 100644 --- a/src/main/resources/es/kauron/jstudy/view/test.fxml +++ b/src/main/resources/es/kauron/jstudy/view/test.fxml @@ -24,7 +24,7 @@ - + @@ -62,7 +62,7 @@ - +