/** * Function to analyse if user input is correct * * @param index Index of curson in texbox * @param input Current inputed char * @return */ public boolean Analyse(int index, String input) { // if Lesson is ready if (Lesson.isReady()) { // get text of Lesson String lessonText = Lesson.getText(); /** * Compare user's input to what should be at index position in text of Lesson 1. Check if char * at desired index in Lesson is equal to user's input */ return Objects.equals("" + lessonText.charAt(index - 1), input); } return false; }