Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions LoginWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

<AnchorPane id="AnchorPane" prefHeight="480.0" prefWidth="600.0" style="-fx-background-color: #eaebed;" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="flashcards.LoginWindowController">
<children>
<Label layoutX="221.0" layoutY="97.0" text="Please Login or Register" >
<Label layoutX="221.0" layoutY="97.0" text="Please Login or Register" >
<font>
<Font size="20.0" />
</font>
Expand All @@ -23,7 +23,7 @@
</font>
</Label>
<TextField id="passField" fx:id="passField" layoutX="193.0" layoutY="288.0" prefHeight="31.0" prefWidth="215.0" />
<Label layoutX="269.0" layoutY="257.0" text="Password" >
<Label layoutX="269.0" layoutY="257.0" text="Password" >
<font>
<Font size="20.0" />
</font>
Expand Down
34 changes: 23 additions & 11 deletions MainWindow.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<?import javafx.geometry.*?>
<?import javafx.scene.shape.*?>
<?import javafx.scene.text.*?>
<?import java.lang.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
Expand All @@ -10,13 +11,21 @@

<AnchorPane id="AnchorPane" prefHeight="720.0" prefWidth="961.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="flashcards.MainWindowController">
<children>
<Label fx:id="welcomeLabel" layoutX="96.0" layoutY="30.0" text="Welcome, User!" />
<Label layoutX="96.0" layoutY="66.0" text="Select a Subject" />
<Button alignment="CENTER" layoutX="73.0" layoutY="582.0" mnemonicParsing="false" onAction="#createNewSubjectBtn" prefHeight="31.0" prefWidth="152.0" text="Add Subject" />
<Label fx:id="welcomeLabel" layoutX="96.0" layoutY="30.0" text="Welcome, User!">
<font>
<Font size="24.0" />
</font>
</Label>
<Label layoutX="96.0" layoutY="66.0" text="Select a Subject" >
<font>
<Font size="24.0" />
</font>
</Label>
<Button alignment="CENTER" layoutX="73.0" layoutY="582.0" mnemonicParsing="false" onAction="#createNewSubjectBtn" prefHeight="31.0" prefWidth="180.0" text="Add Subject" />
<Separator layoutX="309.0" layoutY="41.0" orientation="VERTICAL" prefHeight="632.0" prefWidth="6.0" />
<ListView fx:id="listView" layoutX="49.0" layoutY="101.0" prefHeight="428.0" prefWidth="200.0" />
<Button alignment="CENTER" layoutX="72.0" layoutY="544.0" mnemonicParsing="false" onAction="#addFlashCardBtn" prefHeight="31.0" prefWidth="152.0" text="Add FlashCard" />
<BorderPane fx:id="flashcardPane" layoutX="344.0" layoutY="31.0" prefHeight="658.0" prefWidth="581.0">
<Button alignment="CENTER" layoutX="72.0" layoutY="544.0" mnemonicParsing="false" onAction="#addFlashCardBtn" prefHeight="31.0" prefWidth="180.0" text="Add FlashCard" />
<BorderPane fx:id="flashcardPane" layoutX="344.0" layoutY="31.0" prefHeight="800.0" prefWidth="890.0">
<left>
<Button alignment="CENTER" mnemonicParsing="false" onAction="#prevCardBtn" prefHeight="31.0" prefWidth="76.0" text="Previous" BorderPane.alignment="CENTER" />
</left>
Expand All @@ -25,8 +34,11 @@
<opaqueInsets>
<Insets />
</opaqueInsets>
<font>
<Font size="24.0" />
</font>
<BorderPane.margin>
<Insets />
<Insets />
</BorderPane.margin>
</Label>
</top>
Expand All @@ -39,22 +51,22 @@
<Label fx:id="totAttemptLabel" text="Total Attempts: 0" />
<Label fx:id="corAttemptLabel" alignment="CENTER" text="Correct Attempts: 0" />
<Label fx:id="incAttemptLabel" alignment="CENTER" text="Incorrect Attempts: 0" />
<Button alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" onAction="#removeFlashcardBtn" prefHeight="31.0" prefWidth="152.0" text="Remove FlashCard" />
<Button alignment="CENTER" contentDisplay="CENTER" mnemonicParsing="false" onAction="#removeFlashcardBtn" prefHeight="31.0" prefWidth="170.0" text="Remove FlashCard" />
</children>
</VBox>
</bottom>
<center>
<VBox fx:id="flashcardDisplayBox" alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" spacing="15.0" BorderPane.alignment="CENTER">
<VBox fx:id="flashcardDisplayBox" alignment="TOP_CENTER" prefHeight="200.0" prefWidth="100.0" spacing="30.0" BorderPane.alignment="CENTER">
<children>
<Label text="Label" />
<TextField alignment="CENTER" prefHeight="31.0" prefWidth="357.0" />
<TextField alignment="CENTER" prefHeight="31.0" prefWidth="300.0" />
<Button mnemonicParsing="false" text="Check Answer" />
</children>
<padding>
<Insets left="40.0" right="40.0" top="10.0" />
</padding></VBox>
</center></BorderPane>
<Button alignment="CENTER" contentDisplay="CENTER" layoutX="73.0" layoutY="620.0" mnemonicParsing="false" onAction="#removeSubjectBtn" prefHeight="31.0" prefWidth="152.0" text="Remove Subject" />
<Button alignment="CENTER" contentDisplay="CENTER" layoutX="72.0" layoutY="658.0" mnemonicParsing="false" onAction="#resetFlashcardsBtn" prefHeight="31.0" prefWidth="152.0" text="Reset FlashCards" />
<Button alignment="CENTER" contentDisplay="CENTER" layoutX="73.0" layoutY="620.0" mnemonicParsing="false" onAction="#removeSubjectBtn" prefHeight="31.0" prefWidth="180.0" text="Remove Subject" />
<Button alignment="CENTER" contentDisplay="CENTER" layoutX="72.0" layoutY="658.0" mnemonicParsing="false" onAction="#resetFlashcardsBtn" prefHeight="31.0" prefWidth="180.0" text="Reset FlashCards" />
</children>
</AnchorPane>
4 changes: 3 additions & 1 deletion MainWindowController.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.geometry.Pos;
import javafx.scene.text.Font;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.Alert.AlertType;
Expand Down Expand Up @@ -286,10 +287,11 @@ private void clearCards()
// Helper method
private VBox buildFlashCard(FlashCard card) {
flashcardDisplayBox = new VBox(15); // spacing between children
flashcardDisplayBox.setPadding(new Insets(100, 50, 180, 50));
flashcardDisplayBox.setPadding(new Insets(100, 50, 180, 100));
flashcardDisplayBox.setAlignment(Pos.CENTER);

Label question = new Label(card.getQuestion());
question.setFont(Font.font("Verdana",20)); // make the font bigger so users can read it easily
TextField answer = new TextField();
Button checkBtn = new Button("Check Answer");
checkBtn.setOnAction((ActionEvent event) ->
Expand Down
31 changes: 31 additions & 0 deletions dylan.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Subject: Math
2*2 @DL 4 @DL 6 @DL 6 @DL 0 @DL 1 1 1 1 1
15/3 @DL 5 @DL 4 @DL 4 @DL 0 @DL 1 1 1 1 0
1+54 @DL 55 @DL 4 @DL 4 @DL 0 @DL 1 1 1 1 0
23-3 @DL 20 @DL 3 @DL 3 @DL 0 @DL 1 1 1 0 0
35+3 @DL 38 @DL 4 @DL 4 @DL 0 @DL 1 1 1 1 0
Subject: Star Wars
In the Phantom Menace who is the sith lord? @DL Darth Maul @DL 1 @DL 1 @DL 0 @DL 1 0 0 0 0
Name of Han Solo's Ship? @DL Millennium Falcon @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Color of Yoda's lightsaber @DL green @DL 1 @DL 1 @DL 0 @DL 1 0 0 0 0
What bounty hunter gets Han Solo @DL Boba Fett @DL 1 @DL 1 @DL 0 @DL 1 0 0 0 0
Who is Luke Skywalker's twin sister? @DL Princess Leia @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Subject: Game of Thrones
Name of Jon's direwolf @DL Ghost @DL 1 @DL 1 @DL 0 @DL 1 0 0 0 0
King of Westeros when the show starts @DL Robert Baratheon @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Where are the seven kingdoms located @DL Westeros @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
What is the name of Arya Stark's sword? @DL Needle @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Daenerys Targaryen had how many dragons @DL 3 @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Subject: NFL Teams
Pittsburgh __________ @DL Steelers @DL 1 @DL 1 @DL 0 @DL 1 0 0 0 0
Kansas City ___________ @DL Chiefs @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Cincinnati _______ @DL Bengals @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Cleveland ______ @DL Browns @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Green Bay _______ @DL Packers @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Subject: NCAA Teams
Michigan __________ @DL Wolverines @DL 1 @DL 1 @DL 0 @DL 1 0 0 0 0
Ohio State ________ @DL Buckeyes @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Oregon _____ @DL Ducks @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Wisconsin ________ @DL Badgers @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
Cincinnati ________ @DL Bearcats @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
USC _______ @DL Trojans @DL 0 @DL 0 @DL 0 @DL 0 0 0 0 0
1 change: 1 addition & 0 deletions users.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dylan [B@683d0e15 +gglL5OxlbyX4k/i5qRa4MWqXl8XuLpgNrko3mZCYpg=