Skip to content

Commit

Permalink
Merge pull request #121 from Andy123qq4/master
Browse files Browse the repository at this point in the history
Fix ui and ui uml function
  • Loading branch information
Andy123qq4 authored Apr 15, 2024
2 parents b3ea06a + 5771322 commit 89eed16
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
26 changes: 23 additions & 3 deletions docs/diagrams/UI.puml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,38 @@
class Ui {
-name: String
-scanner: Scanner
-PROBLEM_FORM: String
-FIRST_INSTRUCTION: String
-INPUT_INSTRUCTION: String
-GEN_COMMAND: String
-HELP_COMMAND: String
-RECORDS_COMMAND: String
-RETRY_COMMAND: String
-DIY_COMMAND: String
-EXPLANATION_START: String
-EXPLANATION_END: String
-WRONG_ANSWER: String
-START_ANSWER_TEST: String
-EXIT_TEST: String
-TEST_FINISH: String
-EXIT_COMMAND: String
+Ui(name: String)
+greet(): void
+readCommand(): String
+showLine(): void
+help(helpType: String): void
+print(string: String): void
+printRecords(records: ArrayList<Record>, showProbDetails: boolean): void
+invalidCommand(): void
+invalidParameter(command: String): void
+static invalidMessage(parameters: String): void
+static missingMessage(parameters: String): void
+showExplanation(): void
+showExplanationEnd(): void
+showWrongAnswer(i: int): void
+startAnswerTest(): void
+exitTest(): void
+showTestResult(acc: double, time: long): void
+exit(): void
+missingMessage(parameters: String): void
}

@enduml
@enduml
14 changes: 0 additions & 14 deletions src/main/java/seedu/duke/Ui.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ public class Ui {
"2.You can type \"exit\" to quit the test when answering the question.\n"+
"3.You may round the answer to 2 decimal places for complex answers.";

private static final String EXIT_TEST =
"Exit the test! All the test not finished will be marked as wrong! No explanation for them!";

private static final String TEST_FINISH =
"TEST FINISHED! \n"+
"Here is your test result: ";
Expand Down Expand Up @@ -227,17 +224,6 @@ public void showWrongAnswer(int i) {
System.out.println("The following " + i + " answers you gave are wrong: ");
showLine();
}

public void startAnswerTest() {
showLine();
System.out.println(START_ANSWER_TEST);
showLine();
}

public void exitTest() {
System.out.println(EXIT_TEST);
showLine();
}

/**
* Displays the test result.
Expand Down

0 comments on commit 89eed16

Please sign in to comment.