Updated most the controllers with comment blocks to describe each section of the class.

This commit is contained in:
top19 2020-04-30 17:17:28 +01:00
parent 72c8ccf479
commit fb1b3c4052
4 changed files with 45 additions and 16 deletions

View file

@ -38,6 +38,10 @@ import uk.ac.aber.cs22120.group20.json.DictionaryEntry;
*/
public class AddWordController extends SharedCodeController {
// /////////////////// //
// Instance variables. //
// /////////////////// //
@FXML
private TextField welsh;
@FXML
@ -45,12 +49,15 @@ public class AddWordController extends SharedCodeController {
@FXML
private ComboBox<String> wordType;
// //////// //
// Methods. //
// //////// //
/**
* Gets the value from the welsh text field
*
* @return welsh
*/
public TextField getWelsh() {
return welsh;
}
@ -60,7 +67,6 @@ public class AddWordController extends SharedCodeController {
*
* @return english
*/
public TextField getEnglish() {
return english;
}
@ -86,7 +92,6 @@ public class AddWordController extends SharedCodeController {
* @see Application
* @see DictionaryEntry
*/
@FXML
protected void addButtonClick(ActionEvent actionEvent) {
DictionaryEntry.wordTypeEnum trueWordType;
@ -172,7 +177,6 @@ public class AddWordController extends SharedCodeController {
*
* @param actionEvent action event for the button click
*/
public void addChardd(ActionEvent actionEvent) {
welsh.appendText("dd");
}
@ -182,7 +186,6 @@ public class AddWordController extends SharedCodeController {
*
* @param actionEvent action event for the button click
*/
public void addCharff(ActionEvent actionEvent) {
welsh.appendText("ff");
}
@ -192,7 +195,6 @@ public class AddWordController extends SharedCodeController {
*
* @param actionEvent action event for the button click
*/
public void addCharng(ActionEvent actionEvent) {
welsh.appendText("ng");
}
@ -202,7 +204,6 @@ public class AddWordController extends SharedCodeController {
*
* @param actionEvent action event for the button click
*/
public void addCharll(ActionEvent actionEvent) {
welsh.appendText("ll");
}
@ -212,7 +213,6 @@ public class AddWordController extends SharedCodeController {
*
* @param actionEvent action event for the button click
*/
public void addCharph(ActionEvent actionEvent) {
welsh.appendText("ph");
}
@ -222,7 +222,6 @@ public class AddWordController extends SharedCodeController {
*
* @param actionEvent action event for the button click
*/
public void addCharrh(ActionEvent actionEvent) {
welsh.appendText("rh");
}
@ -232,7 +231,6 @@ public class AddWordController extends SharedCodeController {
*
* @param actionEvent action event for the button click
*/
public void addCharth(ActionEvent actionEvent) {
welsh.appendText("th");
}

View file

@ -39,12 +39,19 @@ import java.util.*;
public class MatchTheMeaningController extends SharedCodeController {
// //////////////// //
// Class variables. //
// //////////////// //
public static ArrayList<DictionaryEntry> answer =new ArrayList<>();
// /////////////////// //
// Instance variables. //
// /////////////////// //
private ArrayList<Integer> orderList = new ArrayList<>(Arrays.asList(0,1,2,3));
private boolean isEnglish = AssessmentGenerator.isEnglish;
@FXML
private ComboBox<String> word1;
@ -87,7 +94,9 @@ public class MatchTheMeaningController extends SharedCodeController {
@FXML
private Label WrongAnswer;
// //////// //
// Methods. //
// //////// //
/**
* Set chosen words from dictionary on the scene.

View file

@ -38,13 +38,21 @@ import java.util.*;
public class SixMeaningsController extends SharedCodeController {
private ArrayList<DictionaryEntry> wordSet = new ArrayList<>();
// //////////////// //
// Class variables. //
// //////////////// //
public static ArrayList<DictionaryEntry> allQuestions = new ArrayList<>();
// /////////////////// //
// Instance variables. //
// /////////////////// //
private ArrayList<DictionaryEntry> wordSet = new ArrayList<>();
private ArrayList<Integer> orderList = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5));
private String wordCounterpart;
private boolean isEnglish = AssessmentGenerator.isEnglish;
@FXML
private Text correctAnswer;
@ -72,6 +80,10 @@ public class SixMeaningsController extends SharedCodeController {
@FXML
private Text possibleAnswer6;
// //////// //
// Methods. //
// //////// //
@FXML
void answer1(MouseEvent event) {
wordCounterpart = possibleAnswer1.getText();

View file

@ -24,9 +24,17 @@ import uk.ac.aber.cs22120.group20.selfassessment.Question;
*
*/
public class TranslationController extends SharedCodeController{
private ArrayList<DictionaryEntry> practiceList = new ArrayList<>();
// //////////////// //
// Class variables. //
// //////////////// //
public static DictionaryEntry answer = new DictionaryEntry();
// /////////////////// //
// Instance variables. //
// /////////////////// //
/**
* Represents the word that will be randomly chosen from the practiceList.
*/
@ -51,7 +59,9 @@ public class TranslationController extends SharedCodeController{
Random rand = new Random();
// //////// //
// Methods. //
// //////// //
/**
* Loads the test for the first time, filling the practice list with words from the dictionary,