diff --git a/LICENSE b/LICENSE index 39b3478982c..3c55efcccd5 100644 --- a/LICENSE +++ b/LICENSE @@ -2,11 +2,11 @@ MIT License Copyright (c) 2016 Software Engineering Education - FOSS Resources -Permission is hereby granted, free of charge, to any person obtaining a copy +Permission is hereby granted, free of charge, to any qAndA obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is +copies of the Software, and to permit qAndAs to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all diff --git a/README.md b/README.md index 13f5c77403f..c5c65337c97 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,17 @@ -[![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions) +[![CI Status](https://github.com/AY2021S1-CS2103T-W15-1/tp/workflows/Java%20CI/badge.svg)](https://github.com/AY2021S1-CS2103T-W15-1/tp/actions) + +# Medmoriser ![Ui](docs/images/Ui.png) -* This is **a sample project for Software Engineering (SE) students**.
- Example usages: - * as a starting point of a course project (as opposed to writing everything from scratch) - * as a case study -* The project simulates an ongoing software project for a desktop application (called _AddressBook_) used for managing contact details. - * It is **written in OOP fashion**. It provides a **reasonably well-written** code base **bigger** (around 6 KLoC) than what students usually write in beginner-level SE modules, without being overwhelmingly big. - * It comes with a **reasonable level of user and developer documentation**. -* It is named `AddressBook Level 3` (`AB3` for short) because it was initially created as a part of a series of `AddressBook` projects (`Level 1`, `Level 2`, `Level 3` ...). -* For the detailed documentation of this project, see the **[Address Book Product Website](https://se-education.org/addressbook-level3)**. -* This project is a **part of the se-education.org** initiative. If you would like to contribute code to this project, see [se-education.org](https://se-education.org#https://se-education.org/#contributing) for more info. +**Medmoriser** is a desktop app, optimized for the CLI, which helps medical students memorise and revise their content. It aids users in practising active recall to improve their retention of key information. + +## Site Map +- [User Guide](https://ay2021s1-cs2103t-w15-1.github.io/tp/UserGuide.html) +- [Developer Guide](https://ay2021s1-cs2103t-w15-1.github.io/tp/DeveloperGuide.html) +- [About Us](https://ay2021s1-cs2103t-w15-1.github.io/tp/AboutUs.html) + +## Acknowledgements + +This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org). + diff --git a/build.gradle b/build.gradle index be2d2905dde..8b42e42e91c 100644 --- a/build.gradle +++ b/build.gradle @@ -6,7 +6,7 @@ plugins { id 'jacoco' } -mainClassName = 'seedu.address.Main' +mainClassName = 'seedu.medmoriser.Main' sourceCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11 @@ -25,6 +25,10 @@ test { finalizedBy jacocoTestReport } +run { + enableAssertions = false +} + task coverage(type: JacocoReport) { sourceDirectories.from files(sourceSets.main.allSource.srcDirs) classDirectories.from files(sourceSets.main.output) @@ -66,7 +70,11 @@ dependencies { } shadowJar { - archiveName = 'addressbook.jar' + archiveFileName = 'medmoriser.jar' +} + +run { + enableAssertions = true } defaultTasks 'clean', 'test' diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 1c9514e966a..600b9e0b4c4 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -5,55 +5,59 @@ title: About Us We are a team based in the [School of Computing, National University of Singapore](http://www.comp.nus.edu.sg). -You can reach us at the email `seer[at]comp.nus.edu.sg` +You can find us on [Github](https://github.com/AY2021S1-CS2103T-W15-1) ## Project team -### John Doe +### Kim Hyeongcheol (Danny) - + -[[homepage](http://www.comp.nus.edu.sg/~damithch)] -[[github](https://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](https://github.com/bluesky0911)] * Role: Project Advisor -### Jane Doe +### Yong Ming Yang - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](https://github.com/yongmingyang)] * Role: Team Lead -* Responsibilities: UI +* Responsibilities: Deliverables & deadlines, Scheduling & tracking -### Johnny Doe +### Jonathan Foo Chee Yong - + -[[github](http://github.com/johndoe)] [[portfolio](team/johndoe.md)] +[[github](http://github.com/jonfoocy)] * Role: Developer -* Responsibilities: Data +* Responsibilities: Integration -### Jean Doe +### Cheng Jiyuqing - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](https://github.com/ChengJiyuqing)] * Role: Developer -* Responsibilities: Dev Ops + Threading +* Responsibilities: Testing -### James Doe +### Tan Rui En Joshua - + -[[github](http://github.com/johndoe)] -[[portfolio](team/johndoe.md)] +[[github](https://github.com/joshruien)] * Role: Developer -* Responsibilities: UI +* Responsibilities: Documentation + +### Teng Jian Ling + + + +[[github](https://github.com/tengjianling)] + +* Role: Developer +* Responsibilities: Code Quality diff --git a/docs/DevOps.md b/docs/DevOps.md index 4414eea3344..aa42e5872cf 100644 --- a/docs/DevOps.md +++ b/docs/DevOps.md @@ -73,7 +73,7 @@ Any warnings or errors will be printed out to the console. Here are the steps to create a new release. -1. Update the version number in [`MainApp.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java). +1. Update the version number in [`MainApp.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/answer/MainApp.java). 1. Generate a fat JAR file using Gradle (i.e., `gradlew shadow`). 1. Tag the repo with the version number. e.g. `v0.1` 1. [Create a new release using GitHub](https://help.github.com/articles/creating-releases/). Upload the JAR file you created. diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 4829fe43011..2d101185072 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -2,9 +2,9 @@ layout: page title: Developer Guide --- -* Table of Contents +* Table of Contents: {:toc} - + -------------------------------------------------------------------------------------------------------------------- ## **Setting up, getting started** @@ -23,11 +23,11 @@ The ***Architecture Diagram*** given above explains the high-level design of the
-:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/se-edu/addressbook-level3/tree/master/docs/diagrams/) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams. +:bulb: **Tip:** The `.puml` files used to create diagrams in this document can be found in the [diagrams](https://github.com/AY2021S1-CS2103T-W15-1/tp/tree/master/docs/diagrams) folder. Refer to the [_PlantUML Tutorial_ at se-edu/guides](https://se-education.org/guides/tutorials/plantUml.html) to learn how to create and edit diagrams.
-**`Main`** has two classes called [`Main`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/Main.java) and [`MainApp`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/MainApp.java). It is responsible for, +**`Main`** has two classes called [`Main`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/java/seedu/medmoriser/Main.java) and [`MainApp`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/java/seedu/medmoriser/MainApp.java). It is responsible for: * At app launch: Initializes the components in the correct sequence, and connects them up with each other. * At shut down: Shuts down the components and invokes cleanup methods where necessary. @@ -62,11 +62,11 @@ The sections below give more details of each component. ![Structure of the UI Component](images/UiClassDiagram.png) **API** : -[`Ui.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/Ui.java) +[`Ui.java`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/java/seedu/medmoriser/ui/Ui.java) -The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `PersonListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class. +The UI consists of a `MainWindow` that is made up of parts e.g.`CommandBox`, `ResultDisplay`, `QAndAListPanel`, `StatusBarFooter` etc. All these, including the `MainWindow`, inherit from the abstract `UiPart` class. -The `UI` component uses JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/resources/view/MainWindow.fxml) +The `UI` component uses JavaFx UI framework. The layout of these UI parts are defined in matching `.fxml` files that are in the `src/main/resources/view` folder. For example, the layout of the [`MainWindow`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/java/seedu/medmoriser/ui/MainWindow.java) is specified in [`MainWindow.fxml`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/resources/view/MainWindow.fxml) The `UI` component, @@ -78,11 +78,11 @@ The `UI` component, ![Structure of the Logic Component](images/LogicClassDiagram.png) **API** : -[`Logic.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/logic/Logic.java) +[`Logic.java`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/java/seedu/medmoriser/logic/Logic.java) -1. `Logic` uses the `AddressBookParser` class to parse the user command. +1. `Logic` uses the `MedmoriserParser` class to parse the user command. 1. This results in a `Command` object which is executed by the `LogicManager`. -1. The command execution can affect the `Model` (e.g. adding a person). +1. The command execution can affect the `Model` (e.g. adding a qAndA). 1. The result of the command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`. 1. In addition, the `CommandResult` object can also instruct the `Ui` to perform certain actions, such as displaying help to the user. @@ -97,17 +97,17 @@ Given below is the Sequence Diagram for interactions within the `Logic` componen ![Structure of the Model Component](images/ModelClassDiagram.png) -**API** : [`Model.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/model/Model.java) +**API** : [`Model.java`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/java/seedu/medmoriser/model/Model.java) The `Model`, * stores a `UserPref` object that represents the user’s preferences. -* stores the address book data. +* stores the answer book data. * exposes an unmodifiable `ObservableList` that can be 'observed' e.g. the UI can be bound to this list so that the UI automatically updates when the data in the list change. * does not depend on any of the other three components. -
:information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `AddressBook`, which `Person` references. This allows `AddressBook` to only require one `Tag` object per unique `Tag`, instead of each `Person` needing their own `Tag` object.
+
:information_source: **Note:** An alternative (arguably, a more OOP) model is given below. It has a `Tag` list in the `Medmoriser`, which `QAndA` references. This allows `Medmoriser` to only require one `Tag` object per unique `Tag`, instead of each `QAndA` needing their own `Tag` object.
![BetterModelClassDiagram](images/BetterModelClassDiagram.png)
@@ -117,15 +117,15 @@ The `Model`, ![Structure of the Storage Component](images/StorageClassDiagram.png) -**API** : [`Storage.java`](https://github.com/se-edu/addressbook-level3/tree/master/src/main/java/seedu/address/storage/Storage.java) +**API** : [`Storage.java`](https://github.com/AY2021S1-CS2103T-W15-1/tp/blob/master/src/main/java/seedu/medmoriser/storage/Storage.java) The `Storage` component, * can save `UserPref` objects in json format and read it back. -* can save the address book data in json format and read it back. +* can save the answer book data in json format and read it back. ### Common classes -Classes used by multiple components are in the `seedu.addressbook.commons` package. +Classes used by multiple components are in the `seedu.medmoriser.commons` package. -------------------------------------------------------------------------------------------------------------------- @@ -133,90 +133,136 @@ Classes used by multiple components are in the `seedu.addressbook.commons` packa This section describes some noteworthy details on how certain features are implemented. -### \[Proposed\] Undo/redo feature +### Add Feature (Cheng Jiyuqing) -#### Proposed Implementation +#### Implementation -The proposed undo/redo mechanism is facilitated by `VersionedAddressBook`. It extends `AddressBook` with an undo/redo history, stored internally as an `addressBookStateList` and `currentStatePointer`. Additionally, it implements the following operations: +This portion describes the implementation of the add feature which allows the user to add new QAndAs with the question, answer and tags(optional). -* `VersionedAddressBook#commit()` — Saves the current address book state in its history. -* `VersionedAddressBook#undo()` — Restores the previous address book state from its history. -* `VersionedAddressBook#redo()` — Restores a previously undone address book state from its history. +Explanation of the diagrams: -These operations are exposed in the `Model` interface as `Model#commitAddressBook()`, `Model#undoAddressBook()` and `Model#redoAddressBook()` respectively. +1. As the user parses the add command through the `UI`, the `MedmoriserParser` identifies this as a `AddCommand` and passes the user input to the `AddCommandParser`. +2. The `AddCommandParser` ensures the input is of correct format and identifies the input for question, answer and tag(s). +3. The `AddCommandParser` then creates a new QAndA object, and passes it to a new `AddCommand` object to handle the rest of the job. +4. The `AddCommand` object will then add the new QAndA to model, and return a `CommandResult` containing a message to users indicating success in adding a new QAndA. +5. `UI` will also be updated accordingly. -Given below is an example usage scenario and how the undo/redo mechanism behaves at each step. +The following sequence diagram (Fig 1.1) shows how the add operation works: -Step 1. The user launches the application for the first time. The `VersionedAddressBook` will be initialized with the initial address book state, and the `currentStatePointer` pointing to that single address book state. +(Figure 1.1: Add Command Sequence Diagram) +![AddSequenceDiagram](images/AddSequenceDiagram.png) -![UndoRedoState0](images/UndoRedoState0.png) +### Find feature (Ming Yang) -Step 2. The user executes `delete 5` command to delete the 5th person in the address book. The `delete` command calls `Model#commitAddressBook()`, causing the modified state of the address book after the `delete 5` command executes to be saved in the `addressBookStateList`, and the `currentStatePointer` is shifted to the newly inserted address book state. +#### Implementation -![UndoRedoState1](images/UndoRedoState1.png) +This portion describes the implementation of the find feature which allows the user to find QAndA sets based on the question, answer or tags. -Step 3. The user executes `add n/David …​` to add a new person. The `add` command also calls `Model#commitAddressBook()`, causing another modified address book state to be saved into the `addressBookStateList`. +Explanation of the diagrams: +1. As the user parses the find command through the `UI`, the `MedmoriserParser` identifies this as a `FindCommand` and passes the user input to the `FindCommandParser`. +2. The `FindCommandParser` identifies the type of find command, such as find tag/question/answer. +3. A `FindCommand` with the respective predicate such as `TagContainsKeywordPredicate` is created and returned to the `LogicManager`. +4. The filtered list of question will be displayed on the `UI`. -![UndoRedoState2](images/UndoRedoState2.png) +The following sequence diagram (Fig 1.2) shows how the find operation works: -
:information_source: **Note:** If a command fails its execution, it will not call `Model#commitAddressBook()`, so the address book state will not be saved into the `addressBookStateList`. +(Figure 1.2: Find Command Sequence Diagram) +![UndoSequenceDiagram](images/FindSequenceDiagram.png) -
+The activity diagram below (Fig 1.3) shows the activity flow of the find feature. -Step 4. The user now decides that adding the person was a mistake, and decides to undo that action by executing the `undo` command. The `undo` command will call `Model#undoAddressBook()`, which will shift the `currentStatePointer` once to the left, pointing it to the previous address book state, and restores the address book to that state. +(Figure 1.3: Find Command Activity Diagram) +![FindActivityDiagram](images/FindActivityDiagram.png) -![UndoRedoState3](images/UndoRedoState3.png) +### Quiz Feature (Joshua Tan) -
:information_source: **Note:** If the `currentStatePointer` is at index 0, pointing to the initial AddressBook state, then there are no previous AddressBook states to restore. The `undo` command uses `Model#canUndoAddressBook()` to check if this is the case. If so, it will return an error to the user rather -than attempting to perform the undo. +#### Implementation -
+This feature allows the user to quiz himself/herself. -The following sequence diagram shows how the undo operation works: +The flow of the execution is as follows: -![UndoSequenceDiagram](images/UndoSequenceDiagram.png) +1. User enters the input for quiz (eg. `quiz t/Immune System`) -
:information_source: **Note:** The lifeline for `UndoCommand` should end at the destroy marker (X) but due to a limitation of PlantUML, the lifeline reaches the end of diagram. +2. The `LogicManager` executes the command, the command is then parsed by `MedmoriserParser` and the command is +identified as a `QuizCommand`. The command is then parsed by `QuizCommandParser`. -
+3. `QuizCommandParser` identifies the type of quiz command. (eg. quiz t/) -The `redo` command does the opposite — it calls `Model#redoAddressBook()`, which shifts the `currentStatePointer` once to the right, pointing to the previously undone state, and restores the address book to that state. +4. A `QuizCommand` with the respective predicate, in this case `TagContainsKeywordPredicate` is created and returned to `LogicManager` -
:information_source: **Note:** If the `currentStatePointer` is at index `addressBookStateList.size() - 1`, pointing to the latest address book state, then there are no undone AddressBook states to restore. The `redo` command uses `Model#canRedoAddressBook()` to check if this is the case. If so, it will return an error to the user rather than attempting to perform the redo. +5. The `QuizCard` will be displayed on the `UI`. -
+The sequence diagram below (Fig 1.4) shows the interactions between the Logic and model components for the quiz command. + +(Figure 1.4: Quiz Command Sequence Diagram) +![QuizSequenceDiagram](images/QuizSequenceDiagram.png) + +The diagram below (Fig 1.5) shows the activity diagram flow for the quiz command + +(Figure 1.5: Quiz Command Activity Diagram) +![QuizActivityDiagram](images/QuizActivityDiagram.png) + + +### Delete Feature (Jian Ling) + +#### Implementation + +This feature allows the user to delete a QAndA from the answer book. The flow of the execution of the delete command is shown below. + +1. User enters the input to delete a QAndA (eg. `delete 1`) + +2. The `LogicManager` executes this command, leading to the command being parsed by `MedmoriserParser` and `DeleteCommandParser` + +3. After successful parsing, `DeleteCommand#execute(Model model)` is called. This method checks for the following scenarios: -Step 5. The user then decides to execute the command `list`. Commands that do not modify the address book, such as `list`, will usually not call `Model#commitAddressBook()`, `Model#undoAddressBook()` or `Model#redoAddressBook()`. Thus, the `addressBookStateList` remains unchanged. + - A quiz is currently in progress + - The index entered by the user is out of bounds -![UndoRedoState4](images/UndoRedoState4.png) + If any of the scenarios above occur, a `CommandException` will be thrown with their respective error messages. Othewise, a new `CommandResult` is returned, along with a success message that the specified QAndA has been successfully deleted -Step 6. The user executes `clear`, which calls `Model#commitAddressBook()`. Since the `currentStatePointer` is not pointing at the end of the `addressBookStateList`, all address book states after the `currentStatePointer` will be purged. Reason: It no longer makes sense to redo the `add n/David …​` command. This is the behavior that most modern desktop applications follow. +The sequence diagram (Fig. 1.6) below shows the flow of the delete feature. -![UndoRedoState5](images/UndoRedoState5.png) +(Figure 1.6: Delete Command Sequence Diagram) -The following activity diagram summarizes what happens when a user executes a new command: +![DeleteSequenceDiagram](images/DeleteSequenceDiagram.png) -![CommitActivityDiagram](images/CommitActivityDiagram.png) +The activity diagram (Fig 1.7) below further shows the flow of the delete feature. -#### Design consideration: +(Figure 1.7: Delete Command Activity Diagram) -##### Aspect: How undo & redo executes +![DeleteActivityDiagram](images/DeleteActivityDiagram.png) -* **Alternative 1 (current choice):** Saves the entire address book. - * Pros: Easy to implement. - * Cons: May have performance issues in terms of memory usage. -* **Alternative 2:** Individual command knows how to undo/redo by - itself. - * Pros: Will use less memory (e.g. for `delete`, just save the person being deleted). - * Cons: We must ensure that the implementation of each individual command are correct. +### List Feature (Jonathan Foo) -_{more aspects and alternatives to be added}_ +#### Implementation -### \[Proposed\] Data archiving +This section elaborates on the implementation of the list feature. -_{Explain here how the data archiving feature will be implemented}_ +1. The user enters input to list all QAndAs. +2. The `Ui` component calls the `Logic` component to execute this. `MedmoriserParser` parses the command, resulting in a `ListCommand` object which is executed by the `LogicManager`. + +3. This updates the `Model` to show all QAndAs in the answer book. + +4. The result of this command execution is encapsulated as a `CommandResult` object which is passed back to the `Ui`. + +5. `Ui` checks the `CommandResult` object and modifies the visibility of the `Answer` label. In this case, the visibilty is set to `hidden` + +The sequence diagram below (Fig 1.8) shows the interactions between the Ui and Logic components for the list command. + +(Figure 1.8: List Command Sequence Diagram) +![ListSequenceDiagram](images/ListSequenceDiagram.png) + +The following activity diagram (Fig 1.9) summarises what happens when a user executes the `list` command. + +(Figure 1.9: List Command Activity Diagram) +![ListActivityDiagram](images/ListActivityDiagram.png) + +#### Design considerations: +* The `Ui` component was selected to perform the showing/hiding of answers as it already had access to the various components in the GUI, hence preventing further coupling between the different components. +* We decided to use `list` rather than `list all` to show all questions and answers as we wanted to maintain the original functionality of the `list` command. -------------------------------------------------------------------------------------------------------------------- @@ -236,71 +282,195 @@ _{Explain here how the data archiving feature will be implemented}_ **Target user profile**: -* has a need to manage a significant number of contacts +* medical students with heavy content to memorise +* has a need to manage and frequently revisit a significant number of questions and answers +* has a need to refer to images and diagrams * prefer desktop apps over other types -* can type fast +* finds typing with a keyboard faster than typing with smartphones or handwriting. * prefers typing to mouse interactions * is reasonably comfortable using CLI apps -**Value proposition**: manage contacts faster than a typical mouse/GUI driven app +**Value proposition**: +* Aggregate and organises contents and much faster than traditional methods. +* Allows students to memorise contents more efficiently by continuously testing them. This way they can practice active recall. ### User stories Priorities: High (must have) - `* * *`, Medium (nice to have) - `* *`, Low (unlikely to have) - `*` -| Priority | As a …​ | I want to …​ | So that I can…​ | -| -------- | ------------------------------------------ | ------------------------------ | ---------------------------------------------------------------------- | -| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App | -| `* * *` | user | add a new person | | -| `* * *` | user | delete a person | remove entries that I no longer need | -| `* * *` | user | find a person by name | locate details of persons without having to go through the entire list | -| `* *` | user | hide private contact details | minimize chance of someone else seeing them by accident | -| `*` | user with many persons in the address book | sort persons by name | locate a person easily | - -*{More to be added}* +| Priority | As a …​ | I want to …​ | So that I can…​ | +| -------- | ------------------------------------------ | ------------------------------ | -------------------------------------------------------------------------| +| `* * *` | new user | see usage instructions | refer to instructions when I forget how to use the App | +| `* * *` | user | key in questions and answers | revise on the questions I keyed in | +| `* * *` | user | delete a Q&A | remove entries that I no longer need | +| `* * *` | user | edit existing questions and answers | make changes to the questions and answers | +| `* * *` | user | see all the questions | have an overview of all the Q&As I have | +| `* *` | user | find questions by keywords | locate the Q&A without having to go through the entire list of questions | +| `* * ` | user | tag questions to its topics | organise the questions properly by topic | +| `*` | organised user | archive questions I no longer need | keep my question book organised and updated | ### Use cases -(For all use cases below, the **System** is the `AddressBook` and the **Actor** is the `user`, unless specified otherwise) +(For all use cases below, the **System** is the `Medmoriser` and the **Actor** is the `user`, unless specified otherwise. Q&A stands for a question and answer pair) -**Use case: Delete a person** +**Use case: UC01 - Add a Q&A** **MSS** -1. User requests to list persons -2. AddressBook shows a list of persons -3. User requests to delete a specific person in the list -4. AddressBook deletes the person +1. User adds a new QAndA into the database + +2. Medmoriser adds the new QAndA and displays a success message + + Use case ends. + +**Extensions** + +- 1a. The entered data is invalid + + - 1a1. Medmoriser displays an error message Use case ends. + + +**Use case: UC02 - View all QAndAs** + +**MSS** + +1. User requests to view all QAndAs + +2. Medmoriser shows a list of QAndAs in the database + + Use case ends. + + + +**Use case: UC03 - Delete a QAndA** + +**MSS** + +1. User requests to view all QAndAs + +2. Medmoriser shows a list of QAndAs in the database + +3. User requests to delete a QAndA at a specific index in the list + +4. Medmoriser deletes the Q&A and displays success message + + Use case ends + +**Extensions** + +- 2a. The list is empty. + + Use case ends. + +- 3a. The given index is invalid. + + - 3a1. Medmoriser shows an error message. + + Use case resumes at step 2. + +**Use case: UC04 - Add a tag to a QAndA** + +**MSS** + +1. User requests to view all QAndAs + +2. Medmoriser shows a list of QAndAs in the database + +3. User requests to add a tag to a QAndA at a specific index in the list + +4. Medmoriser adds the specified tag to the QAndA and displays success message + + Use case ends. + **Extensions** -* 2a. The list is empty. +- 2a. The list is empty. Use case ends. -* 3a. The given index is invalid. +- 3a. The given index is invalid. + + - 3a1. Medmoriser shows an error message. + + Use case resumes at step 2. + +- 3b. The given tag is invalid. + + - 3b1. Medmoriser shows an error message. + + Use case resumes at step 2. + +**Use case: UC05 - Edit a QAndA** + +**MSS** + +1. User requests to view all QAndAs + +2. Medmoriser shows a list of QAndAs in the database + +3. User requests to edit a QAndA at a specific index in the list + +4. Medmoriser edits the QAndA at the specified index according to the user's new input and displays success message + + Use case ends + +**Extensions** + +- 2a. The list is empty. + + Use case ends. + +- 3a. The given index is invalid. + + - 3a1. Medmoriser shows an error message. + + Use case resumes at step 2. + +- 3b. The edit request is invalid - * 3a1. AddressBook shows an error message. + - 3b1. Medmoriser shows an error message - Use case resumes at step 2. + Use case resumes at step 2. + +**Use case: UC06 - Find a QAndA** + +**MSS** + +1. User searches for a key word or phrase + +2. Medmoriser shows a list of QAndAs with that specified word or phrase + + Use case ends + +**Extensions** + +- 2a. There are no QAndAs that contain the specified word or phrase + + - 2a1. Medmoriser displays message that no QAndAs found + + Use case ends *{More to be added}* ### Non-Functional Requirements -1. Should work on any _mainstream OS_ as long as it has Java `11` or above installed. -2. Should be able to hold up to 1000 persons without a noticeable sluggishness in performance for typical usage. -3. A user with above average typing speed for regular English text (i.e. not code, not system admin commands) should be able to accomplish most of the tasks faster using commands than using the mouse. +1. Data bank should be able to hold large number (500+) pairs of QAndAs without any sluggish performance + for typical usage. +2. Users should be able to retrieve answers to a question with a single command +3. User should be able to add a QAndA easily and efficiently through a user-friendly GUI +4. Have a clean user interface when it comes to reviewing questions and answers *{More to be added}* ### Glossary -* **Mainstream OS**: Windows, Linux, Unix, OS-X -* **Private contact detail**: A contact detail that is not meant to be shared with others +* **QAndA**: A set containing a question and answer +* **Question**: A question belonging to a QAndA +* **Answer**: An answer to a question, both of which belong to the same QAndA -------------------------------------------------------------------------------------------------------------------- @@ -319,7 +489,7 @@ testers are expected to do more *exploratory* testing. 1. Download the jar file and copy into an empty folder - 1. Double-click the jar file Expected: Shows the GUI with a set of sample contacts. The window size may not be optimum. + 1. Double-click the jar file Expected: Shows the GUI with a set of sample QAndAs. The window size may not be optimum. 1. Saving window preferences @@ -328,29 +498,127 @@ testers are expected to do more *exploratory* testing. 1. Re-launch the app by double-clicking the jar file.
Expected: The most recent window size and location is retained. -1. _{ more test cases …​ }_ +### Finding a QAndA + +1. Find QAndAs based on keywords in the question + + 1. Prerequisites: QAndA(s) with the word `heart` in the question + + 1. Test case: `find q/heart` + Expected: QAndA(s) with `heart` in the question are shown. + +1. Find QAndAs based on keywords in the answer + + 1. Prerequisites: 2 different QAndAs, 1 with the word `blood` in the answer + and the other with `respiratory function` in the answer + + 1. Test case: `find a/blood, respiratory function`
+ Expected: Both QAndAs with the corresponding keywords are shown. + (i.e. the QAndA with `blood` in the answer and the QAndA with `respiratory function` in the answer are both shown) + +1. Find QAndAs based on keywords in the tag + + 1. Prerequisites: QAndA(s) with the tag `immune system` + + 1. Test case: `find t/immune system`
+ Expected: QAndA(s) with the tag `immune system` are shown. + +### Quizzing + +1. Starting a quiz + + 1. Prerequisites: QAndA(s) with the `heart` tag. **No** QAndA with the `missing` tag. + + 1. Test case: `quiz t/heart`
+ Expected: A card showing a QAndA with the `heart` tag appears. + + 1. Test case: `quiz t/missing`
+ Expected: No QAndA is shown. Error message shown in the result box. + +1. Attempting a quiz + + 1. Prerequisites: QAndA(s) with the `immune system` tag. Start the quiz by following step 2 in the previous + test case (i.e. `quiz t/immune system`) + + 1. Test case: `answer white blood cell`
+ Expected: The card displaying the quizzed QAndA now shows the correct answer to the question. + The input answer is displayed in the result box. + + 1. End the quiz with `endquiz`. Repeat step 1. Test case: `white blood cell`
+ Expected: The card displaying the quizzed QAndA remains unchanged. Error message shown in result box. + +
:information_source: +**Note:** Remember to `endquiz` and achieve the prerequisites when starting a new test case. +
-### Deleting a person +### Deleting a QAndA -1. Deleting a person while all persons are being shown +1. Deleting a QAndA while all QAndAs are being shown - 1. Prerequisites: List all persons using the `list` command. Multiple persons in the list. + 1. Prerequisites: List all QAndAs using the `list` command. Multiple QAndAs in the list. 1. Test case: `delete 1`
- Expected: First contact is deleted from the list. Details of the deleted contact shown in the status message. Timestamp in the status bar is updated. + Expected: First QAndA is deleted from the list. Details of the deleted QAndA shown in the result box. 1. Test case: `delete 0`
- Expected: No person is deleted. Error details shown in the status message. Status bar remains the same. + Expected: No QAndA is deleted. Error details shown in the result box. 1. Other incorrect delete commands to try: `delete`, `delete x`, `...` (where x is larger than the list size)
Expected: Similar to previous. -1. _{ more test cases …​ }_ +1. Deleting QAndA while only certain QAndAs are being shown + 1. Prerequisites: Multiple QAndAs with the word `heart` in the question. Find all QAndAs with `heart` in the + question using the `find q/heart` command. + + 1. Test case: `delete 2`
+ Expected: Second QAndA is deleted from the list. Details of the deleted QAndA shown in the result box. + The window continues to display the remaining QAndAs with `heart` in the question. + ### Saving data -1. Dealing with missing/corrupted data files +1. Initial setup of data files + + 1. Download the jar file and move it into an empty folder + + 1. Double-click the jar file.
+ Expected: Shows the GUI with a set of sample QAndAs. + + 1. Exit the app with the `exit` command. + +1. Simulating a missing data file + + 1. Locate the `data` folder and delete the `medmoriser.json` file + + 1. Re-launch the app by double-clicking the jar file.
+ Expected: The app shows the GUI with the same set of sample QAndAs. A new `medmoriser.json` file is created in + the `data` folder. + +1. Simulating a corrupted data file + + 1. Locate the `data` folder and open the `medmoriser.json` file with an editor of your choice. Delete all the data + and replace it with random characters (e.g. `abcdef123456`), then save the file. + + 1. Re-launch the app by double-clicking the jar file.
+ Expected: Shows the GUI with no QAndAs. + + 1. Add a QAndA into the app. Exit the app with the `exit` command. + Expected: The random characters in `medmoriser.json` are replaced with the json data of the new QAndA. + +## Appendix: Effort + +This section explains the difficulty level, challenges faced, effort required, and achievements of Medmoriser. + +
:information_source: +**Note:** The examples used below are explained in comparison to AB3. + +
+ + +Making Medmoriser was particularly difficult as there were many challenges we faced along the way: - 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ +1. There was a need to change a large portion of the AB3 code, as we had a completely different set of variables for Medmoriser. We had to do a lot of refactoring in the form of renaming class and attributes. The restrictions on fields in AB3 were also different from those in Medmoriser (eg. Person in AB3 cannot have special characters, but Question in Medmoriser can), and we had to edit those restrictions respectively. +2. Implementing a quizzing feature required a deep understanding of the design of AB3. Merely manipulating variables in existing code was not sufficient here, and we had to create many new classes such as `QuizCommand`, `AnswerCommand`, `NextCommand`and `EndQuizCommand`. We also had to come up with ways to keep track of the state of the application, such as whether the user is in an ongoing quiz, whether the user has entered an answer for a quiz question, and whether a quiz question has been asked before when choosing the next question to show the user in a quiz. There was not a need for this in AB3. +3. The numerous new classes created and enhancements to existing commands meant that a lot more effort was required to implement testing for Medmoriser. This is evident in our implementation of new test classes (eg. `QuizCommandTest`, `QuizCommandParserTest`, `AnswerCommandTest`, `EndQuizTest` , etc) and additional test cases in existing test classes (eg `FindCommandTest`, `ListCommandTest`, etc). -1. _{ more test cases …​ }_ +Despite the difficulties mentioned above, we managed to overcome them and come up with a fully functional product that we are proud of. diff --git a/docs/SettingUp.md b/docs/SettingUp.md index b89b691fed9..0280883ed48 100644 --- a/docs/SettingUp.md +++ b/docs/SettingUp.md @@ -23,7 +23,7 @@ If you plan to use Intellij IDEA (highly recommended): 1. **Import the project as a Gradle project**: Follow the guide [_[se-edu/guides] IDEA: Importing a Gradle project_](https://se-education.org/guides/tutorials/intellijImportGradleProject.html) to import the project into IDEA.
:exclamation: Note: Importing a Gradle project is slightly different from importing a normal Java project. 1. **Verify the setup**: - 1. Run the `seedu.address.Main` and try a few commands. + 1. Run the `seedu.medmoriser.Main` and try a few commands. 1. [Run the tests](Testing.md) to ensure they all pass. -------------------------------------------------------------------------------------------------------------------- @@ -45,7 +45,7 @@ If you plan to use Intellij IDEA (highly recommended): 1. **Learn the design** - When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [AddressBook’s architecture](DeveloperGuide.md#architecture). + When you are ready to start coding, we recommend that you get some sense of the overall design by reading about [Medmoriser’s architecture](DeveloperGuide.md#architecture). 1. **Do the tutorials** These tutorials will help you get acquainted with the codebase. diff --git a/docs/Testing.md b/docs/Testing.md index 8a99e82438a..31a4ee50cb2 100644 --- a/docs/Testing.md +++ b/docs/Testing.md @@ -29,8 +29,8 @@ There are two ways to run tests. This project has three types of tests: 1. *Unit tests* targeting the lowest level methods/classes.
- e.g. `seedu.address.commons.StringUtilTest` + e.g. `seedu.medmoriser.commons.StringUtilTest` 1. *Integration tests* that are checking the integration of multiple code units (those code units are assumed to be working).
- e.g. `seedu.address.storage.StorageManagerTest` + e.g. `seedu.medmoriser.storage.StorageManagerTest` 1. Hybrids of unit and integration tests. These test are checking multiple code units as well as how the are connected together.
- e.g. `seedu.address.logic.LogicManagerTest` + e.g. `seedu.medmoriser.logic.LogicManagerTest` diff --git a/docs/UserGuide.md b/docs/UserGuide.md index b91c3bab04d..b3e093cc849 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -3,176 +3,354 @@ layout: page title: User Guide --- -AddressBook Level 3 (AB3) is a **desktop app for managing contacts, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). If you can type fast, AB3 can get your contact management tasks done faster than traditional GUI apps. +## Introduction -* Table of Contents +Hi Medical Student! Welcome to the User Guide for **Medmoriser**! + +**Medmoriser** is a desktop app to help medical students organise, memorise and revise their content. + +This guide aims to orientate you to the features of **Medmoriser**. If you're looking for a quiz +management system, this guide will give you all the information you need to get started with **Medmoriser**. + +* Table of Contents: {:toc} -------------------------------------------------------------------------------------------------------------------- -## Quick start +## How to use this guide -1. Ensure you have Java `11` or above installed in your Computer. +The explanation for each feature follows the template: -1. Download the latest `addressbook.jar` from [here](https://github.com/se-edu/addressbook-level3/releases). +> Introduction of feature +> +> Format of command +> +> * Details about behaviour of the command +> * are in the bulletpoints +> +> Examples: +> +> * example of the command usage -1. Copy the file to the folder you want to use as the _home folder_ for your AddressBook. +
-1. Double-click the file to start the app. The GUI similar to the below should appear in a few seconds. Note how the app contains some sample data.
- ![Ui](images/Ui.png) +**:information_source: Notes about the command format:**
-1. Type the command in the command box and press Enter to execute it. e.g. typing **`help`** and pressing Enter will open the help window.
- Some example commands you can try: +* Words in `UPPER_CASE` are the parameters to be supplied by the user.
+ e.g. in `add q/QUESTION`, `QUESTION` is a parameter which can be used as `add q/What is the heart responsible for?`. - * **`list`** : Lists all contacts. +* Items in square brackets are optional.
+ e.g. `q/QUESTION [t/TAG]` can be used as `q/What is the heart responsible for? t/cardiology` or as `q/What is the heart responsible for?` - * **`add`**`n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` : Adds a contact named `John Doe` to the Address Book. +* Items with `…`​ after them can be used multiple times including zero times.
+ e.g. `[t/TAG]…​` can be used as ` ` (i.e. 0 times), `t/heart`, `t/heart t/cardiology` etc. - * **`delete`**`3` : Deletes the 3rd contact shown in the current list. +* Parameters can be in any order.
+ e.g. if the command specifies `q/QUESTION a/ANSWER`, `a/ANSWER q/QUESTION` is also acceptable. - * **`clear`** : Deletes all contacts. +
- * **`exit`** : Exits the app. +## Features -1. Refer to the [Features](#features) below for details of each command. +This section will bring you through various features of Medmoriser. After this section, you will know how to use most of the commands available. --------------------------------------------------------------------------------------------------------------------- +You can follow the instructions one by one, or jump to your feature of interest. For a summary of all commands, please refer to the [Command Summary](#command-summary) section at the end of this guide. -## Features +### Viewing help: `help` -
+If you need to view the help page, this command shows a message explaining how to access it. -**:information_source: Notes about the command format:**
+Format: `help` -* Words in `UPPER_CASE` are the parameters to be supplied by the user.
- e.g. in `add n/NAME`, `NAME` is a parameter which can be used as `add n/John Doe`. +### Adding a QAndA: `add` (by: Cheng Jiyuqing) -* Items in square brackets are optional.
- e.g `n/NAME [t/TAG]` can be used as `n/John Doe t/friend` or as `n/John Doe`. +You can add a QAndA to the database. You can tag this pair with tag(s) of your choice. It is also okay to not tag the question at all. -* Items with `…`​ after them can be used multiple times including zero times.
- e.g. `[t/TAG]…​` can be used as ` ` (i.e. 0 times), `t/friend`, `t/friend t/family` etc. +Format: `add q/QUESTION a/ANSWER [t/TAG]…​` -* Parameters can be in any order.
- e.g. if the command specifies `n/NAME p/PHONE_NUMBER`, `p/PHONE_NUMBER n/NAME` is also acceptable. +Examples: +* `add q/what organ system is the lungs part of? a/respiratory system.` +* `add q/what organ system is the lungs part of? a/respiratory system? t/Body systems t/Respiratory system.` +* `add q/what is the function of the heart? a/It's the muscle at the centre of your circulation system, pumping blood around your body as your heart beats. This blood sends oxygen and nutrients to all parts of your body, and carries away unwanted carbon dioxide and waste products.` -
+How it should look in the application: -### Viewing help : `help` +Add with tag: -Shows a message explaning how to access the help page. +![Add With Tag](images/AddCommandEg1.png) -![help message](images/helpMessage.png) +Expected result: -Format: `help` +![Add With Tag](images/AddCommandEg2.png) + +### Deleting a QAndA: `delete` (by: Teng Jian Ling) +You can delete a specified QAndA from the database. -### Adding a person: `add` +Format: `delete INDEX` -Adds a person to the address book. +* This allows you to delete the QAndA at the specified `INDEX`. +* The index refers to the index number shown in the displayed QAndA list. -Format: `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​` +Examples: + +* `list` followed by `delete 2` deletes the 2nd QAndA in the list. +* `find disease` followed by `delete 1` deletes the 1st QAndA in the results of the `find` command. + +
+**:information_source: Note about the delete command:**
+ +The index **must be a positive integer** (1, 2, 3, ...) within the range of the number of QAndAs in the displayed list. -
:bulb: **Tip:** -A person can have any number of tags (including 0)
+How it should look in the application: + +Entering the command: + +![DeleteContext](images/DeleteContext.png) + +Expected Result: + +![DeleteResult](images/DeleteResult.png) + +The `delete 4 ` command deletes the 4th QAndA in the database, as shown above. + +### Listing all QAndAs: `list` (by: Jonathan Foo) + +You can use this command to view all the QAndAs you have added. + +Format: `list [questions]` + +* Entering `list` will list all QAndAs, with both questions and answers displayed. +* Adding the `questions` parameter will list all QAndAs, with only the questions displayed (i.e. hide the answers) + Examples: -* `add n/John Doe p/98765432 e/johnd@example.com a/John street, block 123, #01-01` -* `add n/Betsy Crowe t/friend e/betsycrowe@example.com a/Newgate Prison p/1234567 t/criminal` +* `list` - show all questions and answers +* `list questions` - show all questions -### Listing all persons : `list` +The expected behaviour of `list` is shown below: -Shows a list of all persons in the address book. +![ListCommand](images/ListCommand.png) -Format: `list` +The expected behaviour of `list questions` is shown below: -### Editing a person : `edit` +![ListQuestionsCommand](images/ListQuestionsCommand.png) -Edits an existing person in the address book. +### Editing a QAndA: `edit` (by: Teng Jian Ling) -Format: `edit INDEX [n/NAME] [p/PHONE] [e/EMAIL] [a/ADDRESS] [t/TAG]…​` +You can make changes to an existing QAndA with this command. -* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index **must be a positive integer** 1, 2, 3, …​ -* At least one of the optional fields must be provided. +Format: `edit INDEX [q/QUESTION] [a/ANSWER] [t/TAG]…​` + +* This allows you to edit the QAndA at the specified `INDEX`. The index refers to the index number shown in the displayed QAndA list. * Existing values will be updated to the input values. -* When editing tags, the existing tags of the person will be removed i.e adding of tags is not cumulative. -* You can remove all the person’s tags by typing `t/` without - specifying any tags after it. Examples: -* `edit 1 p/91234567 e/johndoe@example.com` Edits the phone number and email address of the 1st person to be `91234567` and `johndoe@example.com` respectively. -* `edit 2 n/Betsy Crower t/` Edits the name of the 2nd person to be `Betsy Crower` and clears all existing tags. -### Locating persons by name: `find` +* `edit 1 a/To pump blood` - Edits the answer the 1st question to be `To pump blood`. +* `edit 2 q/how many bones are there in an ADULT human skeleton? t/` - Edits the question of the 2nd QAndA to be `how many bones are there in an ADULT human skeleton?` and clears all existing tags. + +
+**:information_source: Notes about the edit command:**
+ +* When you edit the tags, the existing tags of the QAndA will be removed i.e adding of tags is not cumulative. +* You must provide at least one of the optional fields. +* The index **must be a positive integer** (1, 2, 3, ...) within the range of the number of QAndAs in the displayed list. -Finds persons whose names contain any of the given keywords. +
-Format: `find KEYWORD [MORE_KEYWORDS]` +
-* The search is case-insensitive. e.g `hans` will match `Hans` -* The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` -* Only the name is searched. -* Only full words will be matched e.g. `Han` will not match `Hans` -* Persons matching at least one keyword will be returned (i.e. `OR` search). - e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` +**:bulb: Tip:**
-Examples: -* `find John` returns `john` and `John Doe` -* `find alex david` returns `Alex Yeoh`, `David Li`
- ![result for 'find alex david'](images/findAlexDavidResult.png) +You can remove all the QAndA's tags by typing `t/` without specifying any tags after it. -### Deleting a person : `delete` +
-Deletes the specified person from the address book. +How it should look in the application: -Format: `delete INDEX` +Entering the edit command: + +![EditContext](images/EditContext.png) + +Expected Result: + +![EditResult](images/EditResult.png) + +The `edit 6 q/how many bones are there in an ADULT human skeleton? t/ ` input will edit the QAndA at index 6 and remove all tags as shown. + +### Finding QAndA by keywords: `find` (by: Yong Ming Yang) +The `find` function allows you to find existing QAndA based on keywords and phrases. + +If you would like to search the database based on keywords or phrases, you can do so in a few ways by following the respective formats: + +1. Find QAndA with **questions** containing any of the given keywords. + + Format: `find q/KEYWORD`, for 2 or more words: `find q/PHRASE 1, KEYWORD1` -* Deletes the person at the specified `INDEX`. -* The index refers to the index number shown in the displayed person list. -* The index **must be a positive integer** 1, 2, 3, …​ +2. Find QAndA with **answers** containing any of the given keywords. + + Format: `find a/KEYWORD`, for 2 or more words: `find q/PHRASE 1, KEYWORD1` + +3. Find QAndA with **tags** containing any of the given keywords. + Keywords for tags can also have phrases, however this requires the text to have an exact match (case-insensitive). + + Format: `find t/KEYWORD`, for 2 or more words: `find q/PHRASE1, KEYWORD1` + +4. Find QAndA with **questions or answers** containing any of the given keywords. + + Format: `find KEYWORD`, for 2 or more words: `find PHRASE, KEYWORD1` Examples: -* `list` followed by `delete 2` deletes the 2nd person in the address book. -* `find Betsy` followed by `delete 1` deletes the 1st person in the results of the `find` command. +* `find q/system, disease` - finds questions containing the word "system" and/or "disease". +* `find a/vessels, chronic disease` - finds answers containing the word vessels, and/or the phrase "chronic disease". +* `find t/anatomy, Nervous System` - finds QAndAs tagged with the word "anatomy" and/or "Nervous System" (can be both), requires exact match of words (case-insensitive). +* `find infection, nervous system` - finds question and/or answers containing the word "infection", and/or the phrase "nervous system" + +
+ +**:bulb: Tip:**
+`PHRASE` refers to words with spaces in between, for example: "nervous system" + +
+ +How it should look like in the application: + +![FindContext](images/FindContext.PNG) + +Expected Result: + +![FindResult](images/FindResult.PNG) -### Clearing all entries : `clear` +The input `find t/respiratory system, disease` will return the questions with the tag "respiratory system" and/or "disease" as shown. -Clears all entries from the address book. +### Clearing all entries: `clear` + +If you want to reset your question book, this command clears all existing entries. Format: `clear` -### Exiting the program : `exit` +### Starting a quiz: `quiz` (by: Joshua Tan) + +You will be able to test yourself on your knowledge from the questions that you added into the application. +Medmoriser will randomly select a question to quiz you based on the keywords you provide. + +There are 2 ways that you can quiz yourself. By question keywords or by tag keywords. If multiple keywords are given, you will be quizzed on a question that has any of the keywords, or all of the keywords. + +1. Quiz a QAndA with **questions** containing any of the given keywords. + + Format: `quiz q/KEYWORD`, for 2 or more words: `quiz q/PHRASE 1, KEYWORD 1` + +2. Quiz a QAndA wih **tag** containing any of the given keywords. + + Format: `quiz t/KEYWORD`, for 2 or more words: `quiz t/PHRASE 1, KEYWORD 1` + +Examples: +* `quiz q/immunology` - randomly quizzes a question containing the word "immunology". +* `quiz t/surgery, injuries` - randomly quizzes a question that was tagged with the word "surgery" and/or "injuries" (can be both), requires exact match of words (case-insensitive). + +
+ +**:bulb: Tip:**
+To run other commands other than `next` or `answer`, you have to first `endquiz`. + +
+ +How it should look like in the application: + +![QuizContext](images/QuizContext.png) + +Expected Result: + +![QuizResult](images/QuizResult.png) + +### Answering a quiz question: `answer` (by: Joshua Tan) +You will be able to key in your answer for a quiz question. After your answer is submitted, Medmoriser will flash the correct answer to the question and you will be able to check your answer: + +Format: `answer YOUR_ANSWER` + +Example: +* `answer This is my answer to the quiz question` + +### Moving to next quiz question: `next` (by: Teng Jian Ling) +You will be able to continue testing yourself without ending the current quiz. Medmoriser will randomly select a different quiz question based on the same keywords you provided previously. + +Format: `next` + +Example: +* `next` - will show you the next question in this quiz + +
+**:bulb: Tip:**
+If you want to skip the current quiz question, you can enter `next` without answering first. +
+ +
+**:information_source: Notes about the edit command:**
+ +* You can only use the `next` command when you are in an ongoing quiz. +* When there are no more questions with the specified keywords, you will not be able to use `next` to retrieve another quiz question. + +
+ +How it should look like in the application: + +![QuizContext](images/NextContext.png) + +Expected Result: -Exits the program. +![QuizResult](images/NextResult.png) + +Assuming the user is in a quiz for `t/respiratory system`, the input `next` will display a new randomly selected question with the tag `respiratory system`, as shown above. + +### Ending a quiz: `endquiz` (by: Joshua Tan) +Once you are done with a quiz and have finished comparing your input answer with the answer in the question, you have to end the quiz to run other commands. +If you want to run other commands in the midst of a quiz(ie. if you have not answered the question) you have to end the quiz first: + +Format: `endquiz` + +### Exiting the program: `exit` + +If you're done with your work, this command allows you to exit the program. You can also exit the application by closing its window like any normal program window. Format: `exit` ### Saving the data -AddressBook data are saved in the hard disk automatically after any command that changes the data. There is no need to save manually. +You don't need to worry about saving data manually, as Medmoriser data is automatically saved in the hard disk after any command that changes the data. -### Archiving data files `[coming in v2.0]` +### Archiving data files [Coming Soon] -_{explain the feature here}_ +If you don't need certain questions anymore, you can archive them to declutter your workspace. -------------------------------------------------------------------------------------------------------------------- ## FAQ +Commonly asked questions and answers. **Q**: How do I transfer my data to another Computer?
-**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous AddressBook home folder. +**A**: Install the app in the other computer and overwrite the empty data file it creates with the file that contains the data of your previous Medmoriser home folder. -------------------------------------------------------------------------------------------------------------------- + ## Command summary +A brief summary of all the commands available. For details of when and how each command should be used, please refer to +the [Features](#features) section. Action | Format, Examples --------|------------------ -**Add** | `add n/NAME p/PHONE_NUMBER e/EMAIL a/ADDRESS [t/TAG]…​`
e.g., `add n/James Ho p/22224444 e/jamesho@example.com a/123, Clementi Rd, 1234665 t/friend t/colleague` +**Add** | `add q/QUESTION a/ANSWER [t/TAG]…​`
e.g. `add q/What does the heart do? a/Pump blood t/heart t/cardiology` +**Delete** | `delete INDEX`
e.g. `delete 3` +**List** | `list [questions]` +**Edit** | `edit INDEX [q/QUESTION] [a/ANSWER] [t/TAG]…​`
e.g. `edit 1 a/Maintain blood pressure t/cardiology` +**Find** | `find KEYWORD or [q/QUESTION_KEYWORD] or [a/ANSWER_KEYWORD] or [t/TAG_KEYWORD]`
e.g. `find system` or `find a/answer1, answer 2` +**Quiz** | `quiz [q/QUESTION_KEYWORD] or [t/TAG_KEYWORD]`
e.g. `quiz q/blood` or `quiz t/Immune System` +**Answer** | `answer YOUR_ANSWER`
e.g. `answer This is my answer` +**Next** | `next` +**End Quiz** | `endquiz` **Clear** | `clear` -**Delete** | `delete INDEX`
e.g., `delete 3` -**Edit** | `edit INDEX [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [t/TAG]…​`
e.g.,`edit 2 n/James Lee e/jameslee@example.com` -**Find** | `find KEYWORD [MORE_KEYWORDS]`
e.g., `find James Jake` -**List** | `list` **Help** | `help` +**Exit** | `exit` + diff --git a/docs/_config.yml b/docs/_config.yml index 6bd245d8f4e..20e9ac5848c 100644 --- a/docs/_config.yml +++ b/docs/_config.yml @@ -1,4 +1,4 @@ -title: "AB-3" +title: "Medmoriser" theme: minima header_pages: @@ -8,7 +8,7 @@ header_pages: markdown: kramdown -repository: "se-edu/addressbook-level3" +repository: "AY2021S1-CS2103T-W15-1/tp" github_icon: "images/github-icon.png" plugins: diff --git a/docs/diagrams/ArchitectureSequenceDiagram.puml b/docs/diagrams/ArchitectureSequenceDiagram.puml index ef81d18c337..354b292d73a 100644 --- a/docs/diagrams/ArchitectureSequenceDiagram.puml +++ b/docs/diagrams/ArchitectureSequenceDiagram.puml @@ -13,13 +13,13 @@ activate ui UI_COLOR ui -[UI_COLOR]> logic : execute("delete 1") activate logic LOGIC_COLOR -logic -[LOGIC_COLOR]> model : deletePerson(p) +logic -[LOGIC_COLOR]> model : deleteQAndA(qAndAToDelete) activate model MODEL_COLOR model -[MODEL_COLOR]-> logic deactivate model -logic -[LOGIC_COLOR]> storage : saveAddressBook(addressBook) +logic -[LOGIC_COLOR]> storage : saveMedmoriser(model.getMedmoriser()); activate storage STORAGE_COLOR storage -[STORAGE_COLOR]> storage : Save to file diff --git a/docs/diagrams/BetterModelClassDiagram.puml b/docs/diagrams/BetterModelClassDiagram.puml index 29076104af3..1d0e24d5c03 100644 --- a/docs/diagrams/BetterModelClassDiagram.puml +++ b/docs/diagrams/BetterModelClassDiagram.puml @@ -4,18 +4,16 @@ skinparam arrowThickness 1.1 skinparam arrowColor MODEL_COLOR skinparam classBackgroundColor MODEL_COLOR -AddressBook *-right-> "1" UniquePersonList -AddressBook *-right-> "1" UniqueTagList -UniqueTagList -[hidden]down- UniquePersonList -UniqueTagList -[hidden]down- UniquePersonList +Medmoriser *-right-> "1" UniqueQAndAList +Medmoriser *-right-> "1" UniqueTagList +UniqueTagList -[hidden]down- UniqueQAndAList +UniqueTagList -[hidden]down- UniqueQAndAList UniqueTagList *-right-> "*" Tag -UniquePersonList o-right-> Person +UniqueQAndAList o-right-> QAndA -Person -up-> "*" Tag +QAndA -up-> "*" Tag -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address +QAndA *--> Question +QAndA *--> Answer @enduml diff --git a/docs/diagrams/DeleteActivityDiagram.puml b/docs/diagrams/DeleteActivityDiagram.puml new file mode 100644 index 00000000000..353b0974fb2 --- /dev/null +++ b/docs/diagrams/DeleteActivityDiagram.puml @@ -0,0 +1,15 @@ +@startuml + +start +:User executes delete command; +:Parse the delete command; +if () then ([quiz is in progress or index out of bounds]) + :Throw CommandException; +else ([else]) + :Delete the QAndA specified; + :Display success message; +endif + +stop + +@enduml diff --git a/docs/diagrams/DeleteSequenceDiagram.puml b/docs/diagrams/DeleteSequenceDiagram.puml index 1dc2311b245..251f8e35e91 100644 --- a/docs/diagrams/DeleteSequenceDiagram.puml +++ b/docs/diagrams/DeleteSequenceDiagram.puml @@ -3,10 +3,10 @@ box Logic LOGIC_COLOR_T1 participant ":LogicManager" as LogicManager LOGIC_COLOR -participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR -participant ":DeleteCommandParser" as DeleteCommandParser LOGIC_COLOR -participant "d:DeleteCommand" as DeleteCommand LOGIC_COLOR -participant ":CommandResult" as CommandResult LOGIC_COLOR +participant ":MedmoriserParser" as MedmoriserParser MEDMORISER_PARSER_COLOR +participant ":DeleteCommandParser" as DeleteCommandParser COMMAND_PARSER_COLOR +participant "d:DeleteCommand" as DeleteCommand COMMAND_COLOR +participant ":CommandResult" as CommandResult COMMAND_RESULT_COLOR end box box Model MODEL_COLOR_T1 @@ -16,17 +16,17 @@ end box [-> LogicManager : execute("delete 1") activate LogicManager -LogicManager -> AddressBookParser : parseCommand("delete 1") -activate AddressBookParser +LogicManager -> MedmoriserParser : parseCommand("delete 1") +activate MedmoriserParser create DeleteCommandParser -AddressBookParser -> DeleteCommandParser +MedmoriserParser -> DeleteCommandParser activate DeleteCommandParser -DeleteCommandParser --> AddressBookParser +DeleteCommandParser --> MedmoriserParser deactivate DeleteCommandParser -AddressBookParser -> DeleteCommandParser : parse("1") +MedmoriserParser -> DeleteCommandParser : parse("1") activate DeleteCommandParser create DeleteCommand @@ -36,19 +36,19 @@ activate DeleteCommand DeleteCommand --> DeleteCommandParser : d deactivate DeleteCommand -DeleteCommandParser --> AddressBookParser : d +DeleteCommandParser --> MedmoriserParser : d deactivate DeleteCommandParser 'Hidden arrow to position the destroy marker below the end of the activation bar. -DeleteCommandParser -[hidden]-> AddressBookParser +DeleteCommandParser -[hidden]-> MedmoriserParser destroy DeleteCommandParser -AddressBookParser --> LogicManager : d -deactivate AddressBookParser +MedmoriserParser --> LogicManager : d +deactivate MedmoriserParser LogicManager -> DeleteCommand : execute() activate DeleteCommand -DeleteCommand -> Model : deletePerson(1) +DeleteCommand -> Model : deleteQAndA(1) activate Model Model --> DeleteCommand diff --git a/docs/diagrams/EditSequenceDiagram.puml b/docs/diagrams/EditSequenceDiagram.puml new file mode 100644 index 00000000000..79e006d0fcb --- /dev/null +++ b/docs/diagrams/EditSequenceDiagram.puml @@ -0,0 +1,75 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":MedmoriserParser" as MedmoriserParser MEDMORISER_PARSER_COLOR +participant ":EditCommandParser" as EditCommandParser COMMAND_PARSER_COLOR +participant "e:EditCommand" as EditCommand COMMAND_COLOR +participant ":CommandResult" as CommandResult COMMAND_RESULT_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box + +[-> LogicManager : execute("edit 1 q/what causes acne?") +activate LogicManager + +LogicManager -> MedmoriserParser : parseCommand("edit 1 q/what causes acne?") +activate MedmoriserParser + +create EditCommandParser +MedmoriserParser -> EditCommandParser +activate EditCommandParser + +EditCommandParser --> MedmoriserParser +deactivate EditCommandParser + +MedmoriserParser -> EditCommandParser : parse("1 q/what causes acne?") +activate EditCommandParser + +create EditCommand +EditCommandParser -> EditCommand +activate EditCommand + +EditCommand --> EditCommandParser : e +deactivate EditCommand + +EditCommandParser --> MedmoriserParser : e +deactivate EditCommandParser +'Hidden arrow to position the destroy marker below the end of the activation bar. +EditCommandParser -[hidden]-> MedmoriserParser +destroy EditCommandParser + +MedmoriserParser --> LogicManager : e +deactivate MedmoriserParser + +LogicManager -> EditCommand : execute() +activate EditCommand + +EditCommand -> Model : setQAndA(qAndAToEdit, editedQAndA) +activate Model + +Model --> EditCommand +deactivate Model + +EditCommand -> Model : updateFilteredQAndAList(PREDICATE_SHOW_ALL_QANDA) +activate Model + +Model --> EditCommand +deactivate Model + +create CommandResult +EditCommand -> CommandResult +activate CommandResult + +CommandResult --> EditCommand +deactivate CommandResult + +EditCommand --> LogicManager : result +deactivate EditCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/FindActivityDiagram.puml b/docs/diagrams/FindActivityDiagram.puml new file mode 100644 index 00000000000..a43e64083cc --- /dev/null +++ b/docs/diagrams/FindActivityDiagram.puml @@ -0,0 +1,25 @@ +@startuml +!include style.puml + +start +:"Find command is executed"; +:"Command is parsed"; + +if (command is valid) then (valid) + :identify find command type; + if (find in tags) then (yes) + :retrieve tag predicate; + elseif (find in answers) then (yes) + :retrieve answer predicate; + elseif (find in questions) then + :retrieve question predicate; + else + :retrieve QAndA predicate; + endif + :retrieve list of questions; +else (invalid) + :"Show invalid command message"; +endif +:show on GUI; +stop +@enduml diff --git a/docs/diagrams/FindSequenceDiagram.puml b/docs/diagrams/FindSequenceDiagram.puml new file mode 100644 index 00000000000..ef35a851272 --- /dev/null +++ b/docs/diagrams/FindSequenceDiagram.puml @@ -0,0 +1,69 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":MedmoriserParser" as MedmoriserParser MEDMORISER_PARSER_COLOR +participant ":FindCommandParser" as FindCommandParser COMMAND_PARSER_COLOR +participant "f:FindCommand" as FindCommand COMMAND_COLOR +participant ":CommandResult" as CommandResult COMMAND_RESULT_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box + +[-> LogicManager : execute("find Immunology") +activate LogicManager + +LogicManager -> MedmoriserParser : parseCommand("find Immunology") +activate MedmoriserParser + +create FindCommandParser +MedmoriserParser -> FindCommandParser +activate FindCommandParser + +FindCommandParser --> MedmoriserParser +deactivate FindCommandParser + +MedmoriserParser -> FindCommandParser : parse("Immunology") +activate FindCommandParser + +create FindCommand +FindCommandParser -> FindCommand +activate FindCommand + +FindCommand --> FindCommandParser : f +deactivate FindCommand + +FindCommandParser --> MedmoriserParser : f +deactivate FindCommandParser +'Hidden arrow to position the destroy marker below the end of the activation bar. +FindCommandParser -[hidden]-> MedmoriserParser +destroy FindCommandParser + +MedmoriserParser --> LogicManager : f +deactivate MedmoriserParser + +LogicManager -> FindCommand : execute() +activate FindCommand + +FindCommand -> Model : updateFilteredQAndAList(predicate) +activate Model + +Model --> FindCommand +deactivate Model + +create CommandResult +FindCommand -> CommandResult +activate CommandResult + +CommandResult --> FindCommand +deactivate CommandResult + +FindCommand --> LogicManager : result +deactivate FindCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/ListActivityDiagram.puml b/docs/diagrams/ListActivityDiagram.puml new file mode 100644 index 00000000000..1c1602a3425 --- /dev/null +++ b/docs/diagrams/ListActivityDiagram.puml @@ -0,0 +1,12 @@ +@startuml +:User enters list command; +:User input is parsed; +:Update model to return all QAndAs; +:Check if answers are to be displayed; +if () then ([answersDisplayed]) + :Set answers to be visible; +else ([else]) + :Set answers to be hidden; +endif +:Show all QAndAs on GUI; +@enduml diff --git a/docs/diagrams/ListSequenceDiagram.puml b/docs/diagrams/ListSequenceDiagram.puml new file mode 100644 index 00000000000..a5fa5fb2e65 --- /dev/null +++ b/docs/diagrams/ListSequenceDiagram.puml @@ -0,0 +1,89 @@ +@startuml +!include style.puml + +box Ui UI_COLOR_T1 +participant ":MainWindow" as MainWindow UI_COLOR +end box + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":MedmoriserParser" as MedmoriserParser LOGIC_COLOR +participant ":ListCommandParser" as ListCommandParser LOGIC_COLOR +participant "l:ListCommand" as ListCommand LOGIC_COLOR +participant ":CommandResult" as CommandResult LOGIC_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box + +[-> MainWindow +activate MainWindow +MainWindow -> MainWindow : executeCommand("list questions") +activate MainWindow #cecece + +MainWindow -> LogicManager : execute("list questions") +activate LogicManager + +LogicManager -> MedmoriserParser : parseCommand("list questions") +activate MedmoriserParser + +create ListCommandParser +MedmoriserParser -> ListCommandParser +activate ListCommandParser + +ListCommandParser --> MedmoriserParser +deactivate ListCommandParser + +MedmoriserParser -> ListCommandParser : parse("questions") +activate ListCommandParser + +create ListCommand +ListCommandParser -> ListCommand +activate ListCommand + +ListCommand --> ListCommandParser : l +deactivate ListCommand + +ListCommandParser --> MedmoriserParser : l +deactivate ListCommandParser +'Hidden arrow to position the destroy marker below the end of the activation bar. +ListCommandParser -[hidden]-> MedmoriserParser +destroy ListCommandParser + +MedmoriserParser --> LogicManager : l +deactivate MedmoriserParser + +LogicManager -> ListCommand : execute() +activate ListCommand + +ListCommand -> Model : updateFilteredQAndAList(predicate) +activate Model + +Model --> ListCommand +deactivate Model + +create CommandResult +ListCommand -> CommandResult +activate CommandResult + +CommandResult --> ListCommand +deactivate CommandResult + +ListCommand --> LogicManager : result +deactivate ListCommand + +MainWindow <--LogicManager : result +deactivate LogicManager + +MainWindow -> MainWindow : handleList() +activate MainWindow #949494 + +MainWindow --> MainWindow +deactivate MainWindow + +MainWindow --> MainWindow +deactivate MainWindow +[<--MainWindow + +@enduml diff --git a/docs/diagrams/LogicClassDiagram.puml b/docs/diagrams/LogicClassDiagram.puml index 016ef33e2e2..7f6708e37cb 100644 --- a/docs/diagrams/LogicClassDiagram.puml +++ b/docs/diagrams/LogicClassDiagram.puml @@ -8,7 +8,7 @@ package Logic { package Parser { Interface Parser <> -Class AddressBookParser +Class MedmoriserParser Class XYZCommandParser Class CliSyntax Class ParserUtil @@ -35,8 +35,8 @@ Class HiddenOutside #FFFFFF HiddenOutside ..> Logic LogicManager .up.|> Logic -LogicManager -->"1" AddressBookParser -AddressBookParser .left.> XYZCommandParser: creates > +LogicManager -->"1" MedmoriserParser +MedmoriserParser .left.> XYZCommandParser: creates > XYZCommandParser ..> XYZCommand : creates > XYZCommandParser ..|> Parser diff --git a/docs/diagrams/ModelClassDiagram.puml b/docs/diagrams/ModelClassDiagram.puml index e85a00d4107..b9f1832525b 100644 --- a/docs/diagrams/ModelClassDiagram.puml +++ b/docs/diagrams/ModelClassDiagram.puml @@ -5,23 +5,21 @@ skinparam arrowColor MODEL_COLOR skinparam classBackgroundColor MODEL_COLOR Package Model <>{ -Interface ReadOnlyAddressBook <> +Interface ReadOnlyMedmoriser <> Interface Model <> Interface ObservableList <> -Class AddressBook -Class ReadOnlyAddressBook +Class Medmoriser +Class ReadOnlyMedmoriser Class Model Class ModelManager Class UserPrefs Class ReadOnlyUserPrefs -Package Person { -Class Person -Class Address -Class Email -Class Name -Class Phone -Class UniquePersonList +Package QAndA { +Class QAndA +Class Answer +Class Question +Class UniqueQAndAList } Package Tag { @@ -32,25 +30,19 @@ Class Tag Class HiddenOutside #FFFFFF HiddenOutside ..> Model -AddressBook .up.|> ReadOnlyAddressBook +Medmoriser .up.|> ReadOnlyMedmoriser ModelManager .up.|> Model Model .right.> ObservableList -ModelManager o--> "1" AddressBook +ModelManager o--> "1" Medmoriser ModelManager o-left-> "1" UserPrefs UserPrefs .up.|> ReadOnlyUserPrefs -AddressBook *--> "1" UniquePersonList -UniquePersonList o--> "*" Person -Person *--> Name -Person *--> Phone -Person *--> Email -Person *--> Address -Person *--> "*" Tag +Medmoriser *--> "1" UniqueQAndAList +UniqueQAndAList o--> "*" QAndA +QAndA *--> Question +QAndA *--> Answer +QAndA *--> "*" Tag -Name -[hidden]right-> Phone -Phone -[hidden]right-> Address -Address -[hidden]right-> Email - -ModelManager -->"1" Person : filtered list +ModelManager -->"1" QAndA : filtered list @enduml diff --git a/docs/diagrams/QuizActivityDiagram.puml b/docs/diagrams/QuizActivityDiagram.puml new file mode 100644 index 00000000000..2eb6a176549 --- /dev/null +++ b/docs/diagrams/QuizActivityDiagram.puml @@ -0,0 +1,20 @@ +@startuml +start +:Quiz command executed; +:Parse the quiz command; + +if () then ([valid command]) + : Identify command type; + if () then ([quiz by tags]) + :retrieve tag predicate; + else ([quiz by questions]) + :retrieve question predicate; + endif + :Randomly select a question based on predicate; + +else ([invalid command]) + :Invalid Command; +endif +:show on GUI; +stop +@enduml diff --git a/docs/diagrams/QuizSequenceDiagram.puml b/docs/diagrams/QuizSequenceDiagram.puml new file mode 100644 index 00000000000..75a8eed267e --- /dev/null +++ b/docs/diagrams/QuizSequenceDiagram.puml @@ -0,0 +1,73 @@ +@startuml +!include style.puml + +box Logic LOGIC_COLOR_T1 +participant ":LogicManager" as LogicManager LOGIC_COLOR +participant ":MedmoriserParser" as MedmoriserParser MEDMORISER_PARSER_COLOR +participant ":QuizCommandParser" as QuizCommandParser COMMAND_PARSER_COLOR +participant "f:QuizCommand" as QuizCommand COMMAND_COLOR +participant ":CommandResult" as CommandResult COMMAND_RESULT_COLOR +end box + +box Model MODEL_COLOR_T1 +participant ":Model" as Model MODEL_COLOR +end box + +[-> LogicManager : execute("quiz t/Infections") +activate LogicManager + +LogicManager -> MedmoriserParser : parseCommand("quiz t/Infections") +activate MedmoriserParser + +create QuizCommandParser +MedmoriserParser -> QuizCommandParser +activate QuizCommandParser + +QuizCommandParser --> MedmoriserParser +deactivate QuizCommandParser + +MedmoriserParser -> QuizCommandParser : parse("t/Infections") +activate QuizCommandParser + +create QuizCommand +QuizCommandParser -> QuizCommand +activate QuizCommand + +QuizCommand --> QuizCommandParser : f +deactivate QuizCommand + +QuizCommandParser --> MedmoriserParser : f +deactivate QuizCommandParser +'Hidden arrow to position the destroy marker below the end of the activation bar. +QuizCommandParser -[hidden]-> MedmoriserParser +destroy QuizCommandParser + +MedmoriserParser --> LogicManager : f +deactivate MedmoriserParser + +LogicManager -> QuizCommand : execute() +activate QuizCommand + +QuizCommand -> QuizCommand : getRandomQuestion(filteredList) + +QuizCommand -> Model : updateFilteredQAndAList(x -> x.equals(question)) +activate Model + +Model --> QuizCommand +deactivate Model + +QuizCommand -> QuizCommand : setIsQuiz(true, model) + +create CommandResult +QuizCommand -> CommandResult +activate CommandResult + +CommandResult --> QuizCommand +deactivate CommandResult + +QuizCommand --> LogicManager : result +deactivate QuizCommand + +[<--LogicManager +deactivate LogicManager +@enduml diff --git a/docs/diagrams/StorageClassDiagram.puml b/docs/diagrams/StorageClassDiagram.puml index 6adb2e156bf..bc4d2fa78a1 100644 --- a/docs/diagrams/StorageClassDiagram.puml +++ b/docs/diagrams/StorageClassDiagram.puml @@ -6,19 +6,19 @@ skinparam classBackgroundColor STORAGE_COLOR Interface Storage <> Interface UserPrefsStorage <> -Interface AddressBookStorage <> +Interface MedmoriserStorage <> Class StorageManager Class JsonUserPrefsStorage -Class JsonAddressBookStorage +Class JsonMedmoriserStorage StorageManager .left.|> Storage StorageManager o-right-> UserPrefsStorage -StorageManager o--> AddressBookStorage +StorageManager o--> MedmoriserStorage JsonUserPrefsStorage .left.|> UserPrefsStorage -JsonAddressBookStorage .left.|> AddressBookStorage -JsonAddressBookStorage .down.> JsonSerializableAddressBookStorage -JsonSerializableAddressBookStorage .right.> JsonSerializablePerson -JsonSerializablePerson .right.> JsonAdaptedTag +JsonMedmoriserStorage .left.|> MedmoriserStorage +JsonMedmoriserStorage .down.> JsonSerializableMedmoriserStorage +JsonSerializableMedmoriserStorage .right.> JsonAdaptedQAndA +JsonAdaptedQAndA .right.> JsonAdaptedTag @enduml diff --git a/docs/diagrams/style.puml b/docs/diagrams/style.puml index fad8b0adeaa..5fa3d42be63 100644 --- a/docs/diagrams/style.puml +++ b/docs/diagrams/style.puml @@ -7,60 +7,68 @@ 'T1 through T4 are shades of the original color from lightest to darkest -!define UI_COLOR #1D8900 -!define UI_COLOR_T1 #83E769 -!define UI_COLOR_T2 #3FC71B +!define UI_COLOR #F28080 +!define UI_COLOR_T1 #D97373 +!define UI_COLOR_T2 #BF6565 !define UI_COLOR_T3 #166800 !define UI_COLOR_T4 #0E4100 -!define LOGIC_COLOR #3333C4 -!define LOGIC_COLOR_T1 #C8C8FA +!define LOGIC_COLOR #A9EEE6 +!define LOGIC_COLOR_T1 #8BC4BE !define LOGIC_COLOR_T2 #6A6ADC !define LOGIC_COLOR_T3 #1616B0 !define LOGIC_COLOR_T4 #101086 -!define MODEL_COLOR #9D0012 -!define MODEL_COLOR_T1 #F97181 +!define MODEL_COLOR #C4AEE6 +!define MODEL_COLOR_T1 v !define MODEL_COLOR_T2 #E41F36 !define MODEL_COLOR_T3 #7B000E !define MODEL_COLOR_T4 #51000A -!define STORAGE_COLOR #A38300 -!define STORAGE_COLOR_T1 #FFE374 +!define STORAGE_COLOR #B3BD84 +!define STORAGE_COLOR_T1 #E4F0A8 !define STORAGE_COLOR_T2 #EDC520 !define STORAGE_COLOR_T3 #806600 !define STORAGE_COLOR_T2 #544400 +!define MEDMORISER_PARSER_COLOR #EDC1C0 +!define COMMAND_PARSER_COLOR #EDC891 + +!define COMMAND_COLOR #83A6DE + +!define COMMAND_RESULT_COLOR #C78FAB + !define USER_COLOR #000000 -skinparam BackgroundColor #FFFFFFF +skinparam BackgroundColor #FEFAEC skinparam Shadowing false skinparam Class { - FontColor #FFFFFF + FontColor #000000 BorderThickness 1 BorderColor #FFFFFF StereotypeFontColor #FFFFFF - FontName Arial + FontName Roboto Light } skinparam Actor { BorderColor USER_COLOR Color USER_COLOR - FontName Arial + FontName Roboto Light } skinparam Sequence { MessageAlign center BoxFontSize 15 BoxPadding 0 - BoxFontColor #FFFFFF - FontName Arial + BoxFontColor #000000 + FontName Roboto Light } skinparam Participant { - FontColor #FFFFFFF + FontColor #000000 + FontName Roboto Light Padding 20 } diff --git a/docs/diagrams/tracing/LogicSequenceDiagram.puml b/docs/diagrams/tracing/LogicSequenceDiagram.puml index fdcbe1c0ccc..5c881e25367 100644 --- a/docs/diagrams/tracing/LogicSequenceDiagram.puml +++ b/docs/diagrams/tracing/LogicSequenceDiagram.puml @@ -13,7 +13,7 @@ create ecp abp -> ecp abp -> ecp ++: parse(arguments) create ec -ecp -> ec ++: index, editPersonDescriptor +ecp -> ec ++: index, editQAndADescriptor ec --> ecp -- ecp --> abp --: command abp --> logic --: command diff --git a/docs/images/AddCommandEg1.png b/docs/images/AddCommandEg1.png new file mode 100644 index 00000000000..12370acc855 Binary files /dev/null and b/docs/images/AddCommandEg1.png differ diff --git a/docs/images/AddCommandEg2.png b/docs/images/AddCommandEg2.png new file mode 100644 index 00000000000..722ca4bcf0b Binary files /dev/null and b/docs/images/AddCommandEg2.png differ diff --git a/docs/images/AddCommandEg3.png b/docs/images/AddCommandEg3.png new file mode 100644 index 00000000000..19ae1ce4907 Binary files /dev/null and b/docs/images/AddCommandEg3.png differ diff --git a/docs/images/AddCommandEg4.png b/docs/images/AddCommandEg4.png new file mode 100644 index 00000000000..7ea8237e793 Binary files /dev/null and b/docs/images/AddCommandEg4.png differ diff --git a/docs/images/AddSequenceDiagram.png b/docs/images/AddSequenceDiagram.png new file mode 100644 index 00000000000..b3765daedbe Binary files /dev/null and b/docs/images/AddSequenceDiagram.png differ diff --git a/docs/images/ArchitectureDiagram.png b/docs/images/ArchitectureDiagram.png index 5cdcf67e747..2fcfa1e8c72 100644 Binary files a/docs/images/ArchitectureDiagram.png and b/docs/images/ArchitectureDiagram.png differ diff --git a/docs/images/ArchitectureSequenceDiagram.png b/docs/images/ArchitectureSequenceDiagram.png index 2f1346869d0..225d190b810 100644 Binary files a/docs/images/ArchitectureSequenceDiagram.png and b/docs/images/ArchitectureSequenceDiagram.png differ diff --git a/docs/images/BetterModelClassDiagram.png b/docs/images/BetterModelClassDiagram.png index bc7ed18ae29..498a1e0e116 100644 Binary files a/docs/images/BetterModelClassDiagram.png and b/docs/images/BetterModelClassDiagram.png differ diff --git a/docs/images/ChengJiyuqing.png b/docs/images/ChengJiyuqing.png new file mode 100644 index 00000000000..56a948aea15 Binary files /dev/null and b/docs/images/ChengJiyuqing.png differ diff --git a/docs/images/DeleteActivityDiagram.png b/docs/images/DeleteActivityDiagram.png new file mode 100644 index 00000000000..1cd24469120 Binary files /dev/null and b/docs/images/DeleteActivityDiagram.png differ diff --git a/docs/images/DeleteContext.png b/docs/images/DeleteContext.png new file mode 100644 index 00000000000..58da814f813 Binary files /dev/null and b/docs/images/DeleteContext.png differ diff --git a/docs/images/DeleteResult.png b/docs/images/DeleteResult.png new file mode 100644 index 00000000000..09df4b09a77 Binary files /dev/null and b/docs/images/DeleteResult.png differ diff --git a/docs/images/DeleteSequenceDiagram.png b/docs/images/DeleteSequenceDiagram.png index fa327b39618..27f3a9c1ee8 100644 Binary files a/docs/images/DeleteSequenceDiagram.png and b/docs/images/DeleteSequenceDiagram.png differ diff --git a/docs/images/EditContext.png b/docs/images/EditContext.png new file mode 100644 index 00000000000..8fed3857a24 Binary files /dev/null and b/docs/images/EditContext.png differ diff --git a/docs/images/EditResult.png b/docs/images/EditResult.png new file mode 100644 index 00000000000..8e905992aa4 Binary files /dev/null and b/docs/images/EditResult.png differ diff --git a/docs/images/FindActivityDiagram.png b/docs/images/FindActivityDiagram.png new file mode 100644 index 00000000000..a8586eb08c4 Binary files /dev/null and b/docs/images/FindActivityDiagram.png differ diff --git a/docs/images/FindContext.PNG b/docs/images/FindContext.PNG new file mode 100644 index 00000000000..f114df90c3c Binary files /dev/null and b/docs/images/FindContext.PNG differ diff --git a/docs/images/FindResult.PNG b/docs/images/FindResult.PNG new file mode 100644 index 00000000000..341997180bc Binary files /dev/null and b/docs/images/FindResult.PNG differ diff --git a/docs/images/FindSequenceDiagram.png b/docs/images/FindSequenceDiagram.png new file mode 100644 index 00000000000..dbac0869010 Binary files /dev/null and b/docs/images/FindSequenceDiagram.png differ diff --git a/docs/images/ListActivityDiagram.png b/docs/images/ListActivityDiagram.png new file mode 100644 index 00000000000..06e96f8c322 Binary files /dev/null and b/docs/images/ListActivityDiagram.png differ diff --git a/docs/images/ListCommand.png b/docs/images/ListCommand.png new file mode 100644 index 00000000000..6c46dc1e123 Binary files /dev/null and b/docs/images/ListCommand.png differ diff --git a/docs/images/ListQuestionsCommand.png b/docs/images/ListQuestionsCommand.png new file mode 100644 index 00000000000..b1a457b926f Binary files /dev/null and b/docs/images/ListQuestionsCommand.png differ diff --git a/docs/images/ListSequenceDiagram.png b/docs/images/ListSequenceDiagram.png new file mode 100644 index 00000000000..bc739007783 Binary files /dev/null and b/docs/images/ListSequenceDiagram.png differ diff --git a/docs/images/LogicClassDiagram.png b/docs/images/LogicClassDiagram.png index b9e853cef12..661e01ba574 100644 Binary files a/docs/images/LogicClassDiagram.png and b/docs/images/LogicClassDiagram.png differ diff --git a/docs/images/ModelClassDiagram.png b/docs/images/ModelClassDiagram.png index 280064118cf..332b016b92a 100644 Binary files a/docs/images/ModelClassDiagram.png and b/docs/images/ModelClassDiagram.png differ diff --git a/docs/images/NextContext.png b/docs/images/NextContext.png new file mode 100644 index 00000000000..8b8a8ae008f Binary files /dev/null and b/docs/images/NextContext.png differ diff --git a/docs/images/NextResult.png b/docs/images/NextResult.png new file mode 100644 index 00000000000..ff75120a8d4 Binary files /dev/null and b/docs/images/NextResult.png differ diff --git a/docs/images/QuizActivityDiagram.png b/docs/images/QuizActivityDiagram.png new file mode 100644 index 00000000000..27a531313b8 Binary files /dev/null and b/docs/images/QuizActivityDiagram.png differ diff --git a/docs/images/QuizContext.png b/docs/images/QuizContext.png new file mode 100644 index 00000000000..94ec28def02 Binary files /dev/null and b/docs/images/QuizContext.png differ diff --git a/docs/images/QuizResult.png b/docs/images/QuizResult.png new file mode 100644 index 00000000000..da5f574c5f4 Binary files /dev/null and b/docs/images/QuizResult.png differ diff --git a/docs/images/QuizSequenceDiagram.png b/docs/images/QuizSequenceDiagram.png new file mode 100644 index 00000000000..7c146250e31 Binary files /dev/null and b/docs/images/QuizSequenceDiagram.png differ diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png index d87c1216820..e3c26e677b7 100644 Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ diff --git a/docs/images/Ui.png b/docs/images/Ui.png index 5bd77847aa2..fa80209ce24 100644 Binary files a/docs/images/Ui.png and b/docs/images/Ui.png differ diff --git a/docs/images/UiClassDiagram.png b/docs/images/UiClassDiagram.png index 7b4b3dbea45..5923d07ed3c 100644 Binary files a/docs/images/UiClassDiagram.png and b/docs/images/UiClassDiagram.png differ diff --git a/docs/images/bluesky0911.png b/docs/images/bluesky0911.png new file mode 100644 index 00000000000..23e3045c34d Binary files /dev/null and b/docs/images/bluesky0911.png differ diff --git a/docs/images/chengjiyuqing.png b/docs/images/chengjiyuqing.png new file mode 100644 index 00000000000..56a948aea15 Binary files /dev/null and b/docs/images/chengjiyuqing.png differ diff --git a/docs/images/jonfoocy.png b/docs/images/jonfoocy.png new file mode 100644 index 00000000000..5e060533734 Binary files /dev/null and b/docs/images/jonfoocy.png differ diff --git a/docs/images/joshruien.png b/docs/images/joshruien.png new file mode 100644 index 00000000000..86230afe9b0 Binary files /dev/null and b/docs/images/joshruien.png differ diff --git a/docs/images/tengjianling.png b/docs/images/tengjianling.png new file mode 100644 index 00000000000..76bc82fce72 Binary files /dev/null and b/docs/images/tengjianling.png differ diff --git a/docs/images/yongmingyang.png b/docs/images/yongmingyang.png new file mode 100644 index 00000000000..d30ed663eee Binary files /dev/null and b/docs/images/yongmingyang.png differ diff --git a/docs/index.md b/docs/index.md index 7601dbaad0d..33ab3e1e3bc 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ --- layout: page -title: AddressBook Level-3 +title: Medmoriser --- [![CI Status](https://github.com/se-edu/addressbook-level3/workflows/Java%20CI/badge.svg)](https://github.com/se-edu/addressbook-level3/actions) @@ -8,12 +8,13 @@ title: AddressBook Level-3 ![Ui](images/Ui.png) -**AddressBook is a desktop application for managing your contact details.** While it has a GUI, most of the user interactions happen using a CLI (Command Line Interface). +**Medmoriser** is a desktop app, optimized for the CLI, which helps medical students memorise and revise their content. It aids users in practising active recall to improve their retention of key information. -* If you are interested in using AddressBook, head over to the [_Quick Start_ section of the **User Guide**](UserGuide.html#quick-start). -* If you are interested about developing AddressBook, the [**Developer Guide**](DeveloperGuide.html) is a good place to start. +* If you are interested in using Medmoriser, head over to the [**User Guide**](UserGuide.html) to get started. +* If you are interested in helping to develop Medmoriser, the [**Developer Guide**](DeveloperGuide.html) is a good place to start. **Acknowledgements** * Libraries used: [JavaFX](https://openjfx.io/), [Jackson](https://github.com/FasterXML/jackson), [JUnit5](https://github.com/junit-team/junit5) +* This project is based on the AddressBook-Level3 project created by the [SE-EDU initiative](https://se-education.org). diff --git a/docs/team/chengjiyuqing.md b/docs/team/chengjiyuqing.md new file mode 100644 index 00000000000..7494b6c1ec8 --- /dev/null +++ b/docs/team/chengjiyuqing.md @@ -0,0 +1,41 @@ +--- +layout: page +title: Cheng Jiyuqing's Project Portfolio Page +--- + + +## Project: Medmoriser + +Medmoriser is a desktop app to help medical students organise, memorise and revise their content. The user interacts with it using a CLI, and it has a GUI created with JavaFX and is written in Java. + +Given below are my contributions to the project. + + +* **Code contributed**: [RepoSense Link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=chengjiyuqing) + +* **Project management**: + * Managed releases `v1.2` - `v1.4` (3 releases) on GitHub + +* **Enhancements to existing features**: + * Created new GUI component QuizCard to acommodate Quiz command, Answer command, Endquiz command and Next command + (Pull request [\#77](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/77) [\#161](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/161)) + This is very hard because I have to coordinate among various Logic commands and UI. + * Updated the GUI color scheme (Pull request [\#77](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/77)) + * Changed cells in GUI to rounded corners (Pull request [\#77](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/77)[\#162](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/162)) + * Moved CommandBox to the bottom (Pull request [\#162](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/162)) + * Set Tag to wrap text, so that long tag text will not be cut off.[\#158](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/158) + +* **Documentation**: + * User Guide: + * Added introduction to each section [\#95](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/95) + * Added details and photos to `Add` feature. [\#158](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/158) + * Developer Guide: + * Addded architecture diagram [\#182](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/182) + * Added implementation details of the `Add` feature. [\#182](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/182) + * Added sequence diagram for `Add` Feature (Figure 1.1) [\#182](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/182) + * Added User Stories, Value Props and target audience. [\#33](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/33) + + +* **Community**: + * Contributed to forum discussions (examples: [1](https://github.com/nus-cs2103-AY2021S1/forum/issues/36)) + * Reported bugs and suggestions for other teams in the class (examples: [1](https://github.com/AY2021S1-CS2103T-W12-2/tp/issues/158), [2](https://github.com/AY2021S1-CS2103T-W12-2/tp/issues/157), [3](https://github.com/AY2021S1-CS2103T-W12-2/tp/issues/155)) diff --git a/docs/team/johndoe.md b/docs/team/johndoe.md deleted file mode 100644 index 1f1e9e6f6db..00000000000 --- a/docs/team/johndoe.md +++ /dev/null @@ -1,46 +0,0 @@ ---- -layout: page -title: John Doe's Project Portfolio Page ---- - -## Project: AddressBook Level 3 - -AddressBook - Level 3 is a desktop address book application used for teaching Software Engineering principles. The user interacts with it using a CLI, and it has a GUI created with JavaFX. It is written in Java, and has about 10 kLoC. - -Given below are my contributions to the project. - -* **New Feature**: Added the ability to undo/redo previous commands. - * What it does: allows the user to undo all previous commands one at a time. Preceding undo commands can be reversed by using the redo command. - * Justification: This feature improves the product significantly because a user can make mistakes in commands and the app should provide a convenient way to rectify them. - * Highlights: This enhancement affects existing commands and commands to be added in future. It required an in-depth analysis of design alternatives. The implementation too was challenging as it required changes to existing commands. - * Credits: *{mention here if you reused any code/ideas from elsewhere or if a third-party library is heavily used in the feature so that a reader can make a more accurate judgement of how much effort went into the feature}* - -* **New Feature**: Added a history command that allows the user to navigate to previous commands using up/down keys. - -* **Code contributed**: [RepoSense link]() - -* **Project management**: - * Managed releases `v1.3` - `v1.5rc` (3 releases) on GitHub - -* **Enhancements to existing features**: - * Updated the GUI color scheme (Pull requests [\#33](), [\#34]()) - * Wrote additional tests for existing features to increase coverage from 88% to 92% (Pull requests [\#36](), [\#38]()) - -* **Documentation**: - * User Guide: - * Added documentation for the features `delete` and `find` [\#72]() - * Did cosmetic tweaks to existing documentation of features `clear`, `exit`: [\#74]() - * Developer Guide: - * Added implementation details of the `delete` feature. - -* **Community**: - * PRs reviewed (with non-trivial review comments): [\#12](), [\#32](), [\#19](), [\#42]() - * Contributed to forum discussions (examples: [1](), [2](), [3](), [4]()) - * Reported bugs and suggestions for other teams in the class (examples: [1](), [2](), [3]()) - * Some parts of the history feature I added was adopted by several other class mates ([1](), [2]()) - -* **Tools**: - * Integrated a third party library (Natty) to the project ([\#42]()) - * Integrated a new Github plugin (CircleCI) to the team repo - -* _{you can add/remove categories in the list above}_ diff --git a/docs/team/jonfoocy.md b/docs/team/jonfoocy.md new file mode 100644 index 00000000000..81f691d0823 --- /dev/null +++ b/docs/team/jonfoocy.md @@ -0,0 +1,44 @@ +--- +layout: page +title: Jonathan Foo Chee Yong's Project Portfolio Page +--- + +## Project: Medmoriser + +Medmoriser is a desktop app to help medical students organise, memorise and revise their content. The user interacts with it using a CLI, and it has a GUI created with JavaFX and is written in Java. + +Given below are my contributions to the project. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=jonfoocy) + +* **Project management**: + * Managed releases `v1.3` (1 release) on GitHub + +* **Enhancements to existing features**: + * Refactored AddressBook-Level3 code for v1.2 + * Changed classes, variables and other instances of `Name` → `Question`, `AddressBook` → `Medmoriser` [\#38](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/38). + + * Added the ability to hide answers from the main view [\#57](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/57), [\#136](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/136) + * What it does: Allows the user to hide the answer when browsing the list of QAndAs + 1. `list` which allows to user to view all QAndAs, with questions and answers all visible. + 2. `list questions` which allows the user to view all QAndAs, with questions visible and answers hidden. + * Justification: Gives the user the flexibility to choose the preferred mode of viewing, + and to prevent seeing the answer before quizzing. + * Added new test cases to ensure the new functionality worked in conjunction with existing features [\#60](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/60), [\#136](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/136) + +* **Documentation**: + * Project Website: + * Updated the website with project and team writeup [\#14](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/14), [\#30](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/30). + + * User Guide: + * Updated/modified User Guide to ensure currency and formatting consistency: [\#72](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/72), [\#74](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/74), [\#170](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/170). + * Added the documentation for the `list` feature [\#91](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/91). + + * Developer Guide: + * Added implementation details of the `list` feature [\#84](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/84). + * Updated Developer Guide to ensure consistency [\#167](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/167) + +* **Community**: + * PRs reviewed (with non-trivial review comments): [\#73](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/73), + [\#77](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/77). + * Discovered bugs and gave suggestions for other teams in the class: [\#200](https://github.com/AY2021S1-CS2103T-W10-1/tp/issues/200), [\#201](https://github.com/AY2021S1-CS2103T-W10-1/tp/issues/201), [\#202](https://github.com/AY2021S1-CS2103T-W10-1/tp/issues/202), [\#203](https://github.com/AY2021S1-CS2103T-W10-1/tp/issues/203), [\#204](https://github.com/AY2021S1-CS2103T-W10-1/tp/issues/204). diff --git a/docs/team/joshruien.md b/docs/team/joshruien.md new file mode 100644 index 00000000000..c6125dc5a17 --- /dev/null +++ b/docs/team/joshruien.md @@ -0,0 +1,58 @@ +--- +layout: page +title: Joshua Tan's Project Portfolio Page +--- + +## Project: Medmoriser + +Medmoriser is a desktop app to help medical students organise, memorise and revise their content. The user interacts with it using a CLI, and it has a GUI created with JavaFX and is written in Java. + +Given below are my contributions to the project. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=joshruien) + +* **New Feature**: Added a quiz feature for users to test themselves. + * What it does: Allows users to quiz themselves to test their memory on the answers to the questions. Medmoriser selects a random question based on the keywords that users input and quizzes them. After answering the question, the answer to the question will show up so that users can check their answers. + * Justification: This feature improves the product significantly because our app utilizes active recall to help users to memorise their content. Active recall is a proven study technique to help improve memory. + * Highlights: + * It required an in-depth analysis of design alternatives challenging as it was an entirely new feature on its own. + * It required commands to be created. Other commands created for this feature are `answer` and `endquiz`. + * New command classes and their parser classes had to be created. + * New test classes to test our features. + * This feature was rather challenging to implement. We had to keep track of the state, whether there was an ongoing quiz or not. Furthermore, we had to ensure a flow (ie. answer command comes after quiz command), whereas for the existing commands, they were one off commands. Hence it was challenging to implement the carrying over of the state across different commands. + +* **New Feature**: Added an answer feature for users to answer the quiz question. + * What it does: Allows users to answer the quiz question. + * Justification: This feature improves the product significantly as users are able to check their input answer against the answer that was keyed into Medmoriser for that particular question. This way they will know whether they could remember what they learnt. + * Highlights: + * It required a lot of error checking, to ensure that this command could only be called when there was an ongoing quiz and when the question has not yet been answered. + +* **New Feature**: Added an end quiz feature when users are done with the quiz. + * What it does: Allows users to end an ongoing quiz. When there is an ongoing quiz, users have to first end the quiz before being able to run other commands other than `answer` and `next`. + +* **Enhancements to existing features**: + * Updated the list command to show QAndAs (Pull requests [\#40](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/40)) + * Updated the edit and add command examples (Pull requests [\#137](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/137)) + * Redefined add and edit functions such that there can only be a limit of 1 prefix in the user input. (Pull requests [\#154](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/154)) + * Wrote additional tests: `AddCommandParserTest`, `EditCommandParserTest` , `NextCommandTest`, `QuizCommandParserTest`. (Pull requests [\#154](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/154) ,[\#160](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/160), [\#171](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/171)) + * Refactoring: Removed space between prefix and parameters for quiz and find command. (Pull Requests [#65](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/65)) + * Refactoring: Removed AB3 phone and email instances. (Pull Requests [\#71](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/71)) + +* **Documentation**: + * User Guide: + * Added documentation for the features `quiz` and `answer` and `endquiz`. + * Pull Requests: [\#85](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/85), [\#141](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/141), [\#155](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/155) + * Added documentation for the command summary. + * Pull Requests: [\#85](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/85), [\#141](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/141) + * Developer Guide: + * Added implementation details of the `quiz` feature. + * Pull Requests: [\#85](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/85), [\#94](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/94), [\#166](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/166) + * Added user stories. + * Pull Requests: [\#19](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/19) + * Edited the architecture diagrams to suit our application. + * Pull Requests: [\#176](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/176) + +* **Community**: + * PRs reviewed (with non-trivial review comments): [\#138](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/138) + * Reported bugs and suggestions for other teams in the class [1](https://github.com/AY2021S1-CS2103T-W13-1/tp/issues/174), [2](https://github.com/AY2021S1-CS2103T-W13-1/tp/issues/175), [3](https://github.com/AY2021S1-CS2103T-W13-1/tp/issues/176), [4](https://github.com/AY2021S1-CS2103T-W13-1/tp/issues/177), [5](https://github.com/AY2021S1-CS2103T-W13-1/tp/issues/178), [6](https://github.com/AY2021S1-CS2103T-W13-1/tp/issues/179), [7](https://github.com/AY2021S1-CS2103T-W13-1/tp/issues/180) + diff --git a/docs/team/tengjianling.md b/docs/team/tengjianling.md new file mode 100644 index 00000000000..869cd063a59 --- /dev/null +++ b/docs/team/tengjianling.md @@ -0,0 +1,46 @@ +--- +layout: page +title: Teng Jian Ling's Project Portfolio Page +--- + +### Project: Medmoriser + +Medmoriser is a desktop app to help medical students organise, memorise and revise their content. The user interacts with it using a CLI, and it has a GUI created with JavaFX and is written in Java. + +Given below are my contributions to the project. + +- **Code contributed:** [RepoSense Link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=tengjianling) + +- **New feature:** Added a `next` command for the user to move on to the next question in the quiz. + - What it does: allows the user to be tested on another question based on the same keywords provided for the current quiz session, without having to end the quiz first. + - Justification: This feature improves the product significantly because a user may want to test themselves on multiple questions with the same keywords specified, and the app should provide a convenient way for them to do this. + - Highlights: The implementation of this enchancement was challenging due to the following reasons: + - This enhancement required an in-depth analysis of design alternatives to find the best design choice. + - There was a need to make sure repeated questions are not shown + - There was a need to detect when there are no more questions with the keyword specified + - There was a need to check whether there is an ongoing quiz when this command is entered + - It required changes to existing commands such as `QuizCommand` and `AnswerCommand` + +- **Enhancements to Existing features:** + - Changed the usage message in the `edit` command to the context of questions and answers: [#41](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/41) + - Renamed all uses of `QuestionSet` and `questionSet` to `QAndA` and `qAndA` to avoid confusion between sets and lists: [#43](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/43), [#44](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/44), [#64](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/64) + - Changed restrictions on `question`, `answer`, and `tag` fields when adding a QAndA: [#66](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/66) + - Changed implementation of `QuizCommand` and `QuizCommandParser` to include ability to start a quiz based on multiple keywords or tags: [#73](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/73) + - Wrote the following additional tests: `QuizCommandTest`, `QuizCommandParserTest`, `ExitCommandTest`: [#73](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/73) + - increased code coverage by 2.96% + - Updated the GUI for quiz to be centralised and remove the question index number: [#83](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/83) + - Removed unnecessary 'F1' from the help menu: [#143](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/143) + - Wrote the following addtional tests: `AnswerCommandTest` and `AnswerCommandParserTest`: [#157](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/157) + - increased code coverage by 1.54% + +- **Documentation:** + - User Guide: + - Added documentation for the features `add` , `delete`, `edit` and `next`: [#18](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/18), [#83](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/83), [#92](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/92), [#153](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/153) + - Developer Guide: + - Added use cases for Medmoriser: [#18](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/18) + - Added implementation details of the `delete` feature, including a sequence diagram and an activity diagram: [#78](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/78) + - Added "Appendix: Effort" section: [#163](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/163) + +- **Community**: + - PRs reviewed with non-trivial review comments: [#71](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/71), [#168](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/168) + - Reported bugs and suggestions for other teams in the class (examples: [1](https://github.com/AY2021S1-CS2103T-W16-3/tp/issues/236), [2](https://github.com/AY2021S1-CS2103T-W16-3/tp/issues/237)) diff --git a/docs/team/yongmingyang.md b/docs/team/yongmingyang.md new file mode 100644 index 00000000000..fee44de09cc --- /dev/null +++ b/docs/team/yongmingyang.md @@ -0,0 +1,48 @@ +--- +layout: page +title: Yong Ming Yang's Project Portfolio Page +--- + +## Project: Medmoriser + +Medmoriser is a desktop app to help medical students organise, memorise and revise their content. The user interacts with it using a CLI, and it has a GUI created with JavaFX and is written in Java. + +Given below are my contributions to the project. + +* **Code contributed**: [RepoSense link](https://nus-cs2103-ay2021s1.github.io/tp-dashboard/#breakdown=true&search=yongmingyang) + +* **Enhancements to existing features**: + * Redefined the Find functionality: + * What it does: Allows the user to find based on 3 modes + 1. `find t/[tagname]` which allows the user to find QAndA based on the tagname(s). + 2. `find q/[keyword]` which allows the user to find QAndA which contains the specified keyword(s) in the question. + 3. `find [keyword]` which allows the user to find QAndA which contains the specified keyword(s) in the question or the answer. + * Justification: Gives the user more flexibility to find relevant QAndA sets. + * Added additional test cases to suit the redefined functionality, increased code coverage by 2.56%: [#58](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/58) + * Pull requests (inclusive of bug fixes): + 1. [#55](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/55) + 2. [#58](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/58) + 3. [#68](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/68) + 4. [#75](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/75) + 5. [#81](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/81) + 6. [#138](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/138) + 7. [#139](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/139) + * Credits: The find functionality makes use of code from the following links: + 1. https://stackoverflow.com/questions/36793397/check-if-string-contains-word-not-substring. + * Refactoring instances of `Address` to `Answer`, `UniquePersonList` to `UniqueQuestionSetList`, `AddressBook` to `Medmoriser` and `Person` to `QuestionSet` (later changed to QAndA by Jian Ling): [#36](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/36) + * Updated GUI, for quizing part in particular: [#46](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/46), [#165](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/165), [#172](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/172) + +* **Documentation**: + * User Guide: + * Minimal base documentation for start of project [#29](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/29) + * Add documentation for the `find` feature: [#68](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/68) + * Update documentation for improved `find` feature: [#79](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/79) + * Did cosmetic tweaks to `find` feature: [#93](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/93) + * Developer Guide: + * Added implementation details of the `find` feature: [#68](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/68) + * Restructured implementation details for all features: [#159](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/159) + +* **Community**: + * PRs reviewed (with non-trivial review comments): [#38](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/38), [#62](https://github.com/AY2021S1-CS2103T-W15-1/tp/pull/62) + * Contributed to forum discussions (examples: [#127](https://github.com/nus-cs2103-AY2021S1/forum/issues/127), [#128](https://github.com/nus-cs2103-AY2021S1/forum/issues/128), [#349](https://github.com/nus-cs2103-AY2021S1/forum/issues/349) + * Reported bugs for other teams: [#232](https://github.com/AY2021S1-CS2103T-T12-3/tp/issues/232), [#233](https://github.com/AY2021S1-CS2103T-T12-3/tp/issues/233), [#234](https://github.com/AY2021S1-CS2103T-T12-3/tp/issues/234), [#235](https://github.com/AY2021S1-CS2103T-T12-3/tp/issues/235), [#236](https://github.com/AY2021S1-CS2103T-T12-3/tp/issues/236), [#237](https://github.com/AY2021S1-CS2103T-T12-3/tp/issues/237) diff --git a/docs/tutorials/AddRemark.md b/docs/tutorials/AddRemark.md index 6907e29456c..1082c268422 100644 --- a/docs/tutorials/AddRemark.md +++ b/docs/tutorials/AddRemark.md @@ -5,7 +5,7 @@ title: "Tutorial: Adding a command" Let's walk you through the implementation of a new command — `remark`. -This command allows users of the AddressBook application to add optional remarks to people in their address book and edit it if required. The command should have the following format: +This command allows users of the AddressBook application to add optional remarks to people in their answer book and edit it if required. The command should have the following format: `remark INDEX r/REMARK` (e.g., `remark 2 r/Likes baseball`) @@ -16,19 +16,19 @@ We’ll assume that you have already set up the development environment as outli Looking in the `logic.command` package, you will notice that each existing command have their own class. All the commands inherit from the abstract class `Command` which means that they must override `execute()`. Each `Command` returns an instance of `CommandResult` upon success and `CommandResult#feedbackToUser` is printed to the `ResultDisplay`. -Let’s start by creating a new `RemarkCommand` class in the `src/main/java/seedu/address/logic/command` directory. +Let’s start by creating a new `RemarkCommand` class in the `src/main/java/seedu/answer/logic/command` directory. For now, let’s keep `RemarkCommand` as simple as possible and print some output. We accomplish that by returning a `CommandResult` with an accompanying message. **`RemarkCommand.java`:** ``` java -package seedu.address.logic.commands; +package seedu.medmoriser.logic.commands; -import seedu.address.model.Model; +import seedu.medmoriser.model.Model; /** - * Changes the remark of an existing person in the address book. + * Changes the remark of an existing qAndA in the answer book. */ public class RemarkCommand extends Command { @@ -64,8 +64,8 @@ Following the convention in other commands, we add relevant messages as constant **`RemarkCommand.java`:** ``` java - public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the remark of the person identified " - + "by the index number used in the last person listing. " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": Edits the remark of the qAndA identified " + + "by the index number used in the last qAndA listing. " + "Existing remark will be overwritten by the input.\n" + "Parameters: INDEX (must be a positive integer) " + "r/ [REMARK]\n" @@ -89,7 +89,7 @@ Let’s change `RemarkCommand` to parse input from the user. We start by modifying the constructor of `RemarkCommand` to accept an `Index` and a `String`. While we are at it, let’s change the error message to echo the values. While this is not a replacement for tests, it is an obvious way to tell if our code is functioning as intended. ``` java -import static seedu.address.commons.util.CollectionUtil.requireAllNonNull; +import static seedu.medmoriser.commons.util.CollectionUtil.requireAllNonNull; //... public class RemarkCommand extends Command { //... @@ -99,8 +99,8 @@ public class RemarkCommand extends Command { private final String remark; /** - * @param index of the person in the filtered person list to edit the remark - * @param remark of the person to be updated to + * @param index of the qAndA in the filtered qAndA list to edit the remark + * @param remark of the qAndA to be updated to */ public RemarkCommand(Index index, String remark) { requireAllNonNull(index, remark); @@ -139,7 +139,7 @@ Your code should look something like [this](https://github.com/se-edu/addressboo Now let’s move on to writing a parser that will extract the index and remark from the input provided by the user. -Create a `RemarkCommandParser` class in the `seedu.address.logic.parser` package. The class must extend the `Parser` interface. +Create a `RemarkCommandParser` class in the `seedu.medmoriser.logic.parser` package. The class must extend the `Parser` interface. ![The relationship between Parser and RemarkCommandParser](../images/add-remark/ParserInterface.png) @@ -222,11 +222,11 @@ If you are stuck, check out the sample ## Add `Remark` to the model -Now that we have all the information that we need, let’s lay the groundwork for propagating the remarks added into the in-memory storage of person data. We achieve that by working with the `Person` model. Each field in a Person is implemented as a separate class (e.g. a `Name` object represents the person’s name). That means we should add a `Remark` class so that we can use a `Remark` object to represent a remark given to a person. +Now that we have all the information that we need, let’s lay the groundwork for propagating the remarks added into the in-memory storage of qAndA data. We achieve that by working with the `Person` model. Each field in a Person is implemented as a separate class (e.g. a `Name` object represents the qAndA’s name). That means we should add a `Remark` class so that we can use a `Remark` object to represent a remark given to a qAndA. ### Add a new `Remark` class -Create a new `Remark` in `seedu.address.model.person`. Since a `Remark` is a field that is similar to `Address`, we can reuse a significant bit of code. +Create a new `Remark` in `seedu.medmoriser.model.qanda`. Since a `Remark` is a field that is similar to `Address`, we can reuse a significant bit of code. A copy-paste and search-replace later, you should have something like [this](https://github.com/se-edu/addressbook-level3/commit/4516e099699baa9e2d51801bd26f016d812dedcc#diff-af2f075d24dfcd333876f0fbce321f25). Note how `Remark` has no constrains and thus does not require input validation. @@ -237,9 +237,9 @@ Let’s change `RemarkCommand` and `RemarkCommandParser` to use the new `Remark` ## Add a placeholder element for remark to the UI -Without getting too deep into `fxml`, let’s go on a 5 minute adventure to get some placeholder text to show up for each person. +Without getting too deep into `fxml`, let’s go on a 5 minute adventure to get some placeholder text to show up for each qAndA. -Simply add the following to [`seedu.address.ui.PersonCard`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-0c6b6abcfac8c205e075294f25e851fe). +Simply add the following to [`seedu.medmoriser.ui.QuestionSetCard`](https://github.com/se-edu/addressbook-level3/commit/850b78879582f38accb05dd20c245963c65ea599#diff-0c6b6abcfac8c205e075294f25e851fe). **`PersonCard.java`:** @@ -292,7 +292,7 @@ While the changes to code may be minimal, the test data will have to be updated
-:exclamation: You must delete AddressBook’s storage file located at `/data/addressbook.json` before running it! Not doing so will cause AddressBook to default to an empty address book! +:exclamation: You must delete Medmoriser’s storage file located at `/data/medmoriser.json` before running it! Not doing so will cause Medmoriser to default to an empty question bank!
@@ -308,9 +308,9 @@ Just add [this one line of code!](https://github.com/se-edu/addressbook-level3/c **`PersonCard.java`:** ``` java -public PersonCard(Person person, int displayedIndex) { +public PersonCard(Person qAndA, int displayedIndex) { //... - remark.setText(person.getRemark().value); + remark.setText(qAndA.getRemark().value); } ``` @@ -340,23 +340,23 @@ save it with `Model#setPerson()`. throw new CommandException(Messages.MESSAGE_INVALID_PERSON_DISPLAYED_INDEX); } - Person personToEdit = lastShownList.get(index.getZeroBased()); - Person editedPerson = new Person(personToEdit.getName(), personToEdit.getPhone(), personToEdit.getEmail(), - personToEdit.getAddress(), remark, personToEdit.getTags()); + Person qAndAToEdit = lastShownList.get(index.getZeroBased()); + Person editedQAndA = new Person(qAndAToEdit.getName(), qAndAToEdit.getPhone(), qAndAToEdit.getEmail(), + qAndAToEdit.getAddress(), remark, qAndAToEdit.getTags()); - model.setPerson(personToEdit, editedPerson); + model.setPerson(qAndAToEdit, editedQAndA); model.updateFilteredPersonList(PREDICATE_SHOW_ALL_PERSONS); - return new CommandResult(generateSuccessMessage(editedPerson)); + return new CommandResult(generateSuccessMessage(editedQAndA)); } /** * Generates a command execution success message based on whether the remark is added to or removed from - * {@code personToEdit}. + * {@code qAndAToEdit}. */ - private String generateSuccessMessage(Person personToEdit) { + private String generateSuccessMessage(Person qAndAToEdit) { String message = !remark.value.isEmpty() ? MESSAGE_ADD_REMARK_SUCCESS : MESSAGE_DELETE_REMARK_SUCCESS; - return String.format(message, personToEdit); + return String.format(message, qAndAToEdit); } ``` diff --git a/docs/tutorials/RemovingFields.md b/docs/tutorials/RemovingFields.md index aa8e0baaad9..c6ffa5ca8bb 100644 --- a/docs/tutorials/RemovingFields.md +++ b/docs/tutorials/RemovingFields.md @@ -9,7 +9,7 @@ title: "Tutorial: Removing Fields" When working on AddressBook, you will most likely find that some features and fields that are no longer necessary. In scenarios like this, you can consider refactoring the existing `Person` model to suit your use case. -In this tutorial, we’ll do exactly just that and remove the `address` field from `Person`. +In this tutorial, we’ll do exactly just that and remove the `answer` field from `Person`. * Table of Contents {:toc} @@ -20,7 +20,7 @@ Fortunately, IntelliJ IDEA provides a robust refactoring tool that can identify ### Assisted refactoring -The `address` field in `Person` is actually an instance of the `seedu.address.model.person.Address` class. Since removing the `Address` class will break the application, we start by identifying `Address`'s usages. This allows us to see code that depends on `Address` to function properly and edit them on a case-by-case basis. Right-click the `Address` class and select `Refactor` \> `Safe Delete` through the menu. +The `answer` field in `Person` is actually an instance of the `seedu.medmoriser.model.qanda.Answer` class. Since removing the `Address` class will break the application, we start by identifying `Address`'s usages. This allows us to see code that depends on `Address` to function properly and edit them on a case-by-case basis. Right-click the `Address` class and select `Refactor` \> `Safe Delete` through the menu. ![Usages detected](../images/remove/UnsafeDelete.png) @@ -32,18 +32,18 @@ Remove usages of `Address` by performing `Safe Delete`s on each entry. You will Let’s try removing references to `Address` in `EditPersonDescriptor`. -1. Safe delete the field `address` in `EditPersonDescriptor`. +1. Safe delete the field `answer` in `EditPersonDescriptor`. 1. Select `Yes` when prompted to remove getters and setters. 1. Select `View Usages` again.
![UnsafeDeleteOnField](../images/remove/UnsafeDeleteOnField.png) -1. Remove the usages of `address` and select `Do refactor` when you are done. +1. Remove the usages of `answer` and select `Do refactor` when you are done.
- :bulb: **Tip:** Removing usages may result in errors. Exercise discretion and fix them. For example, removing the `address` field from the `Person` class will require you to modify its constructor. + :bulb: **Tip:** Removing usages may result in errors. Exercise discretion and fix them. For example, removing the `answer` field from the `Person` class will require you to modify its constructor.
1. Repeat the steps for the remaining usages of `Address` @@ -52,11 +52,11 @@ After you are done, verify that the application still works by compiling and run ### Manual refactoring -Unfortunately, there are usages of `Address` that IntelliJ IDEA cannot identify. You can find them by searching for instances of the word `address` in your code (`Edit` \> `Find` \> `Find in path`). +Unfortunately, there are usages of `Address` that IntelliJ IDEA cannot identify. You can find them by searching for instances of the word `answer` in your code (`Edit` \> `Find` \> `Find in path`). -Places of interest to look out for would be resources used by the application. `main/resources` contains images and `fxml` files used by the application and `test/resources` contains test data. For example, there is a `$address` in each `PersonCard` that has not been removed nor identified. +Places of interest to look out for would be resources used by the application. `main/resources` contains images and `fxml` files used by the application and `test/resources` contains test data. For example, there is a `$answer` in each `PersonCard` that has not been removed nor identified. -![$address](../images/remove/$address.png) +![$answer](../images/remove/$answer.png) A quick look at the `PersonCard` class and its `fxml` file quickly reveals why it slipped past the automated refactoring. @@ -65,7 +65,7 @@ A quick look at the `PersonCard` class and its `fxml` file quickly reveals why i ``` java ... @FXML -private Label address; +private Label answer; ... ``` @@ -74,7 +74,7 @@ private Label address; ``` xml ...