From 654107f920525934addf3144e26d4d3ad7e0c857 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 00:12:51 +0800 Subject: [PATCH 01/27] add new boolean for command result - shhh, no one saw this commit... --- .../address/logic/commands/AnswerCommand.java | 4 ++-- .../address/logic/commands/ChangeCommand.java | 4 ++-- .../address/logic/commands/CommandResult.java | 17 +++++++++++++++-- .../logic/commands/DeleteFolderCommand.java | 2 +- .../address/logic/commands/EndCommand.java | 2 +- .../address/logic/commands/ExitCommand.java | 2 +- .../address/logic/commands/HelpCommand.java | 2 +- .../address/logic/commands/TestCommand.java | 2 +- 8 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/AnswerCommand.java b/src/main/java/seedu/address/logic/commands/AnswerCommand.java index 28eee874e4c8..efc5bfb7961e 100755 --- a/src/main/java/seedu/address/logic/commands/AnswerCommand.java +++ b/src/main/java/seedu/address/logic/commands/AnswerCommand.java @@ -55,10 +55,10 @@ public CommandResult execute(Model model, CommandHistory history) throws Command model.commitActiveCardFolder(); if (isAttemptCorrect) { return new CommandResult(MESSAGE_ANSWER_SUCCESS, false, false, false, false, null, - false, AnswerCommandResultType.ANSWER_CORRECT); + false, false, AnswerCommandResultType.ANSWER_CORRECT); } else { return new CommandResult(MESSAGE_ANSWER_SUCCESS, false, false, false, false, null, - false, AnswerCommandResultType.ANSWER_WRONG); + false, false, AnswerCommandResultType.ANSWER_WRONG); } } diff --git a/src/main/java/seedu/address/logic/commands/ChangeCommand.java b/src/main/java/seedu/address/logic/commands/ChangeCommand.java index f84120f78f1e..b97a8afd99c3 100644 --- a/src/main/java/seedu/address/logic/commands/ChangeCommand.java +++ b/src/main/java/seedu/address/logic/commands/ChangeCommand.java @@ -53,7 +53,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command } model.exitFoldersToHome(); return new CommandResult(MESSAGE_EXIT_FOLDER_SUCCESS, - false, false, false, true, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); + false, false, false, true, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } else { if (model.isInFolder()) { throw new CommandException(Messages.MESSAGE_ILLEGAL_COMMAND_NOT_IN_HOME); @@ -64,7 +64,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command } model.setActiveCardFolderIndex(targetIndex.getZeroBased()); return new CommandResult(String.format(MESSAGE_ENTER_FOLDER_SUCCESS, targetIndex.getOneBased()), - false, false, true, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); + false, false, true, false, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } } diff --git a/src/main/java/seedu/address/logic/commands/CommandResult.java b/src/main/java/seedu/address/logic/commands/CommandResult.java index 83f60b4a239c..b0a3c154e560 100755 --- a/src/main/java/seedu/address/logic/commands/CommandResult.java +++ b/src/main/java/seedu/address/logic/commands/CommandResult.java @@ -34,6 +34,8 @@ public class CommandResult { /** The current test session should end. */ private final boolean endTestSession; + private final boolean inReport; + /** The application should show to user whether answer attempted is correct or wrong. */ private final AnswerCommandResultType answerCommandResult; @@ -42,12 +44,14 @@ public class CommandResult { */ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, boolean enteredFolder, boolean exitedFolder, - Card testSessionCard, boolean endTestSession, AnswerCommandResultType answerCommandResult) { + Card testSessionCard, boolean endTestSession, boolean inReport, + AnswerCommandResultType answerCommandResult) { this.feedbackToUser = requireNonNull(feedbackToUser); this.showHelp = showHelp; this.exit = exit; this.enteredFolder = enteredFolder; this.exitedFolder = exitedFolder; + this.inReport = inReport; this.testSessionCard = testSessionCard; this.endTestSession = endTestSession; this.answerCommandResult = answerCommandResult; @@ -58,7 +62,8 @@ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, * and other fields set to their default value. */ public CommandResult(String feedbackToUser) { - this(feedbackToUser, false, false, false, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); + this(feedbackToUser, false, false, false, false, null, false, false, + AnswerCommandResultType.NOT_ANSWER_COMMAND); } public String getFeedbackToUser() { @@ -77,6 +82,14 @@ public boolean isEndTestSession() { return endTestSession; } + public boolean isReport() { + return inReport; + } + + public boolean isEndReport() { + return !inReport; + } + /** * Check if command is to enter test session * @return a boolean variable to state if command is test or not diff --git a/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java b/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java index 0af7ae276f9f..20b3c7287e84 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java @@ -48,7 +48,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command model.deleteFolder(targetIndex.getZeroBased()); return new CommandResult(String.format(MESSAGE_DELETE_FOLDER_SUCCESS, cardFolderToDelete), - false, false, false, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); + false, false, false, false, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } @Override diff --git a/src/main/java/seedu/address/logic/commands/EndCommand.java b/src/main/java/seedu/address/logic/commands/EndCommand.java index 1693175a685f..f9f53d0e8869 100755 --- a/src/main/java/seedu/address/logic/commands/EndCommand.java +++ b/src/main/java/seedu/address/logic/commands/EndCommand.java @@ -22,7 +22,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command throw new CommandException(Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); } model.endTestSession(); - return new CommandResult(MESSAGE_END_TEST_SESSION_SUCCESS, false, false, false, false, null, true, + return new CommandResult(MESSAGE_END_TEST_SESSION_SUCCESS, false, false, false, false, null, true, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } diff --git a/src/main/java/seedu/address/logic/commands/ExitCommand.java b/src/main/java/seedu/address/logic/commands/ExitCommand.java index 0a96648a6cea..fbb49975b2d6 100755 --- a/src/main/java/seedu/address/logic/commands/ExitCommand.java +++ b/src/main/java/seedu/address/logic/commands/ExitCommand.java @@ -15,7 +15,7 @@ public class ExitCommand extends Command { @Override public CommandResult execute(Model model, CommandHistory history) { - return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true, false, false, null, false, + return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true, false, false, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } diff --git a/src/main/java/seedu/address/logic/commands/HelpCommand.java b/src/main/java/seedu/address/logic/commands/HelpCommand.java index e4aa6ead36c3..b7cad1af17b9 100755 --- a/src/main/java/seedu/address/logic/commands/HelpCommand.java +++ b/src/main/java/seedu/address/logic/commands/HelpCommand.java @@ -18,7 +18,7 @@ public class HelpCommand extends Command { @Override public CommandResult execute(Model model, CommandHistory history) { - return new CommandResult(SHOWING_HELP_MESSAGE, true, false, false, false, null, false, + return new CommandResult(SHOWING_HELP_MESSAGE, true, false, false, false, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } } diff --git a/src/main/java/seedu/address/logic/commands/TestCommand.java b/src/main/java/seedu/address/logic/commands/TestCommand.java index 3bd0276ec6b0..215de8350295 100755 --- a/src/main/java/seedu/address/logic/commands/TestCommand.java +++ b/src/main/java/seedu/address/logic/commands/TestCommand.java @@ -49,7 +49,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command model.setActiveCardFolderIndex(targetIndex.getZeroBased()); model.testCardFolder(targetIndex.getZeroBased()); Card cardToTest = model.getCurrentTestedCard(); - return new CommandResult(MESSAGE_ENTER_TEST_FOLDER_SUCCESS, false, false, false, false, cardToTest, false, + return new CommandResult(MESSAGE_ENTER_TEST_FOLDER_SUCCESS, false, false, false, false, cardToTest, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } From 1df86279e3aa36cbc0b2d4062fa30e8e1f4d4ffc Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 01:08:44 +0800 Subject: [PATCH 02/27] add initial report command - basic working --- .../address/logic/commands/ReportCommand.java | 24 +++++++++++++++ .../address/logic/parser/CommandParser.java | 4 +++ .../java/seedu/address/ui/MainWindow.java | 20 +++++++++++++ .../java/seedu/address/ui/ReportDisplay.java | 30 +++++++++++++++++++ src/main/resources/view/ReportDisplay.fxml | 11 +++++++ 5 files changed, 89 insertions(+) create mode 100755 src/main/java/seedu/address/logic/commands/ReportCommand.java create mode 100755 src/main/java/seedu/address/ui/ReportDisplay.java create mode 100755 src/main/resources/view/ReportDisplay.fxml diff --git a/src/main/java/seedu/address/logic/commands/ReportCommand.java b/src/main/java/seedu/address/logic/commands/ReportCommand.java new file mode 100755 index 000000000000..473857c754e8 --- /dev/null +++ b/src/main/java/seedu/address/logic/commands/ReportCommand.java @@ -0,0 +1,24 @@ +package seedu.address.logic.commands; + +import static java.util.Objects.requireNonNull; + +import seedu.address.logic.AnswerCommandResultType; +import seedu.address.logic.CommandHistory; +import seedu.address.model.Model; + +/** + * Display a report for a folder identified using it's displayed index from the card folder list. + */ +public class ReportCommand extends Command { + + public static final String COMMAND_WORD = "report"; + + public static final String MESSAGE_SUCCESS = "Report displayed"; + + @Override + public CommandResult execute(Model model, CommandHistory history) { + requireNonNull(model); + return new CommandResult(MESSAGE_SUCCESS, false, false, false, false, + null, false, true, AnswerCommandResultType.NOT_ANSWER_COMMAND); + } +} diff --git a/src/main/java/seedu/address/logic/parser/CommandParser.java b/src/main/java/seedu/address/logic/parser/CommandParser.java index d33a4716ebd2..c544f5932037 100755 --- a/src/main/java/seedu/address/logic/parser/CommandParser.java +++ b/src/main/java/seedu/address/logic/parser/CommandParser.java @@ -23,6 +23,7 @@ import seedu.address.logic.commands.ImportCommand; import seedu.address.logic.commands.ListCommand; import seedu.address.logic.commands.RedoCommand; +import seedu.address.logic.commands.ReportCommand; import seedu.address.logic.commands.SearchCommand; import seedu.address.logic.commands.SelectCommand; import seedu.address.logic.commands.SortCommand; @@ -82,6 +83,9 @@ public Command parseCommand(String userInput) throws ParseException { case TestCommand.COMMAND_WORD: return new TestCommandParser().parse(arguments); + case ReportCommand.COMMAND_WORD: + return new ReportCommand(); + case AnswerCommand.COMMAND_WORD: return new AnswerCommandParser().parse(arguments); diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index dda0e48eae1c..7490d03a46f3 100755 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -36,6 +36,7 @@ public class MainWindow extends UiPart { private BrowserPanel browserPanel; private FolderListPanel folderListPanel; private CardListPanel cardListPanel; + private ReportDisplay reportDisplay; private ResultDisplay resultDisplay; private HelpWindow helpWindow; private CardMainScreen cardMainScreen; @@ -202,6 +203,16 @@ private void handleExitFolder() { folderListPanel.refreshContent(); } + private void handleReport() { + reportDisplay = new ReportDisplay(); + Region reportRegion = (reportDisplay).getRoot(); + fullScreenPlaceholder.getChildren().add(reportRegion); + } + + private void handleEndReport() { + fullScreenPlaceholder.getChildren().remove(fullScreenPlaceholder.getChildren().size() - 1); + } + /** * Show the page with correct answer. @@ -256,6 +267,15 @@ private CommandResult executeCommand(String commandText) throws CommandException handleExitFolder(); } + if (commandResult.isReport()) { + handleReport(); + } + + if (commandResult.isEndReport()) { + handleEndReport(); + } + + if (commandResult.isTestSession()) { handleStartTestSession(commandResult.getTestSessionCard()); } diff --git a/src/main/java/seedu/address/ui/ReportDisplay.java b/src/main/java/seedu/address/ui/ReportDisplay.java new file mode 100755 index 000000000000..c2c5cffa5676 --- /dev/null +++ b/src/main/java/seedu/address/ui/ReportDisplay.java @@ -0,0 +1,30 @@ +package seedu.address.ui; + +import javafx.fxml.FXML; +import javafx.scene.control.Label; +import javafx.scene.layout.GridPane; +import javafx.scene.layout.Region; +import seedu.address.model.card.Card; + +/** + * An UI component when user enters a test session. + */ +public class ReportDisplay extends UiPart { + + private static final String FXML = "ReportDisplay.fxml"; + + @FXML + private GridPane reportDisplay; + + @FXML + private Label message; + + public ReportDisplay() { + super(FXML); + reportDisplay.getChildren().clear(); + message.setText("Hello fucking."); + reportDisplay.getChildren().add(message); + + } +} + diff --git a/src/main/resources/view/ReportDisplay.fxml b/src/main/resources/view/ReportDisplay.fxml new file mode 100755 index 000000000000..d7ca8d464eca --- /dev/null +++ b/src/main/resources/view/ReportDisplay.fxml @@ -0,0 +1,11 @@ + + + + + + + + + + From 7a5d134fee95f7e34ff4bc8e44bf00cdc79a9ef2 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 11:58:31 +0800 Subject: [PATCH 03/27] Revert "add new boolean for command result" This reverts commit 654107f920525934addf3144e26d4d3ad7e0c857. --- .../address/logic/commands/AnswerCommand.java | 4 ++-- .../address/logic/commands/ChangeCommand.java | 4 ++-- .../address/logic/commands/CommandResult.java | 17 ++--------------- .../logic/commands/DeleteFolderCommand.java | 2 +- .../address/logic/commands/EndCommand.java | 2 +- .../address/logic/commands/ExitCommand.java | 2 +- .../address/logic/commands/HelpCommand.java | 2 +- .../address/logic/commands/TestCommand.java | 2 +- 8 files changed, 11 insertions(+), 24 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/AnswerCommand.java b/src/main/java/seedu/address/logic/commands/AnswerCommand.java index efc5bfb7961e..28eee874e4c8 100755 --- a/src/main/java/seedu/address/logic/commands/AnswerCommand.java +++ b/src/main/java/seedu/address/logic/commands/AnswerCommand.java @@ -55,10 +55,10 @@ public CommandResult execute(Model model, CommandHistory history) throws Command model.commitActiveCardFolder(); if (isAttemptCorrect) { return new CommandResult(MESSAGE_ANSWER_SUCCESS, false, false, false, false, null, - false, false, AnswerCommandResultType.ANSWER_CORRECT); + false, AnswerCommandResultType.ANSWER_CORRECT); } else { return new CommandResult(MESSAGE_ANSWER_SUCCESS, false, false, false, false, null, - false, false, AnswerCommandResultType.ANSWER_WRONG); + false, AnswerCommandResultType.ANSWER_WRONG); } } diff --git a/src/main/java/seedu/address/logic/commands/ChangeCommand.java b/src/main/java/seedu/address/logic/commands/ChangeCommand.java index b97a8afd99c3..f84120f78f1e 100644 --- a/src/main/java/seedu/address/logic/commands/ChangeCommand.java +++ b/src/main/java/seedu/address/logic/commands/ChangeCommand.java @@ -53,7 +53,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command } model.exitFoldersToHome(); return new CommandResult(MESSAGE_EXIT_FOLDER_SUCCESS, - false, false, false, true, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); + false, false, false, true, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } else { if (model.isInFolder()) { throw new CommandException(Messages.MESSAGE_ILLEGAL_COMMAND_NOT_IN_HOME); @@ -64,7 +64,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command } model.setActiveCardFolderIndex(targetIndex.getZeroBased()); return new CommandResult(String.format(MESSAGE_ENTER_FOLDER_SUCCESS, targetIndex.getOneBased()), - false, false, true, false, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); + false, false, true, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } } diff --git a/src/main/java/seedu/address/logic/commands/CommandResult.java b/src/main/java/seedu/address/logic/commands/CommandResult.java index b0a3c154e560..83f60b4a239c 100755 --- a/src/main/java/seedu/address/logic/commands/CommandResult.java +++ b/src/main/java/seedu/address/logic/commands/CommandResult.java @@ -34,8 +34,6 @@ public class CommandResult { /** The current test session should end. */ private final boolean endTestSession; - private final boolean inReport; - /** The application should show to user whether answer attempted is correct or wrong. */ private final AnswerCommandResultType answerCommandResult; @@ -44,14 +42,12 @@ public class CommandResult { */ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, boolean enteredFolder, boolean exitedFolder, - Card testSessionCard, boolean endTestSession, boolean inReport, - AnswerCommandResultType answerCommandResult) { + Card testSessionCard, boolean endTestSession, AnswerCommandResultType answerCommandResult) { this.feedbackToUser = requireNonNull(feedbackToUser); this.showHelp = showHelp; this.exit = exit; this.enteredFolder = enteredFolder; this.exitedFolder = exitedFolder; - this.inReport = inReport; this.testSessionCard = testSessionCard; this.endTestSession = endTestSession; this.answerCommandResult = answerCommandResult; @@ -62,8 +58,7 @@ public CommandResult(String feedbackToUser, boolean showHelp, boolean exit, * and other fields set to their default value. */ public CommandResult(String feedbackToUser) { - this(feedbackToUser, false, false, false, false, null, false, false, - AnswerCommandResultType.NOT_ANSWER_COMMAND); + this(feedbackToUser, false, false, false, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } public String getFeedbackToUser() { @@ -82,14 +77,6 @@ public boolean isEndTestSession() { return endTestSession; } - public boolean isReport() { - return inReport; - } - - public boolean isEndReport() { - return !inReport; - } - /** * Check if command is to enter test session * @return a boolean variable to state if command is test or not diff --git a/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java b/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java index 20b3c7287e84..0af7ae276f9f 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteFolderCommand.java @@ -48,7 +48,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command model.deleteFolder(targetIndex.getZeroBased()); return new CommandResult(String.format(MESSAGE_DELETE_FOLDER_SUCCESS, cardFolderToDelete), - false, false, false, false, null, false, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); + false, false, false, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } @Override diff --git a/src/main/java/seedu/address/logic/commands/EndCommand.java b/src/main/java/seedu/address/logic/commands/EndCommand.java index f9f53d0e8869..1693175a685f 100755 --- a/src/main/java/seedu/address/logic/commands/EndCommand.java +++ b/src/main/java/seedu/address/logic/commands/EndCommand.java @@ -22,7 +22,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command throw new CommandException(Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); } model.endTestSession(); - return new CommandResult(MESSAGE_END_TEST_SESSION_SUCCESS, false, false, false, false, null, true, false, + return new CommandResult(MESSAGE_END_TEST_SESSION_SUCCESS, false, false, false, false, null, true, AnswerCommandResultType.NOT_ANSWER_COMMAND); } diff --git a/src/main/java/seedu/address/logic/commands/ExitCommand.java b/src/main/java/seedu/address/logic/commands/ExitCommand.java index fbb49975b2d6..0a96648a6cea 100755 --- a/src/main/java/seedu/address/logic/commands/ExitCommand.java +++ b/src/main/java/seedu/address/logic/commands/ExitCommand.java @@ -15,7 +15,7 @@ public class ExitCommand extends Command { @Override public CommandResult execute(Model model, CommandHistory history) { - return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true, false, false, null, false, false, + return new CommandResult(MESSAGE_EXIT_ACKNOWLEDGEMENT, false, true, false, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } diff --git a/src/main/java/seedu/address/logic/commands/HelpCommand.java b/src/main/java/seedu/address/logic/commands/HelpCommand.java index b7cad1af17b9..e4aa6ead36c3 100755 --- a/src/main/java/seedu/address/logic/commands/HelpCommand.java +++ b/src/main/java/seedu/address/logic/commands/HelpCommand.java @@ -18,7 +18,7 @@ public class HelpCommand extends Command { @Override public CommandResult execute(Model model, CommandHistory history) { - return new CommandResult(SHOWING_HELP_MESSAGE, true, false, false, false, null, false, false, + return new CommandResult(SHOWING_HELP_MESSAGE, true, false, false, false, null, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } } diff --git a/src/main/java/seedu/address/logic/commands/TestCommand.java b/src/main/java/seedu/address/logic/commands/TestCommand.java index 215de8350295..3bd0276ec6b0 100755 --- a/src/main/java/seedu/address/logic/commands/TestCommand.java +++ b/src/main/java/seedu/address/logic/commands/TestCommand.java @@ -49,7 +49,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command model.setActiveCardFolderIndex(targetIndex.getZeroBased()); model.testCardFolder(targetIndex.getZeroBased()); Card cardToTest = model.getCurrentTestedCard(); - return new CommandResult(MESSAGE_ENTER_TEST_FOLDER_SUCCESS, false, false, false, false, cardToTest, false, false, + return new CommandResult(MESSAGE_ENTER_TEST_FOLDER_SUCCESS, false, false, false, false, cardToTest, false, AnswerCommandResultType.NOT_ANSWER_COMMAND); } From d1f25a3a506705c7d6991001d0d15ea6c2ca67c1 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 12:30:57 +0800 Subject: [PATCH 04/27] add bool to detect in test session in model --- src/main/java/seedu/address/model/Model.java | 4 ++++ .../java/seedu/address/model/ModelManager.java | 16 ++++++++++++++++ .../seedu/address/model/card/UniqueCardList.java | 6 ------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index 5a4535bfe120..67c39b7fba19 100755 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -237,6 +237,10 @@ public interface Model extends Observable { */ boolean checkIfCardAlreadyAnswered(); + boolean inReportDisplay(); + + void setInReportDisplay(); + void exportCardFolders(Set cardFolderExports, CsvFile csvFile) throws IOException; void importCardFolders(CsvFile csvFile) throws IOException; diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index 0b2e46e4103f..7988fb2fc0e2 100755 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -55,6 +55,9 @@ public class ModelManager implements Model { private boolean cardAlreadyAnswered = false; private int numAnsweredCorrectly = 0; + // Report display related + private boolean inReportDisplay = false; + // Export related private CsvManager csvManager = new CsvManager(); @@ -316,6 +319,19 @@ public void commitActiveCardFolder() { versionedCardFolder.commit(); } + //=========== Report Displayed ======================================================================= + @Override + public boolean inReportDisplay() { + return inReportDisplay; + } + + @Override + public void setInReportDisplay() { + inReportDisplay = !inReportDisplay; + } + + + //=========== Test Session =========================================================================== @Override diff --git a/src/main/java/seedu/address/model/card/UniqueCardList.java b/src/main/java/seedu/address/model/card/UniqueCardList.java index 52f2c5a253c6..36bd0201e1be 100644 --- a/src/main/java/seedu/address/model/card/UniqueCardList.java +++ b/src/main/java/seedu/address/model/card/UniqueCardList.java @@ -14,16 +14,10 @@ /** * A list of cards that enforces uniqueness between its elements and does not allow nulls. -<<<<<<< HEAD - * A card is considered unique by comparing using {@code Card#equals(Card)}. As such, adding and updating of - * cards uses Card#equals(Card) for equality so as to ensure that the card being added or updated is - * unique in terms of identity in the UniqueCardList. -======= * A card is considered unique by comparing using {@code Card#isSameCard(Card)}. As such, adding and updating of * cards uses Card#isSameCard(Card) for equality so as to ensure that the card being added or updated is * unique in terms of identity in the UniqueCardList. However, the removal of a card uses Card#equals(Object) so * as to ensure that the card with exactly the same fields will be removed. ->>>>>>> parent of 76f8cb02... replace all isSameCard with equal * * Supports a minimal set of list operations. * From b56ae54a4dcff350242637879494256f3fa43312 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 12:31:33 +0800 Subject: [PATCH 05/27] add support for END so that can end report too - since report will be displayed in fullscreen, i thought that might as well use the END command to exit the screen as well --- .../seedu/address/logic/commands/EndCommand.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/EndCommand.java b/src/main/java/seedu/address/logic/commands/EndCommand.java index babb980aac5d..a00e3f273e87 100755 --- a/src/main/java/seedu/address/logic/commands/EndCommand.java +++ b/src/main/java/seedu/address/logic/commands/EndCommand.java @@ -14,14 +14,23 @@ public class EndCommand extends Command { public static final String COMMAND_WORD = "end"; public static final String MESSAGE_END_TEST_SESSION_SUCCESS = "End test session"; + public static final String MESSAGE_END_REPORT_DISPLAY_SUCCESS = "End report display"; + @Override public CommandResult execute(Model model, CommandHistory history) throws CommandException { - if (!model.checkIfInsideTestSession()) { + if (!model.checkIfInsideTestSession() && !model.inReportDisplay()) { throw new CommandException(Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); } - model.endTestSession(); - return new CommandResult(MESSAGE_END_TEST_SESSION_SUCCESS, CommandResult.Type.END_TEST_SESSION); + + if (model.checkIfInsideTestSession()) { + model.endTestSession(); + return new CommandResult(MESSAGE_END_TEST_SESSION_SUCCESS, CommandResult.Type.END_TEST_SESSION); + } else { + model.setInReportDisplay(); + return new CommandResult(MESSAGE_END_REPORT_DISPLAY_SUCCESS, CommandResult.Type.EXITED_REPORT); + } + } } From c42218b9019491d2dd3bb3100c921d4be77bbe89 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 12:32:29 +0800 Subject: [PATCH 06/27] add new commandresult for entering exiting report --- .../java/seedu/address/logic/commands/CommandResult.java | 2 ++ .../java/seedu/address/logic/commands/ReportCommand.java | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/CommandResult.java b/src/main/java/seedu/address/logic/commands/CommandResult.java index ec20e2b98e0e..749cb1b2abe7 100755 --- a/src/main/java/seedu/address/logic/commands/CommandResult.java +++ b/src/main/java/seedu/address/logic/commands/CommandResult.java @@ -25,6 +25,8 @@ public enum Type { END_TEST_SESSION, // The current test session should end. ANSWER_CORRECT, ANSWER_WRONG, + ENTERED_REPORT, + EXITED_REPORT, NONE // use for "nothing to do" } diff --git a/src/main/java/seedu/address/logic/commands/ReportCommand.java b/src/main/java/seedu/address/logic/commands/ReportCommand.java index 473857c754e8..3f7921476c97 100755 --- a/src/main/java/seedu/address/logic/commands/ReportCommand.java +++ b/src/main/java/seedu/address/logic/commands/ReportCommand.java @@ -2,7 +2,6 @@ import static java.util.Objects.requireNonNull; -import seedu.address.logic.AnswerCommandResultType; import seedu.address.logic.CommandHistory; import seedu.address.model.Model; @@ -18,7 +17,7 @@ public class ReportCommand extends Command { @Override public CommandResult execute(Model model, CommandHistory history) { requireNonNull(model); - return new CommandResult(MESSAGE_SUCCESS, false, false, false, false, - null, false, true, AnswerCommandResultType.NOT_ANSWER_COMMAND); + model.setInReportDisplay(); + return new CommandResult(MESSAGE_SUCCESS, CommandResult.Type.ENTERED_REPORT); } } From fbcbb8b2fda40b88e6eed0d240b2be2a08d88076 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 12:56:49 +0800 Subject: [PATCH 07/27] change error messages --- src/main/java/seedu/address/commons/core/Messages.java | 2 +- src/main/java/seedu/address/logic/commands/AnswerCommand.java | 2 +- src/main/java/seedu/address/logic/commands/EndCommand.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/address/commons/core/Messages.java b/src/main/java/seedu/address/commons/core/Messages.java index 784aaefc31de..10611db1a8dc 100755 --- a/src/main/java/seedu/address/commons/core/Messages.java +++ b/src/main/java/seedu/address/commons/core/Messages.java @@ -10,7 +10,7 @@ public class Messages { public static final String MESSAGE_INVALID_CARD_DISPLAYED_INDEX = "The card index provided is invalid"; public static final String MESSAGE_INVALID_FOLDER_DISPLAYED_INDEX = "The card folder index provided is invalid"; public static final String MESSAGE_CARDS_LISTED_OVERVIEW = "%1$d cards listed!"; - public static final String MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION = "This command is not valid outside a test" + public static final String MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN = "This command is not valid outside a test or report" + " session"; public static final String MESSAGE_INVALID_COMMAND_INSIDE_TEST_SESSION = "This command is not valid inside a test" + " session"; diff --git a/src/main/java/seedu/address/logic/commands/AnswerCommand.java b/src/main/java/seedu/address/logic/commands/AnswerCommand.java index 61637e389e28..a798eb66389c 100755 --- a/src/main/java/seedu/address/logic/commands/AnswerCommand.java +++ b/src/main/java/seedu/address/logic/commands/AnswerCommand.java @@ -38,7 +38,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command requireNonNull(model); if (!model.checkIfInsideTestSession()) { - throw new CommandException(Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); + throw new CommandException(Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN); } if (model.checkIfCardAlreadyAnswered()) { throw new CommandException(Messages.MESSAGE_INVALID_ANSWER_COMMAND); diff --git a/src/main/java/seedu/address/logic/commands/EndCommand.java b/src/main/java/seedu/address/logic/commands/EndCommand.java index a00e3f273e87..68eb63c2f4cd 100755 --- a/src/main/java/seedu/address/logic/commands/EndCommand.java +++ b/src/main/java/seedu/address/logic/commands/EndCommand.java @@ -20,7 +20,7 @@ public class EndCommand extends Command { @Override public CommandResult execute(Model model, CommandHistory history) throws CommandException { if (!model.checkIfInsideTestSession() && !model.inReportDisplay()) { - throw new CommandException(Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); + throw new CommandException(Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN); } if (model.checkIfInsideTestSession()) { From 326d1d6c4d78309d2ee6ff7f2370a30bd69eb6d9 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 13:01:20 +0800 Subject: [PATCH 08/27] refactor model checking if in report --- .../java/seedu/address/logic/commands/EndCommand.java | 2 +- .../java/seedu/address/logic/commands/ReportCommand.java | 2 +- src/main/java/seedu/address/model/Model.java | 4 +++- src/main/java/seedu/address/model/ModelManager.java | 9 +++++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/EndCommand.java b/src/main/java/seedu/address/logic/commands/EndCommand.java index 68eb63c2f4cd..c9a09bf187e3 100755 --- a/src/main/java/seedu/address/logic/commands/EndCommand.java +++ b/src/main/java/seedu/address/logic/commands/EndCommand.java @@ -27,7 +27,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command model.endTestSession(); return new CommandResult(MESSAGE_END_TEST_SESSION_SUCCESS, CommandResult.Type.END_TEST_SESSION); } else { - model.setInReportDisplay(); + model.exitReportDisplay(); return new CommandResult(MESSAGE_END_REPORT_DISPLAY_SUCCESS, CommandResult.Type.EXITED_REPORT); } diff --git a/src/main/java/seedu/address/logic/commands/ReportCommand.java b/src/main/java/seedu/address/logic/commands/ReportCommand.java index 3f7921476c97..e34c8ffc8b36 100755 --- a/src/main/java/seedu/address/logic/commands/ReportCommand.java +++ b/src/main/java/seedu/address/logic/commands/ReportCommand.java @@ -17,7 +17,7 @@ public class ReportCommand extends Command { @Override public CommandResult execute(Model model, CommandHistory history) { requireNonNull(model); - model.setInReportDisplay(); + model.enterReportDisplay(); return new CommandResult(MESSAGE_SUCCESS, CommandResult.Type.ENTERED_REPORT); } } diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index 67c39b7fba19..092f37312f39 100755 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -239,7 +239,9 @@ public interface Model extends Observable { boolean inReportDisplay(); - void setInReportDisplay(); + void enterReportDisplay(); + void exitReportDisplay(); + void exportCardFolders(Set cardFolderExports, CsvFile csvFile) throws IOException; diff --git a/src/main/java/seedu/address/model/ModelManager.java b/src/main/java/seedu/address/model/ModelManager.java index 7988fb2fc0e2..f9f12e154d45 100755 --- a/src/main/java/seedu/address/model/ModelManager.java +++ b/src/main/java/seedu/address/model/ModelManager.java @@ -326,8 +326,13 @@ public boolean inReportDisplay() { } @Override - public void setInReportDisplay() { - inReportDisplay = !inReportDisplay; + public void enterReportDisplay() { + inReportDisplay = true; + } + + @Override + public void exitReportDisplay() { + inReportDisplay = false; } From 9e67e2fad3de456615fc5aa595f0e0c27fbfe468 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 14:23:40 +0800 Subject: [PATCH 09/27] add basic graph function --- .../java/seedu/address/ui/ReportDisplay.java | 49 +++++++++++++++++-- src/main/resources/view/ReportDisplay.fxml | 19 ++++++- 2 files changed, 63 insertions(+), 5 deletions(-) diff --git a/src/main/java/seedu/address/ui/ReportDisplay.java b/src/main/java/seedu/address/ui/ReportDisplay.java index c2c5cffa5676..ecc46b57b7be 100755 --- a/src/main/java/seedu/address/ui/ReportDisplay.java +++ b/src/main/java/seedu/address/ui/ReportDisplay.java @@ -1,9 +1,16 @@ package seedu.address.ui; +import java.util.List; + +import javafx.collections.ObservableList; import javafx.fxml.FXML; +import javafx.scene.chart.XYChart; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.Region; +import javafx.scene.chart.AreaChart; +import seedu.address.model.CardFolder; +import seedu.address.model.ReadOnlyCardFolder; import seedu.address.model.card.Card; /** @@ -17,14 +24,48 @@ public class ReportDisplay extends UiPart { private GridPane reportDisplay; @FXML - private Label message; + private Label questionsDisplay; + + @FXML + private AreaChart graph; - public ReportDisplay() { + @FXML + private Label folderName; + + public ReportDisplay(ReadOnlyCardFolder cardFolder) { super(FXML); + + displayTitle(cardFolder.getFolderName(), cardFolder.getFolderScores().size()); + displayGraph(cardFolder.getFolderScores()); + displayQuestions(cardFolder.getCardList()); + reportDisplay.getChildren().clear(); - message.setText("Hello fucking."); - reportDisplay.getChildren().add(message); + reportDisplay.getChildren().add(folderName); + reportDisplay.getChildren().add(graph); + reportDisplay.getChildren().add(questionsDisplay); + + } + + private void displayGraph(List folderScores) { + final XYChart.Series series = new XYChart.Series<>(); + for (int x = 0; x < folderScores.size(); x = x + 1) { + series.getData().add(new XYChart.Data(x, folderScores.get(x))); + } + graph.getData().add(series); + } + + private void displayQuestions(ObservableList cards) { + String result = ""; + for (Card card: cards) { + result += card.getQuestion() + " "; + result += card.getScore(); + result += "\n"; + } + questionsDisplay.setText(result); + } + private void displayTitle(String name, int numScores) { + folderName.setText("Report for " + name + "\nLast " + numScores + " scores"); } } diff --git a/src/main/resources/view/ReportDisplay.fxml b/src/main/resources/view/ReportDisplay.fxml index d7ca8d464eca..a20eae0f1b05 100755 --- a/src/main/resources/view/ReportDisplay.fxml +++ b/src/main/resources/view/ReportDisplay.fxml @@ -2,9 +2,26 @@ + + + + - From 02fd5caa274578bac1bcde6bc278e08ec46d9225 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 14:23:52 +0800 Subject: [PATCH 10/27] add new param to tell which cardfolder to report --- src/main/java/seedu/address/ui/MainWindow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index e25f8a04aa01..cd094a1259ea 100755 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -204,7 +204,7 @@ private void handleExitFolder() { } private void handleReport() { - reportDisplay = new ReportDisplay(); + reportDisplay = new ReportDisplay(logic.getCardFolder()); Region reportRegion = (reportDisplay).getRoot(); fullScreenPlaceholder.getChildren().add(reportRegion); } From 959e6e721d71335cbf789c66cc72a59343818b7a Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 14:30:24 +0800 Subject: [PATCH 11/27] fix bugs --- src/main/java/seedu/address/ui/ReportDisplay.java | 3 ++- src/main/resources/view/ReportDisplay.fxml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/seedu/address/ui/ReportDisplay.java b/src/main/java/seedu/address/ui/ReportDisplay.java index ecc46b57b7be..dffa2b3b295b 100755 --- a/src/main/java/seedu/address/ui/ReportDisplay.java +++ b/src/main/java/seedu/address/ui/ReportDisplay.java @@ -47,7 +47,8 @@ public ReportDisplay(ReadOnlyCardFolder cardFolder) { } private void displayGraph(List folderScores) { - final XYChart.Series series = new XYChart.Series<>(); + graph.getData().clear(); + XYChart.Series series = new XYChart.Series<>(); for (int x = 0; x < folderScores.size(); x = x + 1) { series.getData().add(new XYChart.Data(x, folderScores.get(x))); } diff --git a/src/main/resources/view/ReportDisplay.fxml b/src/main/resources/view/ReportDisplay.fxml index a20eae0f1b05..4527bd461893 100755 --- a/src/main/resources/view/ReportDisplay.fxml +++ b/src/main/resources/view/ReportDisplay.fxml @@ -12,10 +12,10 @@ - + - + From be2a5c5a823a745bf182d5cfc5776345aea49ea8 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 21:44:47 +0800 Subject: [PATCH 12/27] abstract some methods out --- .../seedu/address/commons/core/Messages.java | 3 +- src/main/java/seedu/address/model/Model.java | 2 +- .../java/seedu/address/ui/ReportDisplay.java | 30 ++++++++++++++----- 3 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/main/java/seedu/address/commons/core/Messages.java b/src/main/java/seedu/address/commons/core/Messages.java index 10611db1a8dc..a2ee4b0c955b 100755 --- a/src/main/java/seedu/address/commons/core/Messages.java +++ b/src/main/java/seedu/address/commons/core/Messages.java @@ -10,7 +10,8 @@ public class Messages { public static final String MESSAGE_INVALID_CARD_DISPLAYED_INDEX = "The card index provided is invalid"; public static final String MESSAGE_INVALID_FOLDER_DISPLAYED_INDEX = "The card folder index provided is invalid"; public static final String MESSAGE_CARDS_LISTED_OVERVIEW = "%1$d cards listed!"; - public static final String MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN = "This command is not valid outside a test or report" + public static final String MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN = "This command is not valid outside a test" + + " or report" + " session"; public static final String MESSAGE_INVALID_COMMAND_INSIDE_TEST_SESSION = "This command is not valid inside a test" + " session"; diff --git a/src/main/java/seedu/address/model/Model.java b/src/main/java/seedu/address/model/Model.java index 092f37312f39..37c236104514 100755 --- a/src/main/java/seedu/address/model/Model.java +++ b/src/main/java/seedu/address/model/Model.java @@ -240,8 +240,8 @@ public interface Model extends Observable { boolean inReportDisplay(); void enterReportDisplay(); - void exitReportDisplay(); + void exitReportDisplay(); void exportCardFolders(Set cardFolderExports, CsvFile csvFile) throws IOException; diff --git a/src/main/java/seedu/address/ui/ReportDisplay.java b/src/main/java/seedu/address/ui/ReportDisplay.java index dffa2b3b295b..d02a5fb1c781 100755 --- a/src/main/java/seedu/address/ui/ReportDisplay.java +++ b/src/main/java/seedu/address/ui/ReportDisplay.java @@ -4,12 +4,11 @@ import javafx.collections.ObservableList; import javafx.fxml.FXML; +import javafx.scene.chart.AreaChart; import javafx.scene.chart.XYChart; import javafx.scene.control.Label; import javafx.scene.layout.GridPane; import javafx.scene.layout.Region; -import javafx.scene.chart.AreaChart; -import seedu.address.model.CardFolder; import seedu.address.model.ReadOnlyCardFolder; import seedu.address.model.card.Card; @@ -32,20 +31,29 @@ public class ReportDisplay extends UiPart { @FXML private Label folderName; + @FXML + private Label tagLine; + public ReportDisplay(ReadOnlyCardFolder cardFolder) { super(FXML); - displayTitle(cardFolder.getFolderName(), cardFolder.getFolderScores().size()); + displayTitle(cardFolder.getFolderName()); displayGraph(cardFolder.getFolderScores()); displayQuestions(cardFolder.getCardList()); + displayTagLine("Last " + cardFolder.getCardList().size() + " scores, latest on the right"); reportDisplay.getChildren().clear(); reportDisplay.getChildren().add(folderName); + reportDisplay.getChildren().add(tagLine); reportDisplay.getChildren().add(graph); reportDisplay.getChildren().add(questionsDisplay); } + /** + * Adds the list of folderScores (as the Y values) to a graph. + * @param folderScores List of Double scores to be added + */ private void displayGraph(List folderScores) { graph.getData().clear(); XYChart.Series series = new XYChart.Series<>(); @@ -55,18 +63,26 @@ private void displayGraph(List folderScores) { graph.getData().add(series); } + /** + * Concatenate the questions and their scores to be added below the graph. + * @param cards To be concatenated. + */ private void displayQuestions(ObservableList cards) { String result = ""; for (Card card: cards) { - result += card.getQuestion() + " "; - result += card.getScore(); + result += "Question: " + card.getQuestion() + " | "; + result += "Score: " + card.getScore(); result += "\n"; } questionsDisplay.setText(result); } - private void displayTitle(String name, int numScores) { - folderName.setText("Report for " + name + "\nLast " + numScores + " scores"); + private void displayTitle(String name) { + folderName.setText("Report for " + name); + } + + private void displayTagLine(String string) { + tagLine.setText(string); } } From a0f6953f44847158b61b36e3aac6a796894f156e Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 21:45:02 +0800 Subject: [PATCH 13/27] add new label fields --- src/main/resources/view/ReportDisplay.fxml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/resources/view/ReportDisplay.fxml b/src/main/resources/view/ReportDisplay.fxml index 4527bd461893..b1102dfc2be8 100755 --- a/src/main/resources/view/ReportDisplay.fxml +++ b/src/main/resources/view/ReportDisplay.fxml @@ -10,7 +10,9 @@ - + + @@ -21,7 +23,7 @@ - From 75ebaa7f8bda6e10c59475ae4f5ed91eec243af5 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 21:45:35 +0800 Subject: [PATCH 14/27] add model stubs --- .../address/logic/commands/AddCommandTest.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/seedu/address/logic/commands/AddCommandTest.java b/src/test/java/seedu/address/logic/commands/AddCommandTest.java index 0501e39eb7d4..a6f559fbd43f 100755 --- a/src/test/java/seedu/address/logic/commands/AddCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/AddCommandTest.java @@ -196,6 +196,21 @@ public boolean checkIfCardAlreadyAnswered() { throw new AssertionError("This method should not be called."); } + @Override + public boolean inReportDisplay() { + throw new AssertionError("This method should not be called."); + }; + + @Override + public void enterReportDisplay() { + throw new AssertionError("This method should not be called."); + }; + + @Override + public void exitReportDisplay() { + throw new AssertionError("This method should not be called."); + }; + @Override public void exportCardFolders(Set cardFolderExports, CsvFile csvFile) throws IOException { throw new AssertionError("This method should not be called."); From faa22081a8e152c08d17add439801f6543d88760 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 21:45:41 +0800 Subject: [PATCH 15/27] fix renaming of warning messages --- .../java/seedu/address/logic/commands/AnswerCommandTest.java | 4 ++-- .../java/seedu/address/logic/commands/EndCommandTest.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/seedu/address/logic/commands/AnswerCommandTest.java b/src/test/java/seedu/address/logic/commands/AnswerCommandTest.java index 423185514626..eabfcbb848fc 100755 --- a/src/test/java/seedu/address/logic/commands/AnswerCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/AnswerCommandTest.java @@ -3,7 +3,7 @@ import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import static seedu.address.commons.core.Messages.MESSAGE_INVALID_ANSWER_COMMAND; -import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION; +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN; import static seedu.address.logic.commands.CommandTestUtil.VALID_ANSWER_1; import static seedu.address.logic.commands.CommandTestUtil.VALID_ANSWER_2; import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure; @@ -98,7 +98,7 @@ public void execute_wrongAnswerAttempt_markWrong() { @Test public void execute_invalidAnswerOutsideTestSession_fail() { - String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); + String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN); AnswerCommand answerCommand = new AnswerCommand(new Answer(VALID_ANSWER_2)); assertCommandFailure(answerCommand, model, commandHistory, expectedMessage); } diff --git a/src/test/java/seedu/address/logic/commands/EndCommandTest.java b/src/test/java/seedu/address/logic/commands/EndCommandTest.java index 8b040490cbf4..b3882cd19864 100755 --- a/src/test/java/seedu/address/logic/commands/EndCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/EndCommandTest.java @@ -1,6 +1,6 @@ package seedu.address.logic.commands; -import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION; +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN; import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure; import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; import static seedu.address.logic.commands.EndCommand.MESSAGE_END_TEST_SESSION_SUCCESS; @@ -36,7 +36,7 @@ public void execute_endTestSession_success() { @Test public void execute_endTestSession_fail() { - String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); + String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN); assertCommandFailure(new EndCommand(), model, commandHistory, expectedMessage); } } From d429e2890d5aa98fc9518206e418c6009a2980a1 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 21:59:41 +0800 Subject: [PATCH 16/27] add exception for using report command in report --- src/main/java/seedu/address/commons/core/Messages.java | 2 ++ .../java/seedu/address/logic/commands/ReportCommand.java | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/commons/core/Messages.java b/src/main/java/seedu/address/commons/core/Messages.java index a2ee4b0c955b..b1675e0178ff 100755 --- a/src/main/java/seedu/address/commons/core/Messages.java +++ b/src/main/java/seedu/address/commons/core/Messages.java @@ -15,6 +15,8 @@ public class Messages { + " session"; public static final String MESSAGE_INVALID_COMMAND_INSIDE_TEST_SESSION = "This command is not valid inside a test" + " session"; + public static final String MESSAGE_INVALID_COMMAND_INSIDE_REPORT = "This command is not valid while displaying a " + + "report"; public static final String MESSAGE_INVALID_ANSWER_COMMAND = "Answer command is valid only when a question is " + "displayed"; public static final String MESSAGE_ILLEGAL_COMMAND_NOT_IN_FOLDER = "Command can only be executed in folder"; diff --git a/src/main/java/seedu/address/logic/commands/ReportCommand.java b/src/main/java/seedu/address/logic/commands/ReportCommand.java index e34c8ffc8b36..29c622726a1f 100755 --- a/src/main/java/seedu/address/logic/commands/ReportCommand.java +++ b/src/main/java/seedu/address/logic/commands/ReportCommand.java @@ -1,8 +1,10 @@ package seedu.address.logic.commands; import static java.util.Objects.requireNonNull; +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_INSIDE_REPORT; import seedu.address.logic.CommandHistory; +import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; /** @@ -15,8 +17,13 @@ public class ReportCommand extends Command { public static final String MESSAGE_SUCCESS = "Report displayed"; @Override - public CommandResult execute(Model model, CommandHistory history) { + public CommandResult execute(Model model, CommandHistory history) throws CommandException { requireNonNull(model); + + if (model.inReportDisplay()) { + throw new CommandException(MESSAGE_INVALID_COMMAND_INSIDE_REPORT); + } + model.enterReportDisplay(); return new CommandResult(MESSAGE_SUCCESS, CommandResult.Type.ENTERED_REPORT); } From 96b0c09ed7c3e4ac39ce2d71fbff8ccdf4d1e098 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 22:00:11 +0800 Subject: [PATCH 17/27] add report command unit test --- .../logic/commands/ReportCommandTest.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 src/test/java/seedu/address/logic/commands/ReportCommandTest.java diff --git a/src/test/java/seedu/address/logic/commands/ReportCommandTest.java b/src/test/java/seedu/address/logic/commands/ReportCommandTest.java new file mode 100755 index 000000000000..c151859152a8 --- /dev/null +++ b/src/test/java/seedu/address/logic/commands/ReportCommandTest.java @@ -0,0 +1,43 @@ +package seedu.address.logic.commands; + +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_INSIDE_REPORT; +import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure; +import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; +import static seedu.address.testutil.TypicalCards.getTypicalCardFolders; + +import org.junit.Test; + +import seedu.address.logic.CommandHistory; +import seedu.address.model.Model; +import seedu.address.model.ModelManager; +import seedu.address.model.UserPrefs; + +/** + * Contains integration tests (interaction with the Model) and junit tests for {@code ReportCommand}. + */ +public class ReportCommandTest { + private Model model = new ModelManager(getTypicalCardFolders(), new UserPrefs()); + private Model expectedModel = new ModelManager(getTypicalCardFolders(), new UserPrefs()); + private CommandHistory commandHistory = new CommandHistory(); + + @Test + public void execute_validReportCommand_success() { + ReportCommand reportCommand = new ReportCommand(); + expectedModel.enterReportDisplay(); + CommandResult expectedCommandResult = new CommandResult(ReportCommand.MESSAGE_SUCCESS, + CommandResult.Type.ENTERED_REPORT); + assertCommandSuccess(reportCommand, model, commandHistory, expectedCommandResult, expectedModel); + } + + @Test + public void execute_invalidReportCommandInsideTestSession_fail() { + ReportCommand reportCommand = new ReportCommand(); + expectedModel.enterReportDisplay(); + CommandResult expectedCommandResult = new CommandResult(ReportCommand.MESSAGE_SUCCESS, + CommandResult.Type.ENTERED_REPORT); + assertCommandSuccess(reportCommand, model, commandHistory, expectedCommandResult, expectedModel); + + String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_INSIDE_REPORT); + assertCommandFailure(reportCommand, model, commandHistory, expectedMessage); + } +} From 353ab2be8784986fd8bd7d6dc963e8b076612e93 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 22:03:33 +0800 Subject: [PATCH 18/27] rename test --- .../java/seedu/address/logic/commands/ReportCommandTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/seedu/address/logic/commands/ReportCommandTest.java b/src/test/java/seedu/address/logic/commands/ReportCommandTest.java index c151859152a8..9ee9d557f71c 100755 --- a/src/test/java/seedu/address/logic/commands/ReportCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/ReportCommandTest.java @@ -30,7 +30,7 @@ public void execute_validReportCommand_success() { } @Test - public void execute_invalidReportCommandInsideTestSession_fail() { + public void execute_invalidReportCommandInsideReportSession_fail() { ReportCommand reportCommand = new ReportCommand(); expectedModel.enterReportDisplay(); CommandResult expectedCommandResult = new CommandResult(ReportCommand.MESSAGE_SUCCESS, From 23500d211413cdd3ba6b392ce18003203717e05f Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 22:07:50 +0800 Subject: [PATCH 19/27] change ug for report to only report without index - previously report command required an index i.e. report INDEX - but now since the report command is only valid inside a folder, I changed it to just display the report for the folder --- docs/UserGuide.adoc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index 50dfb12ab0d8..d20e083eeff4 100755 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -198,9 +198,12 @@ Deletes the second folder in the folder list, along with its cards, on the home ==== Report user performance for folder : `report` -Displays user performance on the right panel for the folder specified by index. +Displays user performance in a fullscreen for the current card folder. -Format: `report FOLDER_INDEX` +Format: `report` + +[NOTE] +This command is only considered valid inside a card folder. ==== Enter folder : `change` @@ -416,7 +419,7 @@ questions displayed. The user is required to key in an answer for each question. |`change FOLDER_INDEX`|Enters the folder specified by index. Side panel on the left will display the list of cards in that folder. |`addfolder FOLDER_NAME` | Creates a new flashcard folder with the specified name. |`deletefolder FOLDER_INDEX` | Removes the flashcard folder specified by index. -|`report FOLDER_INDEX` | Displays user performance on the right panel for the folder specified by index. +|`report` | Displays user performance on the right panel for the current folder. |`test FOLDER_INDEX` | This command begins a test session, where the display area enters a fullscreen. |`ans ANSWER` | Enter answer for a flashcard. |`reveal` | Immediately reveals the correct answer. From 330e940a7096b00a0c095ccddabe08f0b05c599b Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 22:11:41 +0800 Subject: [PATCH 20/27] add to ug expanded use of END command --- docs/UserGuide.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index d20e083eeff4..4fa4780b7849 100755 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -305,9 +305,9 @@ This command is only considered valid if a card question and answer is currently There is no backtracking in the current session so there is no `prev` command. -==== End the current session : `end` +==== End the current test or report session : `end` -Quits the current test session. +Quits the current test or report session. Format: `end` From dce1c457859752ce918ec6d318eb25c704068c57 Mon Sep 17 00:00:00 2001 From: dlqs Date: Tue, 26 Mar 2019 22:19:49 +0800 Subject: [PATCH 21/27] fix very serious error that could've destroyed us - whew that was a close one --- docs/UserGuide.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/UserGuide.adoc b/docs/UserGuide.adoc index 4fa4780b7849..1a85c23dcdac 100755 --- a/docs/UserGuide.adoc +++ b/docs/UserGuide.adoc @@ -312,7 +312,7 @@ Quits the current test or report session. Format: `end` === Global Operations -The commands shown in this section are applicable irregardless of whether the user is inside a folder or at the home directory. +The commands shown in this section are applicable regardless of whether the user is inside a folder or at the home directory. ==== Search by keywords : `search` From d51800f20e282a6a76bcee8d5b960a34a4333c64 Mon Sep 17 00:00:00 2001 From: dlqs Date: Wed, 27 Mar 2019 11:09:19 +0800 Subject: [PATCH 22/27] rename --- .../java/seedu/address/logic/commands/NextCommandTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/java/seedu/address/logic/commands/NextCommandTest.java b/src/test/java/seedu/address/logic/commands/NextCommandTest.java index 44d31e6d4761..e2f1eaeffee3 100755 --- a/src/test/java/seedu/address/logic/commands/NextCommandTest.java +++ b/src/test/java/seedu/address/logic/commands/NextCommandTest.java @@ -1,6 +1,6 @@ package seedu.address.logic.commands; -import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION; +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN; import static seedu.address.commons.core.Messages.MESSAGE_INVALID_NEXT_COMMAND; import static seedu.address.logic.commands.CommandTestUtil.assertCommandFailure; import static seedu.address.logic.commands.CommandTestUtil.assertCommandSuccess; @@ -39,7 +39,7 @@ public void execute_nextCommand_success() { @Test public void execute_invalidNextCommandOutsideTestSession_fail() { - String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_OUTSIDE_TEST_SESSION); + String expectedMessage = String.format(MESSAGE_INVALID_COMMAND_OUTSIDE_FULLSCREEN); assertCommandFailure(new NextCommand(), model, commandHistory, expectedMessage); } From e477eb8d473752a3bf6b56e43c2939fbfcbe8f15 Mon Sep 17 00:00:00 2001 From: dlqs Date: Wed, 27 Mar 2019 12:02:08 +0800 Subject: [PATCH 23/27] add missing break --- src/main/java/seedu/address/ui/MainWindow.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index 1647fa279f2a..e1840ce9743c 100755 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -283,6 +283,7 @@ private CommandResult executeCommand(String commandText) throws CommandException break; case EXITED_REPORT: handleEndReport(); + break; case SHOW_NEXT_CARD: handleNextCardTestSession(commandResult.getTestSessionCard()); break; From 44cd4b02b111743e84a1c8455f7a889733d07b15 Mon Sep 17 00:00:00 2001 From: dlqs Date: Wed, 27 Mar 2019 14:42:32 +0800 Subject: [PATCH 24/27] fix wrong size displayed --- src/main/java/seedu/address/ui/ReportDisplay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/ui/ReportDisplay.java b/src/main/java/seedu/address/ui/ReportDisplay.java index d02a5fb1c781..ecce12f9a7ef 100755 --- a/src/main/java/seedu/address/ui/ReportDisplay.java +++ b/src/main/java/seedu/address/ui/ReportDisplay.java @@ -40,7 +40,7 @@ public ReportDisplay(ReadOnlyCardFolder cardFolder) { displayTitle(cardFolder.getFolderName()); displayGraph(cardFolder.getFolderScores()); displayQuestions(cardFolder.getCardList()); - displayTagLine("Last " + cardFolder.getCardList().size() + " scores, latest on the right"); + displayTagLine("Last " + cardFolder.getFolderScores().size() + " scores, latest on the right"); reportDisplay.getChildren().clear(); reportDisplay.getChildren().add(folderName); From 194b4dc5a3b09f1e6b4724628ef8077d68c8b29c Mon Sep 17 00:00:00 2001 From: dlqs Date: Wed, 27 Mar 2019 14:55:58 +0800 Subject: [PATCH 25/27] add check for inside folder before report --- .../java/seedu/address/logic/commands/ReportCommand.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/seedu/address/logic/commands/ReportCommand.java b/src/main/java/seedu/address/logic/commands/ReportCommand.java index 29c622726a1f..aad7a130d99f 100755 --- a/src/main/java/seedu/address/logic/commands/ReportCommand.java +++ b/src/main/java/seedu/address/logic/commands/ReportCommand.java @@ -2,6 +2,7 @@ import static java.util.Objects.requireNonNull; import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_INSIDE_REPORT; +import static seedu.address.commons.core.Messages.MESSAGE_INVALID_COMMAND_OUTSIDE_FOLDER; import seedu.address.logic.CommandHistory; import seedu.address.logic.commands.exceptions.CommandException; @@ -20,6 +21,10 @@ public class ReportCommand extends Command { public CommandResult execute(Model model, CommandHistory history) throws CommandException { requireNonNull(model); + if (!model.isInFolder()) { + throw new CommandException(MESSAGE_INVALID_COMMAND_OUTSIDE_FOLDER); + } + if (model.inReportDisplay()) { throw new CommandException(MESSAGE_INVALID_COMMAND_INSIDE_REPORT); } From 15338b410bdbc4819342e49ab32d6d190ee8e879 Mon Sep 17 00:00:00 2001 From: dlqs Date: Wed, 27 Mar 2019 16:44:05 +0800 Subject: [PATCH 26/27] add line showing performance change - with highlighting! --- .../address/logic/commands/ReportCommand.java | 2 +- .../java/seedu/address/ui/ReportDisplay.java | 57 +++++++++++++++++++ src/main/resources/view/ReportDisplay.fxml | 11 +++- 3 files changed, 66 insertions(+), 4 deletions(-) diff --git a/src/main/java/seedu/address/logic/commands/ReportCommand.java b/src/main/java/seedu/address/logic/commands/ReportCommand.java index aad7a130d99f..ed732a20f599 100755 --- a/src/main/java/seedu/address/logic/commands/ReportCommand.java +++ b/src/main/java/seedu/address/logic/commands/ReportCommand.java @@ -24,7 +24,7 @@ public CommandResult execute(Model model, CommandHistory history) throws Command if (!model.isInFolder()) { throw new CommandException(MESSAGE_INVALID_COMMAND_OUTSIDE_FOLDER); } - + if (model.inReportDisplay()) { throw new CommandException(MESSAGE_INVALID_COMMAND_INSIDE_REPORT); } diff --git a/src/main/java/seedu/address/ui/ReportDisplay.java b/src/main/java/seedu/address/ui/ReportDisplay.java index ecce12f9a7ef..44d9fbe68efc 100755 --- a/src/main/java/seedu/address/ui/ReportDisplay.java +++ b/src/main/java/seedu/address/ui/ReportDisplay.java @@ -19,6 +19,17 @@ public class ReportDisplay extends UiPart { private static final String FXML = "ReportDisplay.fxml"; + public static final String MESSAGE_SCORE_CHANGE_PREFIX = "Your latest score has changed by "; + + // Pixel values used for manipulating string offset (see below) + private static final int PIXELS_PER_CHARACTER = 6; + private static final int CHARACTER_OFFSET = 2; + + // number change display colors, in hex + private static final String CHANGE_POSITIVE = "#47AB6C"; // green + private static final String CHANGE_NEGATIVE = "#ED553B"; // red + private static final String CHANGE_SAME = "#BDB76B"; // dark khaki + @FXML private GridPane reportDisplay; @@ -34,6 +45,13 @@ public class ReportDisplay extends UiPart { @FXML private Label tagLine; + @FXML + private Label performanceLine; + + @FXML + private Label numberLine; + + public ReportDisplay(ReadOnlyCardFolder cardFolder) { super(FXML); @@ -48,6 +66,45 @@ public ReportDisplay(ReadOnlyCardFolder cardFolder) { reportDisplay.getChildren().add(graph); reportDisplay.getChildren().add(questionsDisplay); + if (cardFolder.getFolderScores().size() > 1) { + displayPerformanceLine(cardFolder.getFolderScores()); + reportDisplay.getChildren().add(performanceLine); + reportDisplay.getChildren().add(numberLine); + } + + } + + /** + * Displays a line indicating change in performance depending on last 2 scores. + * @param folderScores List of Double of folderScores, at least > 1 in length. + */ + private void displayPerformanceLine(List folderScores) { + assert folderScores.size() > 1; + + // Calculate difference based on last two scores + double scoreAfter = folderScores.get(folderScores.size() - 1); + double scoreBefore = folderScores.get(folderScores.size() - 2); + double difference = Math.abs(scoreAfter - scoreBefore); + + performanceLine.setText(MESSAGE_SCORE_CHANGE_PREFIX); + + /** + * The number needs to be in a different Label because has its own style i.e. the highlighting and color change. + * This will translate the Label manually by the correct number of pixels so that it is just to the right of the + * Label directly preceding this one, i.e. the one containing "...has changed by ". + */ + numberLine.setTranslateX((MESSAGE_SCORE_CHANGE_PREFIX.length() - CHARACTER_OFFSET) * PIXELS_PER_CHARACTER); + + if (scoreAfter > scoreBefore) { + numberLine.setStyle("-fx-background-color: " + CHANGE_POSITIVE + ";"); + numberLine.setText(String.format("+%.2f", difference)); + } else if (scoreAfter == scoreBefore) { + numberLine.setStyle("-fx-background-color: " + CHANGE_SAME + ";"); + numberLine.setText(String.format("=%.2f", difference)); + } else { + numberLine.setStyle("-fx-background-color: " + CHANGE_NEGATIVE + ";"); + numberLine.setText(String.format("-%.2f", difference)); + } } /** diff --git a/src/main/resources/view/ReportDisplay.fxml b/src/main/resources/view/ReportDisplay.fxml index b1102dfc2be8..e170f4473e67 100755 --- a/src/main/resources/view/ReportDisplay.fxml +++ b/src/main/resources/view/ReportDisplay.fxml @@ -6,13 +6,18 @@ + - From 9c51621ee9db2b62ff6758609f15b806174c4fc9 Mon Sep 17 00:00:00 2001 From: dlqs Date: Wed, 27 Mar 2019 16:48:03 +0800 Subject: [PATCH 27/27] fix checkstyle --- src/main/java/seedu/address/ui/ReportDisplay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/seedu/address/ui/ReportDisplay.java b/src/main/java/seedu/address/ui/ReportDisplay.java index 44d9fbe68efc..ab4c447699db 100755 --- a/src/main/java/seedu/address/ui/ReportDisplay.java +++ b/src/main/java/seedu/address/ui/ReportDisplay.java @@ -19,7 +19,7 @@ public class ReportDisplay extends UiPart { private static final String FXML = "ReportDisplay.fxml"; - public static final String MESSAGE_SCORE_CHANGE_PREFIX = "Your latest score has changed by "; + private static final String MESSAGE_SCORE_CHANGE_PREFIX = "Your latest score has changed by "; // Pixel values used for manipulating string offset (see below) private static final int PIXELS_PER_CHARACTER = 6;