Updated flashcard to display based on the language sort.
This commit is contained in:
parent
0c56cfd033
commit
70edefd4a6
3 changed files with 27 additions and 10 deletions
|
@ -71,8 +71,13 @@ public class FlashcardController extends SharedCodeController {
|
|||
flashcardIcon.setImage(new Image("file:src/main/resources/assets/icons/black_icons/50px/flashcard-50.png"));
|
||||
flashcardsText.setFill(Color.BLACK);
|
||||
|
||||
testWord.setText(Application.practiceList.getFirst().getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
if(isSortedByEnglish){
|
||||
testWord.setText(Application.practiceList.getFirst().getEnglish());
|
||||
wordType.setText("English");
|
||||
} else{
|
||||
testWord.setText(Application.practiceList.getFirst().getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
}
|
||||
|
||||
updateCounter();
|
||||
card = flashcard;
|
||||
|
@ -103,8 +108,14 @@ public class FlashcardController extends SharedCodeController {
|
|||
index--;
|
||||
}
|
||||
updateCounter();
|
||||
testWord.setText(Application.practiceList.get(index).getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
|
||||
if(isSortedByEnglish){
|
||||
testWord.setText(Application.practiceList.get(index).getEnglish());
|
||||
wordType.setText("English");
|
||||
} else{
|
||||
testWord.setText(Application.practiceList.get(index).getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -120,8 +131,14 @@ public class FlashcardController extends SharedCodeController {
|
|||
}
|
||||
updateCounter();
|
||||
|
||||
testWord.setText(Application.practiceList.get(index).getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
if(isSortedByEnglish){
|
||||
testWord.setText(Application.practiceList.get(index).getEnglish());
|
||||
wordType.setText("English");
|
||||
} else{
|
||||
testWord.setText(Application.practiceList.get(index).getWelsh());
|
||||
wordType.setText("Welsh");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -20,7 +20,7 @@ import uk.ac.aber.cs22120.group20.json.DictionaryEntry;
|
|||
* @see AssessmentGenerator
|
||||
*/
|
||||
abstract public class SharedCodeController {
|
||||
|
||||
static boolean isSortedByEnglish = true;
|
||||
static int sideBarWidth = 50;
|
||||
|
||||
// /////////////////// //
|
||||
|
@ -151,7 +151,7 @@ abstract public class SharedCodeController {
|
|||
@FXML
|
||||
private void flashcardIconClick() {
|
||||
|
||||
if(Application.practiseList.size() == 0) { // Check to see if there are any practice words before switching scene, throwing an alert notifying them that they can't switch scenes.
|
||||
if(Application.practiceList.size() == 0) { // Check to see if there are any practice words before switching scene, throwing an alert notifying them that they can't switch scenes.
|
||||
Alert alert = new Alert(Alert.AlertType.ERROR);
|
||||
alert.setTitle("Error");
|
||||
alert.setHeaderText("Unable to use Flashcard");
|
||||
|
@ -170,7 +170,7 @@ abstract public class SharedCodeController {
|
|||
*/
|
||||
@FXML
|
||||
private void studyIconClick() {
|
||||
AssessmentGenerator.generateAssessment(Application.practiseList);
|
||||
AssessmentGenerator.generateAssessment(Application.practiceList);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
<children>
|
||||
<StackPane alignment="CENTER" onMouseClicked="#handleFlashcardClick" minWidth="500">
|
||||
<children>
|
||||
<ImageView fx:id="flashcard" fitWidth="500" fitHeight="360"></ImageView>
|
||||
<ImageView fx:id="flashcard" fitWidth="450" fitHeight="360"></ImageView>
|
||||
<Text textAlignment="CENTER" fx:id="testWord">
|
||||
<font>
|
||||
<Font size="55"/>
|
||||
|
|
Reference in a new issue