1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2024-09-28 18:49:26 +02:00

Test: always show feedback and borderpane

This commit is contained in:
Carlos Galindo 2016-06-13 10:43:23 +02:00
parent 7ec7494ea6
commit 7159d5a92b
Signed by: kauron
GPG key ID: 83E68706DEE119A3
3 changed files with 30 additions and 41 deletions

View file

@ -31,7 +31,6 @@ public class TestController implements Initializable {
@Override @Override
public void initialize(URL url, ResourceBundle resourceBundle) { public void initialize(URL url, ResourceBundle resourceBundle) {
feedback.setVisible(false);
} }
void setList(List<TestItem> list) { void setList(List<TestItem> list) {
@ -74,9 +73,7 @@ public class TestController implements Initializable {
@FXML @FXML
private void onSkipAction(ActionEvent event) { private void onSkipAction(ActionEvent event) {
feedback.setVisible(AppConfig.showFeedback);
answer.setText(""); answer.setText("");
if (current == -1) feedback.setVisible(false);
int previous = current; int previous = current;
while (list.size() > 1 && current == previous) while (list.size() > 1 && current == previous)
current = (int) (Math.random() * list.size()); current = (int) (Math.random() * list.size());

View file

@ -3,12 +3,10 @@
<?import com.jfoenix.controls.JFXCheckBox?> <?import com.jfoenix.controls.JFXCheckBox?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<VBox alignment="CENTER_LEFT" spacing="15.0" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="es.kauron.jstudy.controller.SettingsController"> <VBox alignment="CENTER_LEFT" spacing="15.0" xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="es.kauron.jstudy.controller.SettingsController">
<children> <children>
<JFXCheckBox fx:id="repeatMistakes" text="_Repeat mistakes" /> <JFXCheckBox fx:id="repeatMistakes" text="_Repeat mistakes" />
<JFXCheckBox fx:id="showFeedback" layoutX="237.0" layoutY="201.0" text="Show _feedback while testing" /> <JFXCheckBox fx:id="showFeedback" disable="true" layoutX="237.0" layoutY="201.0" text="Show _feedback while testing" />
</children> </children>
<padding> <padding>
<Insets bottom="15.0" left="15.0" right="15.0" top="15.0" /> <Insets bottom="15.0" left="15.0" right="15.0" top="15.0" />

View file

@ -1,30 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import com.jfoenix.controls.JFXTextField?> <?import com.jfoenix.controls.JFXTextField?>
<?import javafx.geometry.Insets?> <?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.*?>
<?import javafx.scene.control.Label?> <?import javafx.scene.layout.*?>
<?import javafx.scene.control.ProgressBar?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Font?> <?import javafx.scene.text.Font?>
<BorderPane xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="es.kauron.jstudy.controller.TestController">
<center>
<GridPane xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="es.kauron.jstudy.controller.TestController"> <VBox minHeight="280.0" minWidth="360.0" spacing="10.0">
<columnConstraints>
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
<ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" />
</columnConstraints>
<rowConstraints>
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<VBox minHeight="280.0" minWidth="360.0" spacing="10.0" GridPane.hgrow="ALWAYS">
<children> <children>
<Label fx:id="question" text="Question" wrapText="true" VBox.vgrow="ALWAYS"> <Label fx:id="question" text="Question" wrapText="true" VBox.vgrow="ALWAYS">
<font> <font>
@ -61,23 +45,33 @@
</children> </children>
</HBox> </HBox>
</children> </children>
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</VBox> </VBox>
<VBox alignment="TOP_RIGHT" spacing="10.0" GridPane.columnIndex="1"> </center>
<children> <bottom>
<Button defaultButton="true" focusTraversable="false" onAction="#onNextAction" prefWidth="110.0" text="_Next" /> <VBox alignment="CENTER" BorderPane.alignment="CENTER">
<Button cancelButton="true" focusTraversable="false" onAction="#onSkipAction" prefWidth="110.0" text="_Skip question" />
<Button cancelButton="true" focusTraversable="false" layoutX="10.0" layoutY="48.0" onAction="#onEndAction" prefWidth="110.0" text="_End test" />
</children>
</VBox>
<VBox alignment="CENTER" GridPane.columnSpan="2147483647" GridPane.rowIndex="1">
<children> <children>
<Separator prefWidth="200.0" /> <Separator prefWidth="200.0" />
<Label fx:id="progressLabel" alignment="CENTER" contentDisplay="TOP" maxWidth="1.7976931348623157E308" text="1/40" /> <Label fx:id="progressLabel" alignment="CENTER" contentDisplay="TOP" maxWidth="1.7976931348623157E308" text="1/40" />
<ProgressBar fx:id="progress" maxWidth="1.7976931348623157E308" progress="0.0" /> <ProgressBar fx:id="progress" maxWidth="1.7976931348623157E308" progress="0.0" />
</children> </children>
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</VBox> </VBox>
</children> </bottom>
<padding> <right>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" /> <VBox alignment="TOP_RIGHT" spacing="10.0" BorderPane.alignment="CENTER">
</padding> <children>
</GridPane> <Button defaultButton="true" focusTraversable="false" onAction="#onNextAction" prefWidth="110.0" text="_Next" />
<Button cancelButton="true" focusTraversable="false" onAction="#onSkipAction" prefWidth="110.0" text="_Skip question" />
<Button cancelButton="true" focusTraversable="false" layoutX="10.0" layoutY="48.0" onAction="#onEndAction" prefWidth="110.0" text="_End test" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</VBox>
</right>
</BorderPane>