1
0
Fork 0
mirror of https://gitlab.com/kauron/jstudy synced 2024-06-26 13:33:02 +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
public void initialize(URL url, ResourceBundle resourceBundle) {
feedback.setVisible(false);
}
void setList(List<TestItem> list) {
@ -74,9 +73,7 @@ public class TestController implements Initializable {
@FXML
private void onSkipAction(ActionEvent event) {
feedback.setVisible(AppConfig.showFeedback);
answer.setText("");
if (current == -1) feedback.setVisible(false);
int previous = current;
while (list.size() > 1 && current == previous)
current = (int) (Math.random() * list.size());

View file

@ -3,12 +3,10 @@
<?import com.jfoenix.controls.JFXCheckBox?>
<?import javafx.geometry.Insets?>
<?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">
<children>
<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>
<padding>
<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"?>
<?import com.jfoenix.controls.JFXTextField?>
<?import javafx.geometry.Insets?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?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.control.*?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.text.Font?>
<GridPane xmlns="http://javafx.com/javafx/8.0.76-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="es.kauron.jstudy.controller.TestController">
<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">
<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>
<VBox minHeight="280.0" minWidth="360.0" spacing="10.0">
<children>
<Label fx:id="question" text="Question" wrapText="true" VBox.vgrow="ALWAYS">
<font>
@ -61,23 +45,33 @@
</children>
</HBox>
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</VBox>
<VBox alignment="TOP_RIGHT" spacing="10.0" GridPane.columnIndex="1">
<children>
<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>
</VBox>
<VBox alignment="CENTER" GridPane.columnSpan="2147483647" GridPane.rowIndex="1">
</center>
<bottom>
<VBox alignment="CENTER" BorderPane.alignment="CENTER">
<children>
<Separator prefWidth="200.0" />
<Label fx:id="progressLabel" alignment="CENTER" contentDisplay="TOP" maxWidth="1.7976931348623157E308" text="1/40" />
<ProgressBar fx:id="progress" maxWidth="1.7976931348623157E308" progress="0.0" />
</children>
<BorderPane.margin>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</BorderPane.margin>
</VBox>
</children>
<padding>
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
</padding>
</GridPane>
</bottom>
<right>
<VBox alignment="TOP_RIGHT" spacing="10.0" BorderPane.alignment="CENTER">
<children>
<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>