diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 23db322bd53..1f3b0d3b896 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -617,6 +617,10 @@ testers are expected to do more *exploratory* testing. * **Test case:** `add 12345678 n/John Doe p/91234567 e/johndoe@example.com a/123 Example Street c/Computer Science r/Student` * **Expected:** The addition fails, and an error message about the duplicate Student ID is shown. +**Adding an person with invalid Student ID** +* **Test case:** add 2345678 n/John Doe p/91234567 e/johndoe@example.com a/123 Example Street c/Computer Science r/Student +* **Expected:** The addition fails, and an error message about the invalid Student ID format is shown. + --- #### Edit Command @@ -665,6 +669,11 @@ testers are expected to do more *exploratory* testing. * **Test case:** `module 12345678 m/CS2103T` * **Expected:** The addition fails, and an error message about the duplicate module is shown. +**Adding an invalid module** +* **Prerequisites:** List contains a person with Student ID 13131313. +* **Test case:** module 13131313 m/CS 2103T +* **Expected:** The addition fails, and an error message about the invalid module format is shown. + --- #### Grade Command @@ -680,7 +689,7 @@ testers are expected to do more *exploratory* testing. **Adding an invalid grade** * **Test case:** `grade 12345678 m/CS2103T g/Z` -* **Expected:** The addition fails, and an error message about the invalid grade is shown. +* **Expected:** The addition fails, and an error message about the invalid grade format is shown. --- @@ -749,7 +758,24 @@ If no newer commands exist, the Command Box becomes empty. ## **Appendix: Effort** -_{to work on in the future}_ +### Achievements +1. As EduContacts is a CLI-based application, we have added the ability for users to navigate through their previous commands using the up and down arrow keys. This helps users accomplish repetitive tasks, e.g. grading a module for multiple persons in EduContacts, way quicker than they would be able to without this functionality.

+2. We have decided to use a person's student ID as a unique identifier for persons in EduContacts, instead of index like in AB3. The usage of student ID to perform tasks is more intuitive for teachers, our target user group. This therefore optimises EduContacts for teachers.

+3. We have expanded on the original find command to filter based on course and modules, in addition to name. This command has been renamed to filter to better reflect the functionality of the command.

+4. We have also refactored the original find command to instead display the full details of a person in EduContacts in a separate panel in the GUI. This allows us to be more selective with what information we display in the PersonCard. We can therefore only display information we believe teachers should be able to retrieve at a glance, e.g. names, student IDs, thus further optimising EduContacts for teachers.

+5. We have also made various enhancements to the GUI: + - The first enhancement made was the help page. AB3's help page was simply a link to the User Guide, which is not user-friendly. We have therefore taken the liberty of changing the help page to instead contain a summary of the commands supported by EduContacts, including their formats and example usages. + - We then updated the GUI to include a separate panel to display student details when the find command is executed. + +### Effort Required +We have put in a significant amount of effort in this project, with close to 2,000 commits over 15,000 lines of code contributed. We estimate that our effort for the project is about 50% of that spent on creating AB3. + +### Challenges Faced +1. The first major roadblock in our project was storing modules in JSON format. Modules for a Person object is stored as a Collection, much like Tags in AB3. However, modules also have a Grade field, whereas Tags in AB3 do not have. This added a layer of complexity that we did not expect, and a longer amount of time had to be invested to work out the issue.

+2. The second challenge we faced was using student ID as a unique identifier for persons in EduContacts instead of index. This task was more complicated that we initially anticipated, as there were many unforeseen use cases that we had to take into consideration. This includes duplicate student ID handling, handling cases where a person with a specified student ID exists in EduContacts but not in the currently displayed list, and so on. A lot of scrutinising and attention to detail was required to ensure our commands were bug-free and the command error messages displayed were correct.

+ +### Difficulty Level +Our project requires a relative high level of understanding of the code base. Due to the change to make student ID the unique identifier for persons in EduContacts, we needed a high level of understanding of how the various command parsers and argument tokenisers work in order to implement bug-free code.

Additionally, we had to have a good understanding of our JSON and the Jackson library worked in order to implement modules in our project.

Finally, we have also made numerous updates to the GUI, which was tough as we were all relatively new to JavaFX. We therefore rate the difficulty level of our project as medium to hard. -------------------------------------------------------------------------------------------------------------------- diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 83f75151e3b..66c7a6f6c1b 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -10,7 +10,7 @@
-EduContacts is a **desktop app for educators in tertiary institutions to manage contacts, optimized for use via a Command Line Interface** (CLI) while still having the benefits of a Graphical User Interface (GUI). For expert users familiar with command-based tools, EduContacts can get your contact management tasks done faster than traditional GUI apps. For new users, EduContacts also includes user-friendly and intuitive features and guidance, making it user-friendly and accessible for all users. +EduContacts is a **desktop app for educators in tertiary institutions in Singapore to manage contacts, optimized for use via a Command Line Interface[1]** (CLI) while still having the benefits of a Graphical User Interface[2] (GUI). For expert users familiar with command-based tools, EduContacts can get your contact management tasks done faster than traditional GUI apps. For new users, EduContacts also includes user-friendly and intuitive features and guidance, making it user-friendly and accessible for all users.
@@ -29,11 +29,27 @@ EduContacts is a **desktop app for educators in tertiary institutions to manage - [Finding a person: `find`](#finding-a-person-find) - [Clearing all entries : `clear`](#clearing-all-entries-clear) - [Exiting the program : `exit`](#exiting-the-program-exit) + - [Saving the data](#saving-the-data) + - [Editing the data file](#editing-the-data-file) 4. [FAQ](#faq) 5. [Known issues](#known-issues) 6. [Command summary](#command-summary) -------------------------------------------------------------------------------------------------------------------- + + + +

+ +**1. Command Line Interface:** a software mechanism you use to interact with your operating system using your keyboard.

+ +

+ +**2. Graphical User Interface:** a digital interface in which a user interacts with graphical components such as icons, buttons, and menus.

+ +
+ +
## Guidance Icons Legend @@ -103,6 +119,7 @@ EduContacts is a **desktop app for educators in tertiary institutions to manage ```bash delete 12345678 ``` + Deletes a person contact with student ID `12345678`. ```bash @@ -110,6 +127,13 @@ EduContacts is a **desktop app for educators in tertiary institutions to manage ``` Deletes all contacts. + + + **Warning:** + The `clear` command will erase all contacts from the system. Please ensure that you have backed up any important information before proceeding. This action cannot be undone, so use this command with caution. + + + ```bash exit ``` @@ -117,13 +141,29 @@ EduContacts is a **desktop app for educators in tertiary institutions to manage -**Tip:** Use the UP and DOWN arrow keys to scroll through previous commands in the Command Box. This feature helps you reuse recent commands without retyping, making it faster for you to correct or repeat commands! +**Tip:** Use the UP and DOWN arrow keys to scroll through previous commands in the command box. This feature helps you reuse recent commands without retyping, making it faster for you to correct or repeat commands! 6. Refer to the [Features](#features) below for details of each command. -------------------------------------------------------------------------------------------------------------------- -
+ +## Summary of a `Person` + +This table will explain the fields that a `Person` in EduContacts possesses and its respective constraints. Each person +in EduContacts is assumed to have a Singapore-based contact. No fields should be left blank when adding a `Person` to EduContacts, except for `Module`. + +Field | Details +-----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------- +**StudentID** | The student ID that belongs to the `Person`. The input for this field can only contain digits and should be exactly 8 digits long.

This field also serves as the unique identifier for a `Person`. +**Name** | The name that belongs to the `Person`. The input for this field can only contain alphanumeric characters and whitespaces. +**Course** | The course that the `Person` studies. The input for this field can only contain alphabetical characters and whitespaces. +**Email** | The email that belongs to the `Person`. The input for this field should be of the format local-part@domain.

The local-part should only contain alphanumeric characters and these special characters: `+ _ . -` The local-part may not start or end with any special characters. This is followed by a '@' and then a domain name. The domain name is made up of domain labels separated by periods.

The domain name must:
- End with a domain label at least 2 characters long
- Have each domain label start and end with alphanumeric characters
- Have each domain label consist of alphanumeric characters, separated only by hyphens, if any. +**Address** | The address that belongs to the `Person`. The first character for the input for this field can only contain alphanumeric characters and these special characters: `# , -`.

After the first character, any additional characters are allowed, including whitespace and further text. +**Phone Number** | The phone number that belongs to the `Person`. The input for this field can only contain digits and must at least be 8 digits long. +**Module** | A module that the `Person` takes. A `Person` can have multiple modules. The input for this field can only contain alphanumeric characters.

A module can also be assigned a `Grade`, which must be one of the following: `A+, A, A-, B+, B, B-, C+, C, D+, D, F` +**Role** | The role assigned to the `Person`. A person can either be a `Student` or `Tutor`. +-------------------------------------------------------------------------------------------------------------------- ## Features @@ -163,8 +203,12 @@ help ``` The help window will display the help message as shown in the screenshot below: -![help message](images/helpMessage.png) + +help message + Alternatively, you can click the button on the top right hand corner as indicated here: + + ![alternative_help](images/alternativeHelp.png)
@@ -177,6 +221,7 @@ Format: ```bash add ID n/NAME p/PHONE e/EMAIL a/ADDRESS c/COURSE r/ROLE ``` +When adding a Person to EduContacts, please refer to the [table above](#summary-of-a-person) for the constraints of each field. Examples: * `add 87654321 n/Betsy Crowe r/Student e/betsycrowe@example.com a/Blk 30 Geylang Street 29, #06-40 p/12345678 c/Business Analytics` will add a person named `Betsy Crowe` with student ID of `87654321` to EduContacts. @@ -185,7 +230,7 @@ Examples: ![result for 'add command result'](images/addCommandResult.png) -
+
### Listing all persons : `list` @@ -213,30 +258,50 @@ Examples: * `module 12345678 m/GEA1000` will add a module `GEA1000` to a person with student ID of `12345678`. * `module 13131313 m/CS2103T` will add a module `CS2103T` to a person with student ID of `13131313` (the response message of this command is shown in the screenshot below). - ![result for 'add module result'](images/addModule.png) + ![result for 'add module result'](images/addModuleResult.png)
### Editing a person : `edit` -Edits a specified person in EduContacts. +Edits a specified person details or module in EduContacts. +Usages: + +**1. Edit person details:** + + Format: -Format: ```bash edit ID [FIELD_TO_EDIT_PREFIX] [NEW_VALUE] ``` + * Updates the details of the person identified by the student ID assigned to the corresponding student. + * At least one of the optional fields must be provided: name, phone, email, address, course, role. Note that student ID cannot be edited as it is the person's identifier. + * Existing values will be overwritten by the input values. +**2. Edit person's module:** -* Edits a person's details according to the fields specified. -* At least one of the optional fields must be provided. -* Existing values will be updated to the input values. + Format: +```bash +edit ID m/ OLD_MODULE NEW_MODULE +``` + * Updates a module of the person identified by the student ID. + * Existing module (`OLD_MODULE`) will be overwritten by the input module (`NEW_MODULE`). + * Editing of `NAME`, `PHONE`, `EMAIL`, `ADDRESS`, `COURSE` and `ROLE` using this format is not supported. + +
Examples: + * `edit 12345678 m/CS2103T CS2101` will edit a person with student ID of `12345678` by replacing the old module `CS2103T` with the new module `CS2101`. * `edit 12121212 c/Computer Science` will edit a person with student ID of `12121212` by editing their course to `Computer Science` (the response message of this command is shown in the screenshot below). ![result for 'edit command result'](images/editCommandResult.png) + + + +**Tip:** Use the `find` command to view the full detail of the student first before proceeding with `edit`. This allows you to view the changes and verify the edit immediately. +
### Adding a grade : `grade` @@ -260,30 +325,46 @@ Examples: ### Listing persons by certain attributes : `filter` -Filters person contacts based on their names, courses and modules. +Filters person contacts by name, course, or module. +Usages: + +**1. Filter by name:** Format: ```bash -filter [KEYWORD_PREFIX] [MORE_KEYWORDS] +filter n/KEYWORD [MORE_KEYWORDS] ``` -* **For filtering by names:** - * Use prefix `n/`. + * `n/` prefix is used. * Only full words will be matched e.g. `Han` will not match `Hans` * The order of the keywords does not matter. e.g. `Hans Bo` will match `Bo Hans` * Persons matching at least one keyword will be returned (i.e. `OR` search). - e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` + e.g. `Hans Bo` will return `Hans Gruber`, `Bo Yang` + +**2. Filter by Module:** + +Format: +```bash +filter m/KEYWORD +``` -* **For filtering by Module:** - * Use prefix `m/`. - * Partial matching is supported, allowing users to input parts of module codes. e.g. `m/CS21` will match modules like "CS2103T" and "CS2101." + * `m/` prefix is used. + * Only full module codes will be matched, e.g. `m/CS2103T` will match the module `CS2103T`, and not `m/CS21`." + +
+ +**3. Filter by course:** + +Format: +```bash +filter c/KEYWORD +``` -* **For filtering by Course:** - * Use prefix `c/` + * `c/` prefix is used. * Partial matching is supported, but the first keyword must match the beginning of the course name. e.g `Engineer` will match courses like "Engineering" but not "Civil Engineering". @@ -293,12 +374,12 @@ filter [KEYWORD_PREFIX] [MORE_KEYWORDS] Examples: -* `filter n/John` will return a list of all persons with `John` in their name e.g. `john` and `John Doe`. +* `filter n/John` will return a list of all persons with `John` in their name e.g. `John Smith` and `John Doe`. * `filter m/CS2103T` will return a list of all persons with module `CS2103T`. * `filter c/Computer Science` will return a list of all persons with course `Computer Science`. * `filter n/alex david` will return a list of all persons with `alex` or `david` in their name e.g. `Alex Yeoh`, `David Li` (the result of this command is shown in the screenshot below). + filter alex david - ![result for 'find alex david'](images/filterAlexDavidResult.png)
@@ -313,7 +394,9 @@ To return to display the full list of persons, use the `list` command. Deletes the specified person/module from EduContacts. This command has 2 formats. -Format 1: +**1. Delete `Person` from EduContacts** + +Format: ```bash delete ID ``` @@ -321,23 +404,26 @@ delete ID * Deletes person with the specified student ID. Examples: + * `delete 15151515` will delete a person with student ID of `15151515` from EduContacts. * `delete 71271222` will delete a person with student ID of `71271222` from EduContacts (the response message of this command is shown in the screenshot below). ![result for 'delete_71271222'](images/deleteCommandResult.png) -Format 2: +**2. Delete `Module` from `Person`** + +Format: ```bash delete ID m/MODULE ``` -* Deletes a module from the person with the specified student ID. +* Deletes a module from the person with the specified studentId. -Examples: +Example: * `delete 13131313 m/CS2103T` will delete the module `CS2103T` from a person with student ID of `13131313` (the result of this command is shown in the screenshot below). ![result for 'delete_13131313'](images/deleteModuleResult.png) -
+ ### Finding a person : `find` @@ -379,7 +465,6 @@ Format: exit ``` -
### Saving the data @@ -399,7 +484,7 @@ Furthermore, certain edits can cause the EduContacts to behave in unexpected way
-------------------------------------------------------------------------------------------------------------------- -
+ ## FAQ @@ -420,22 +505,27 @@ Furthermore, certain edits can cause the EduContacts to behave in unexpected way ## Known issues 1. **When using multiple screens**, if you move the application to a secondary screen, and later switch to using only the primary screen, the GUI will open off-screen. The remedy is to delete the `preferences.json` file created by the application before running the application again. -2. **If you minimize the Help Window** and then run the `help` command (or use the `Help` menu, or the keyboard shortcut `F1`) again, the original Help Window will remain minimized, and no new Help Window will appear. The remedy is to manually restore the minimized Help Window. +2. **For `help` command:** + * If you minimise the Help Window and then run the `help` command (or use the `Help` menu, or the keyboard shortcut `F1`) again, the original Help Window will remain minimized, and no new Help Window will appear. The remedy is to manually restore the minimized Help Window. + * On some platforms (especially MacOS), when you use the application in full screen, + running the `help` command and closing the popup window repeatedly in quick succession may cause the application + to hang or crash. Users have to terminate the application by entering `CTRL` + `C` in the terminal used to run the application, and run the application again. **DATA MIGHT BE LOST**. + * The development team is working on a more permanent fix for this issue. --------------------------------------------------------------------------------------------------------------------
## Command summary -Action | Format, Examples ------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------- -**Add** | `add ID n/NAME p/PHONE e/EMAIL a/ADDRESS c/COURSE r/ROLE`
e.g., `add 12345678 n/John Doe p/99999999 e/johndoe@example.com a/123 Jane Doe Road c/Computer Science r/Student` -**Clear** | `clear` -**Delete** | `delete ID`
e.g., `delete 12345678`

`delete ID m/MODULE`
e.g., `delete 12345678 m/CS2103T` -**Edit** | `edit ID [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [c/COURSE] [r/ROLE]…​`
e.g.,`edit 12345678 p/91234567 e/johndoe@example.com` -**Grade** | `grade ID m/MODULE g/GRADE`
e.g. `grade 12345678 m/CS2103T g/A` -**Add Module** | `module ID m/MODULE`
e.g., `add 12345678 m/CS2103T` -**Filter** | `filter [n/NAME] [c/COURSE] [m/MODULE]`
e.g., `filter n/James Jake` -**Find** | `find ID`
e.g., `find 12345678` -**List** | `list` - +| Action | Format, Examples | +|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| **Add** | `add ID n/NAME p/PHONE e/EMAIL a/ADDRESS c/COURSE r/ROLE`
e.g., `add 12345678 n/John Doe p/99999999 e/johndoe@example.com a/123 Jane Doe Road c/Computer Science r/Student` | +| **Clear** | `clear` | +| **Delete** | `delete ID`
e.g., `delete 12345678`

`delete ID m/MODULE`
e.g., `delete 12345678 m/CS2103T` | +| **Edit** | `edit ID [n/NAME] [p/PHONE_NUMBER] [e/EMAIL] [a/ADDRESS] [c/COURSE] [r/ROLE]…​`
e.g.,`edit 12345678 p/91234567 e/johndoe@example.com` | +| **Add Grade** | `grade ID m/MODULE g/GRADE`
e.g. `grade 12345678 m/CS2103T g/A` | +| **Add Module** | `module ID m/MODULE`
e.g., `module 12345678 m/CS2103T` | +| **Filter** | `filter [n/NAME] [c/COURSE] [m/MODULE]`
e.g., `filter n/James Jake` | +| **Find** | `find ID`
e.g., `find 12345678` | +| **List** | `list` | +| **Help** | `help` diff --git a/docs/_markbind/layouts/default.md b/docs/_markbind/layouts/default.md index cecf83c7175..2b327c3ebdf 100644 --- a/docs/_markbind/layouts/default.md +++ b/docs/_markbind/layouts/default.md @@ -41,6 +41,8 @@ * [Documentation, logging, testing, configuration, dev-ops]({{ baseUrl }}/DeveloperGuide.html#documentation-logging-testing-configuration-dev-ops) * [Appendix: Requirements]({{ baseUrl }}/DeveloperGuide.html#appendix-requirements) * [Appendix: Instructions for manual testing]({{ baseUrl }}/DeveloperGuide.html#appendix-instructions-for-manual-testing) + * [Appendix: Effort]({{ baseUrl }}/DeveloperGuide.html#appendix-effort) + * [Appendix: Planned Enhancements]({{ baseUrl }}/DeveloperGuide.html#appendix-planned-enhancements) * [About Us]({{ baseUrl }}/AboutUs.html) diff --git a/docs/images/addCommandResult.png b/docs/images/addCommandResult.png index 09220a068aa..6243e5c2c3a 100644 Binary files a/docs/images/addCommandResult.png and b/docs/images/addCommandResult.png differ diff --git a/docs/images/addModule.png b/docs/images/addModule.png deleted file mode 100644 index f5cb6f779a3..00000000000 Binary files a/docs/images/addModule.png and /dev/null differ diff --git a/docs/images/addModuleResult.png b/docs/images/addModuleResult.png new file mode 100644 index 00000000000..1dfb3a7673a Binary files /dev/null and b/docs/images/addModuleResult.png differ diff --git a/docs/images/deleteCommandResult.png b/docs/images/deleteCommandResult.png index 9b8502af9e2..fb4b6f4f9e9 100644 Binary files a/docs/images/deleteCommandResult.png and b/docs/images/deleteCommandResult.png differ diff --git a/docs/images/editCommandResult.png b/docs/images/editCommandResult.png index cd7f9defa84..d38ea9f270f 100644 Binary files a/docs/images/editCommandResult.png and b/docs/images/editCommandResult.png differ diff --git a/docs/team/btbrandon.md b/docs/team/btbrandon.md deleted file mode 100644 index d921eec4a10..00000000000 --- a/docs/team/btbrandon.md +++ /dev/null @@ -1,46 +0,0 @@ ---- - layout: default.md - title: "Brandon Tan'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/ethan-g.md b/docs/team/ethan-g.md deleted file mode 100644 index 86aa7ebfc34..00000000000 --- a/docs/team/ethan-g.md +++ /dev/null @@ -1,46 +0,0 @@ ---- - layout: default.md - 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/jessica2828.md b/docs/team/jessica2828.md deleted file mode 100644 index 86aa7ebfc34..00000000000 --- a/docs/team/jessica2828.md +++ /dev/null @@ -1,46 +0,0 @@ ---- - layout: default.md - 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/juliantayyc.md b/docs/team/juliantayyc.md deleted file mode 100644 index 86aa7ebfc34..00000000000 --- a/docs/team/juliantayyc.md +++ /dev/null @@ -1,46 +0,0 @@ ---- - layout: default.md - 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/jyl27.md b/docs/team/jyl27.md deleted file mode 100644 index 86aa7ebfc34..00000000000 --- a/docs/team/jyl27.md +++ /dev/null @@ -1,46 +0,0 @@ ---- - layout: default.md - 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/src/main/java/seedu/address/logic/commands/AddCommand.java b/src/main/java/seedu/address/logic/commands/AddCommand.java index 226e7d6be6f..c2766d5bef7 100644 --- a/src/main/java/seedu/address/logic/commands/AddCommand.java +++ b/src/main/java/seedu/address/logic/commands/AddCommand.java @@ -21,7 +21,7 @@ public class AddCommand extends Command { public static final String COMMAND_WORD = "add"; - public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to EduContacts. " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a person to EduContacts.\n" + "Parameters: " + "ID " + PREFIX_NAME + "NAME " diff --git a/src/main/java/seedu/address/logic/commands/ClearCommand.java b/src/main/java/seedu/address/logic/commands/ClearCommand.java index d4371271789..9e4b1b0de23 100644 --- a/src/main/java/seedu/address/logic/commands/ClearCommand.java +++ b/src/main/java/seedu/address/logic/commands/ClearCommand.java @@ -18,6 +18,7 @@ public class ClearCommand extends Command { public CommandResult execute(Model model) { requireNonNull(model); model.setEduContacts(new EduContacts()); - return new CommandResult(MESSAGE_SUCCESS); + model.setPersonToDisplay(null); + return new CommandResult(MESSAGE_SUCCESS, true); } } diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index fc06efc7cb0..a21b36a2edb 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -1,6 +1,7 @@ package seedu.address.logic.commands; import static java.util.Objects.requireNonNull; +import static seedu.address.logic.parser.CliSyntax.PREFIX_MODULE; import java.util.List; @@ -19,16 +20,14 @@ public class DeleteCommand extends Command { public static final String COMMAND_WORD = "delete"; - public static final String MESSAGE_USAGE = COMMAND_WORD - + ": Deletes the student identified by the Student ID used in the displayed person list,\n" - + "or deletes a module from the person's module list.\n" - + "Parameters: " - + "ID\n" - + "or: " - + "ID MODULE_KEYWORD\n" - + "Example: " + COMMAND_WORD + " " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": 2 possible usages\n" + + "1. Deletes the student identified by the Student ID used in the displayed person list.\n" + + " Parameters: ID\n" + + " Example: " + COMMAND_WORD + " " + "12345678\n" - + "or: " + COMMAND_WORD + " " + + "2. Deletes a module from the person's module list.\n" + + " Parameters: ID " + PREFIX_MODULE + "MODULE\n" + + " Example: " + COMMAND_WORD + " " + "12345678 m/CS2103T"; public static final String MESSAGE_DELETE_PERSON_SUCCESS = "Deleted Student: %1$s"; @@ -71,7 +70,6 @@ public CommandResult execute(Model model) throws CommandException { requireNonNull(model); List lastShownList = model.getFilteredPersonList(); Person toDelete = null; - boolean isPersonDetailsDeleted = false; for (Person person : lastShownList) { @@ -114,13 +112,10 @@ public CommandResult execute(Model model) throws CommandException { if (toDelete.isSamePerson(model.getPersonToDisplay())) { model.setPersonToDisplay(null); - isPersonDetailsDeleted = true; } - model.deletePerson(toDelete); if (isPersonDetailsDeleted) { - return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, Messages.format(toDelete)), true); } return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, Messages.format(toDelete))); diff --git a/src/main/java/seedu/address/logic/commands/EditCommand.java b/src/main/java/seedu/address/logic/commands/EditCommand.java index 4da2b8c1d74..dfd3558e08c 100644 --- a/src/main/java/seedu/address/logic/commands/EditCommand.java +++ b/src/main/java/seedu/address/logic/commands/EditCommand.java @@ -37,11 +37,11 @@ public class EditCommand extends Command { public static final String COMMAND_WORD = "edit"; - public static final String MESSAGE_USAGE = COMMAND_WORD + ": 2 possible usages" - + " 1. Edits the details of the person identified " - + "by the studentId assigned to the corresponding student. " - + "Existing values will be overwritten by the input values.\n" - + "Parameters: ID (must be a valid and existing 8-digit ID) " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": 2 possible usages\n" + + "1. Edits the details of the person identified " + + "by the studentId assigned to the corresponding student. \n" + + " Existing values will be overwritten by the input values.\n" + + " Parameters: ID " + "[ID] " + "[" + PREFIX_NAME + "NAME] " + "[" + PREFIX_PHONE + "PHONE] " @@ -49,13 +49,15 @@ public class EditCommand extends Command { + "[" + PREFIX_ADDRESS + "ADDRESS] " + "[" + PREFIX_COURSE + " COURSE] " + "[" + PREFIX_ROLE + "ROLE] ...\n" - + "Example: " + COMMAND_WORD + " 12345678 " + + " Example: " + COMMAND_WORD + " 12345678 " + PREFIX_PHONE + "91234567 " - + PREFIX_EMAIL + "johndoe@example.com" - + " 2. Edits a module of the person identified. " - + "Existing values will be overwritten by the input module.\n" - + "Parameters: ID (must be a valid and existing 8-digit ID " - + PREFIX_MODULE + " OLD_MODULE NEW_MODULE"; + + PREFIX_EMAIL + "johndoe@example.com\n" + + "2. Edits a module of the person identified. \n" + + " Existing values will be overwritten by the input module.\n" + + " Parameters: ID " + + PREFIX_MODULE + "OLD_MODULE NEW_MODULE\n" + + " Example: " + COMMAND_WORD + " 12345678 " + + PREFIX_MODULE + "CS2103T CS2101"; public static final String MESSAGE_EDIT_PERSON_SUCCESS = "Edited Person: %1$s"; public static final String MESSAGE_NOT_EDITED = "At least one field to edit must be provided."; diff --git a/src/main/java/seedu/address/logic/commands/FindCommand.java b/src/main/java/seedu/address/logic/commands/FindCommand.java index f2343115282..bce457627be 100644 --- a/src/main/java/seedu/address/logic/commands/FindCommand.java +++ b/src/main/java/seedu/address/logic/commands/FindCommand.java @@ -20,8 +20,7 @@ public class FindCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Finds the student identified by the Student ID used and displays their details.\n" - + "Parameters: " - + "ID\n" + + "Parameters: ID \n" + "Example: " + COMMAND_WORD + " " + "12345678"; diff --git a/src/main/java/seedu/address/logic/commands/GradeCommand.java b/src/main/java/seedu/address/logic/commands/GradeCommand.java index 227406ee750..21aa729a157 100644 --- a/src/main/java/seedu/address/logic/commands/GradeCommand.java +++ b/src/main/java/seedu/address/logic/commands/GradeCommand.java @@ -23,7 +23,8 @@ public class GradeCommand extends Command { public static final String COMMAND_WORD = "grade"; - public static final String MESSAGE_USAGE = COMMAND_WORD + ": Assigns a course-specific grade to a student. " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": Assigns a course-specific grade to an existing " + + "module of the person identified.\n" + "Parameters: " + "ID " + PREFIX_MODULE + "MODULE " diff --git a/src/main/java/seedu/address/logic/commands/ModuleCommand.java b/src/main/java/seedu/address/logic/commands/ModuleCommand.java index 4cb2b01ae33..0eacbb71650 100644 --- a/src/main/java/seedu/address/logic/commands/ModuleCommand.java +++ b/src/main/java/seedu/address/logic/commands/ModuleCommand.java @@ -21,11 +21,10 @@ public class ModuleCommand extends Command { public static final String COMMAND_WORD = "module"; - public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a module to a student. " + public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds a module to a student.\n" + "Parameters: " + "ID " - + PREFIX_MODULE + "MODULE " - + "\n" + + PREFIX_MODULE + "MODULE\n" + "Example: " + COMMAND_WORD + " " + "12345678 " + PREFIX_MODULE + "CS2103T "; diff --git a/src/main/java/seedu/address/logic/parser/EditCommandParser.java b/src/main/java/seedu/address/logic/parser/EditCommandParser.java index ca18087e1c7..9b7b88376da 100644 --- a/src/main/java/seedu/address/logic/parser/EditCommandParser.java +++ b/src/main/java/seedu/address/logic/parser/EditCommandParser.java @@ -43,10 +43,17 @@ public EditCommand parse(String args) throws ParseException { EditPersonDescriptor editPersonDescriptor = new EditPersonDescriptor(); if (argMultimap.getValue(PREFIX_MODULE).isPresent()) { - String[] modules = argMultimap.getValue(PREFIX_MODULE).get().split(" "); + if (argMultimap.getValue(PREFIX_NAME).isPresent() || argMultimap.getValue(PREFIX_PHONE).isPresent() + || argMultimap.getValue(PREFIX_EMAIL).isPresent() || argMultimap.getValue(PREFIX_ADDRESS).isPresent() + || argMultimap.getValue(PREFIX_COURSE).isPresent() || argMultimap.getValue(PREFIX_ROLE).isPresent()) { + throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE)); + } + + String[] modules = argMultimap.getValue(PREFIX_MODULE).get().trim().replaceAll("\\s+", " ").split(" "); if (modules.length != 2) { throw new ParseException(String.format(MESSAGE_INVALID_COMMAND_FORMAT, EditCommand.MESSAGE_USAGE)); } + editPersonDescriptor.setModuleChanges(new Module(modules[0].toUpperCase()), new Module(modules[1].toUpperCase())); } else { diff --git a/src/main/java/seedu/address/model/person/ModuleContainsKeywordsPredicate.java b/src/main/java/seedu/address/model/person/ModuleContainsKeywordsPredicate.java index efa638e3209..909ddb173d1 100644 --- a/src/main/java/seedu/address/model/person/ModuleContainsKeywordsPredicate.java +++ b/src/main/java/seedu/address/model/person/ModuleContainsKeywordsPredicate.java @@ -16,8 +16,9 @@ public ModuleContainsKeywordsPredicate(String keyword) { @Override public boolean test(Person person) { + String regex = "\\b" + keyword.toLowerCase() + "\\b"; return person.getModules().stream() - .anyMatch(module -> module.toString().toLowerCase().contains(keyword.toLowerCase())); + .anyMatch(module -> module.toString().toLowerCase().matches(".*" + regex + ".*")); } @Override diff --git a/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java b/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java index b05000ef54c..0a585677a5f 100644 --- a/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java +++ b/src/test/java/seedu/address/logic/parser/EditCommandParserTest.java @@ -80,6 +80,30 @@ public void parse_missingModuleArguments_failure() { assertParseFailure(parser, userInput, MESSAGE_INVALID_FORMAT); } + @Test + public void parse_moduleAndOtherFieldsPresent_failure() { + String studentId = "12345678"; + String userInputWithExtraName = studentId + " m/ CS1010S CS1231S n/ Amy Bee"; + String userInputWithExtraPhone = studentId + " m/ CS1010S CS1231S p/ 11111111"; + String userInputWithExtraEmail = studentId + " m/ CS1010S CS1231S e/ amybee@gmail.com"; + String userInputWithExtraAddress = studentId + " m/ CS1010S CS1231S a/ 321 Clementi"; + String userInputWithExtraCourse = studentId + " m/ CS1010S CS1231S c/ Physics"; + String userInputWithExtraRole = studentId + " m/ CS1010S CS1231S r/ Student"; + + assertParseFailure(parser, userInputWithExtraName, String.format(MESSAGE_INVALID_COMMAND_FORMAT, + EditCommand.MESSAGE_USAGE)); + assertParseFailure(parser, userInputWithExtraPhone, String.format(MESSAGE_INVALID_COMMAND_FORMAT, + EditCommand.MESSAGE_USAGE)); + assertParseFailure(parser, userInputWithExtraEmail, String.format(MESSAGE_INVALID_COMMAND_FORMAT, + EditCommand.MESSAGE_USAGE)); + assertParseFailure(parser, userInputWithExtraAddress, String.format(MESSAGE_INVALID_COMMAND_FORMAT, + EditCommand.MESSAGE_USAGE)); + assertParseFailure(parser, userInputWithExtraCourse, String.format(MESSAGE_INVALID_COMMAND_FORMAT, + EditCommand.MESSAGE_USAGE)); + assertParseFailure(parser, userInputWithExtraRole, String.format(MESSAGE_INVALID_COMMAND_FORMAT, + EditCommand.MESSAGE_USAGE)); + } + @Test public void parse_noModulesProvided_noModuleChange() { String studentId = "12345678"; diff --git a/src/test/java/seedu/address/model/person/ModuleContainsKeywordsPredicateTest.java b/src/test/java/seedu/address/model/person/ModuleContainsKeywordsPredicateTest.java index 0b3680ee138..ec5b61d9491 100644 --- a/src/test/java/seedu/address/model/person/ModuleContainsKeywordsPredicateTest.java +++ b/src/test/java/seedu/address/model/person/ModuleContainsKeywordsPredicateTest.java @@ -45,9 +45,6 @@ public void test_moduleContainsKeyword_returnsTrue() { predicate = new ModuleContainsKeywordsPredicate("cs1010"); assertTrue(predicate.test(new PersonBuilder().addUngradedModule("CS1010").build())); - - predicate = new ModuleContainsKeywordsPredicate("1010"); - assertTrue(predicate.test(new PersonBuilder().addUngradedModule("CS1010").build())); } @Test