diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 9bd66bcbe66..48b832cd3a8 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -1297,9 +1297,13 @@ testers are expected to do more *exploratory* testing. 1. Dealing with missing/corrupted data files - 1. _{explain how to simulate a missing/corrupted file, and the expected behavior}_ - -2. _{ more test cases …​ }_ + 1. If you encounter an unexpected empty TAHub (no students, consults or lessons) upon startup or your data +is replaced by sample data, your data file may be corrupted. + 2. If you wish to try and salvage your data, **do not** perform any command yet. **This will overwrite your data.** + 3. Copy your data file to make a safe backup first, and rename it something other than `addressbook`. You can open +this file to view your data in JSON format. + 4. TAHub will generate a new data file with sample data. In the meantime, if you are experienced +with JSON, you can attempt to recover your data file by fixing issues in the file, usually syntax/formatting. ### Exporting data diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 04380a23725..0a9aa57592f 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -136,7 +136,7 @@ Examples: Deletes the specified student from TAHub. -Format: `delete INDEX[;INDEX]...` +Format: `delete INDEX[;INDEX]…` * Deletes the student at the specified `INDEX`. * The index refers to the index number shown in the displayed student list. @@ -176,10 +176,11 @@ Displays a list of all consultations in TAHub. Adds students to an existing consultation, specified by its index. -**Format**: `addtoconsult INDEX [n/NAME]... [i/INDEX]...` +**Format**: `addtoconsult INDEX [n/NAME]… [i/INDEX]…` * `INDEX` specifies the consultation to add students to. -* Student names (`n/NAME`) and/or student indices (`i/INDEX`) can be used to specify students. +* Student names (`n/NAME`) and/or student indices (`i/INDEX`) can be used to specify students. At least one name or +index must be provided. * Students already in the consultation will not be added again, and an error message will be shown. **Examples**: @@ -192,10 +193,9 @@ Adds students to an existing consultation, specified by its index. Removes specified students from a consultation, identified by its index. -**Format**: `removefromconsult INDEX n/NAME...` +**Format**: `removefromconsult INDEX n/NAME [n/NAME]…` * `INDEX` is the index of the consultation from which the students will be removed. -* Specify one or more students to remove by their names. **Examples**: * `removefromconsult 1 n/John Doe n/Harry Ng` (removes students named John Doe and Harry Ng from the 1st consultation) @@ -206,7 +206,7 @@ Removes specified students from a consultation, identified by its index. Deletes one or more consultations from TAHub by their indices. -**Format**: `deleteconsult INDEX[;INDEX]...` +**Format**: `deleteconsult INDEX[;INDEX]…` * `INDEX` specifies the consultation to delete. You can delete multiple consultations by separating indices with semicolons (`;`). diff --git a/docs/diagrams/StorageClassDiagram.puml b/docs/diagrams/StorageClassDiagram.puml index 0f09c3ef34f..3930de3b6b7 100644 --- a/docs/diagrams/StorageClassDiagram.puml +++ b/docs/diagrams/StorageClassDiagram.puml @@ -20,7 +20,9 @@ Class JsonAddressBookStorage Class JsonSerializableAddressBook Class JsonAdaptedStudent Class JsonAdaptedConsultation +Class JsonAdaptedLesson Class JsonAdaptedCourse +Class JsonAdaptedStudentLessonInfo } } @@ -40,7 +42,10 @@ JsonAddressBookStorage .up.|> AddressBookStorage JsonAddressBookStorage ..> JsonSerializableAddressBook JsonSerializableAddressBook --> "*" JsonAdaptedStudent JsonSerializableAddressBook --> "*" JsonAdaptedConsultation +JsonSerializableAddressBook --> "*" JsonAdaptedLesson JsonAdaptedStudent --> "*" JsonAdaptedCourse JsonAdaptedConsultation --> "*" JsonAdaptedStudent +JsonAdaptedLesson --> "*" JsonAdaptedStudentLessonInfo +JsonAdaptedStudentLessonInfo --> "1" JsonAdaptedStudent @enduml diff --git a/docs/images/StorageClassDiagram.png b/docs/images/StorageClassDiagram.png index 366cf96f8b5..54aba7fa520 100644 Binary files a/docs/images/StorageClassDiagram.png and b/docs/images/StorageClassDiagram.png differ diff --git a/src/main/java/seedu/address/logic/commands/consultation/AddToConsultCommand.java b/src/main/java/seedu/address/logic/commands/consultation/AddToConsultCommand.java index 5667a1bc2c1..8a9391337d1 100644 --- a/src/main/java/seedu/address/logic/commands/consultation/AddToConsultCommand.java +++ b/src/main/java/seedu/address/logic/commands/consultation/AddToConsultCommand.java @@ -2,6 +2,7 @@ import static java.util.Objects.requireNonNull; import static seedu.address.logic.Messages.MESSAGE_INVALID_CONSULTATION_DISPLAYED_INDEX; +import static seedu.address.logic.parser.CliSyntax.PREFIX_INDEX; import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import java.util.HashSet; @@ -32,7 +33,7 @@ public class AddToConsultCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Adds students to the consultation identified " + "by the index number used in the displayed consultation list. " + "Parameters: INDEX (must be a positive integer) " - + "[" + PREFIX_NAME + "NAME]...\n" + + "[" + PREFIX_NAME + "NAME]… [" + PREFIX_INDEX + "INDEX]…\n" + "Example: " + COMMAND_WORD + " 1 n/John Doe n/Harry Ng"; public static final String MESSAGE_ADD_TO_CONSULT_SUCCESS = "Added students to the Consultation: %1$s"; diff --git a/src/main/java/seedu/address/logic/commands/consultation/DeleteConsultCommand.java b/src/main/java/seedu/address/logic/commands/consultation/DeleteConsultCommand.java index 93933bd0097..b0f7269f3ff 100644 --- a/src/main/java/seedu/address/logic/commands/consultation/DeleteConsultCommand.java +++ b/src/main/java/seedu/address/logic/commands/consultation/DeleteConsultCommand.java @@ -28,7 +28,7 @@ public class DeleteConsultCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes the consultation identified by the index number used in the displayed consultation list.\n" - + "Parameters: INDEX (must be a positive integer) [;INDEX...]\n" + + "Parameters: INDEX (must be a positive integer) [;INDEX…]\n" + "Example: " + COMMAND_WORD + " 1" + DEFAULT_DELIMITER + "2"; public static final String MESSAGE_DELETE_CONSULT_SUCCESS = "Deleted Consult(s):\n%1$s"; diff --git a/src/main/java/seedu/address/logic/commands/consultation/RemoveFromConsultCommand.java b/src/main/java/seedu/address/logic/commands/consultation/RemoveFromConsultCommand.java index af344204626..ee14202c65c 100644 --- a/src/main/java/seedu/address/logic/commands/consultation/RemoveFromConsultCommand.java +++ b/src/main/java/seedu/address/logic/commands/consultation/RemoveFromConsultCommand.java @@ -1,6 +1,7 @@ package seedu.address.logic.commands.consultation; import static java.util.Objects.requireNonNull; +import static seedu.address.logic.parser.CliSyntax.PREFIX_NAME; import java.util.List; @@ -25,7 +26,7 @@ public class RemoveFromConsultCommand extends Command { public static final String MESSAGE_USAGE = COMMAND_WORD + ": Removes students from the consultation identified by the index.\n" + "Parameters: CONSULT_INDEX (must be a positive integer) " - + "NAME...\n" + + PREFIX_NAME + "NAME [" + PREFIX_NAME + "NAME]…\n" + "Example: " + COMMAND_WORD + " 1 n/Alex Yeoh n/Harry Ng"; public static final String MESSAGE_REMOVE_FROM_CONSULT_SUCCESS =