diff --git a/data/events/event.txt b/data/events/event.txt index caf531b3fc..4d5463886c 100644 --- a/data/events/event.txt +++ b/data/events/event.txt @@ -1,4 +1 @@ -hello | 2023-12-20T12:30:30 | 2023-12-20T12:30:30 -EC3333 | 2023-12-20T12:30:30 | 2023-12-20T12:30:40 -Deadline | 2023-12-20T12:30:30 | 10 | 1 -More Deadline | 2023-12-20T12:30:30 | 20 | 1 +Do User | 2023-12-20T12:30:30 | 2023-12-20T13:30:30 diff --git a/data/flashcards/flashcard.txt b/data/flashcards/flashcard.txt index 720cb83428..687234aca0 100644 --- a/data/flashcards/flashcard.txt +++ b/data/flashcards/flashcard.txt @@ -1 +1,3 @@ -3 | dfdf | dfdf | 5 +2 | Hello | Duke | 5 +3 | Hello | Duke | 5 +4 | Hello | Duke | 5 diff --git a/docs/AboutUs.md b/docs/AboutUs.md index 1e50ca0376..fe9d633a91 100644 --- a/docs/AboutUs.md +++ b/docs/AboutUs.md @@ -5,6 +5,6 @@ Display | Name | Github Profile | Portfolio --------|:------------------:|:--------------:|:---------:  | Wendelin Wemhoener | [Github](https://github.com/wendelinwemhoener/) | [Portfolio](docs/team/wendelinwemhoener.md)  | Zhu Jingxi | [Github](https://github.com/Cheezeblokz) | [Portfolio](docs/team/zhujingxi.md) - | Kherlen Bayasgalan | [Github](https://github.com/Brian030601) | [Portfolio](docs/team/Brian030601.md) + | Kherlen Bayasgalan | [Github](https://github.com/Brian030601) | [Portfolio](docs/team/brian030601.md)  | Bang Junhyeong | [Github](https://github.com/junhyeong0411) | [Portfolio](docs/team/bangjunhyeong.md)  | Don Roe | [Github](https://github.com/) | [Portfolio](docs/team/johndoe.md) diff --git a/docs/DeveloperGuide.md b/docs/DeveloperGuide.md index 92af184710..8c80fe954f 100644 --- a/docs/DeveloperGuide.md +++ b/docs/DeveloperGuide.md @@ -6,7 +6,23 @@ ## Design & implementation -{Describe the design and implementation of the product. Use UML diagrams and short code snippets where applicable.} +### flashcard package + +The API of the flashcard package is defined in [FlashcardComponent.java](https://github.com/AY2324S1-CS2113-F11-3/tp/blob/master/src/main/java/seedu/duke/flashcard/FlashcardComponent.java). + +The flashcard package is structured into multiple parts: + +- [Flashcard.java](https://github.com/AY2324S1-CS2113-F11-3/tp/blob/master/src/main/java/seedu/duke/flashcard/Flashcard.java) +- [FlashcardCommandParser.java](https://github.com/AY2324S1-CS2113-F11-3/tp/blob/master/src/main/java/seedu/duke/flashcard/FlashcardCommandParser.java) +- [FlashcardComponent.java](https://github.com/AY2324S1-CS2113-F11-3/tp/blob/master/src/main/java/seedu/duke/flashcard/FlashcardComponent.java) +- [FlashcardDirectory.java](https://github.com/AY2324S1-CS2113-F11-3/tp/blob/master/src/main/java/seedu/duke/flashcard/FlashcardDirectory.java) +- [FlashcardList.java](https://github.com/AY2324S1-CS2113-F11-3/tp/blob/master/src/main/java/seedu/duke/flashcard/FlashcardList.java) +- [FlashcardUi.java](https://github.com/AY2324S1-CS2113-F11-3/tp/blob/master/src/main/java/seedu/duke/flashcard/FlashcardUi.java) +- [command package](https://github.com/AY2324S1-CS2113-F11-3/tp/tree/master/src/main/java/seedu/duke/flashcard/command) +- [exceptions package](https://github.com/AY2324S1-CS2113-F11-3/tp/tree/master/src/main/java/seedu/duke/flashcard/exceptions) +- [review package](https://github.com/AY2324S1-CS2113-F11-3/tp/tree/master/src/main/java/seedu/duke/flashcard/review) + + ### Storage Components diff --git a/docs/UserGuide.md b/docs/UserGuide.md index 3c020f448c..6d50fa23e3 100644 --- a/docs/UserGuide.md +++ b/docs/UserGuide.md @@ -9,8 +9,8 @@ the courses they are taking. ## Quick Start 1. Ensure that you have Java 11 or above installed. -2. Down the latest jar from [the latest release on GitHub](https://github.com/AY2324S1-CS2113-F11-3/tp/releases). -3. Run the jar via `java -jar duke.jar` +2. Download the latest jar from [the latest release on GitHub](https://github.com/AY2324S1-CS2113-F11-3/tp/releases). +3. Run the jar file via `java -jar duke.jar` ## Features @@ -306,102 +306,181 @@ Enter your command: delete all flashcards All your flashcards have been successfully deleted. -### General Explanation of Calendar Features +### Calendar-related features -Here is your features list: - -+ `add event` , `delete event` -+ `list events` , `find event` -+ `delete all events` +#### General explanation of flashcards -Users can use the above features to handle their events +TaskLinker's calendar feature allows users to manage their time effectively +by adding, listing, finding, and deleting events. Events in the calendar have a +specified start and end time, making it easy for users to plan their schedules. +This feature is particularly useful for individuals with busy schedules or +those who want to keep track of their upcoming appointments or tasks. -#### Adding a todo: `todo` +The TaskLinker is also integrated with the flashcards and can be used for setting +a goal to review flashcards. Add goal event can be used to take user input for +setting a goal to review flashcards. -Adds a new item to the list of todo items. +Here is your features list: -Format: `todo n/TODO_NAME d/DEADLINE` ++ `add event` , `delete event` ++ `list events` , `find event` ++ `delete all events` , `add goal event` -* The `DEADLINE` can be in a natural language format. -* The `TODO_NAME` cannot contain punctuation. +Users can use the above features to handle their events` -Example of usage: +#### Adding an event to the calendar: `add event` -`todo n/Write the rest of the User Guide d/next week` +Adds an event to the calendar with start and end time. -`todo n/Refactor the User Guide to remove passive voice d/13/04/2020` +After entering this command, the user is asked to enter the event name on the calendar. +Once the name is given, the user should press ENTER to continue. Once the name is entered, +the user is prompted to give a start time and an end time for the event. +The start and the end time should be in an acceptable format (`yyyy-mm-ddThh:mm:ss`.) +If it is not in an acceptable format, (`Invalid date and time format. Please try again.`) +message will appear and prompt the user to enter a new start time. +Furthermore, the end time should be later than the start time as an event cannot +end before it's start time. If an earlier time is given for the end time than the +start time, the TaskLinker displays (`End time is before or equal to the start time. Please enter the correct end time.`) +message and starts over from (`Enter your command:`). -#### Add an Event to the Calendar +Format: +
+Enter your command: add event +What's the event?: Name [Event Name] +When does it start?: yyyy-mm-ddThh:mm:ss [Start Time] +When does it end?: yyyy-mm-ddThh:mm:ss [End Time] +-**Adds an event to the calendar with start and end time** +Example of usage: +
+Enter your command: add event +What's the event?: Do HW +When does it start?: 2023-12-20T12:30:30 +When does it end?: 2023-12-20T13:40:30 -#### Usage +Event 'Do HW' From: 2023-12-20T12:30:30, To: 2023-12-20T13:40:30 +has been added to your Calendar +-+ Format: `add event` [Command] -+ What's the event?: `Event name` [Event name] -+ When does it start?: `yyyy-mm-ddThh:mm:ss` [Start time] -+ When does it end?: `yyyy-mm-ddThh:mm:ss` [End time] +#### Adding a goal event to the calendar: `add goal event` -**Example of usage**: +Adds a goal of reviewing flashcards as an event to the calendar. -+ `Enter your command: add event` -+ `What's the event?: Do HW` -+ `When does it start?: 2023-12-20T12:30:30` -+ `When does it end?: 2023-12-20T12:40:30` +After entering (`add goal event`) command, the user is asked to provide a name +for this goal event. After the name, the user is prompted to give an end time +for the event. The end time serves as a deadline for the goal. -#### Delete an Event From the Calendar +After the deadline has been given, then the goal should be given. Goal of reviewing +some number of flashcards by the given deadline. Same as adding an event, if an unacceptable +format of end time is given, the TaskLinker will display (`Invalid date and time format. Please try again.`) +message. -**deletes an event from the calendar with event name** +Format: +
+Enter your command: add goal event +What's the event?: Name [Goal Name] +When does it end?: yyyy-mm-ddThh:mm:ss [End Time] +How many flashcard to review by then?: Number [# of flashcards to review] +-#### Usage +Example of usage: +
+Enter your command: add goal event +What's the event?: Do Flashcards +When does it end?: 2023-12-20T12:30:30 +How many flashcard to review by then?: 20 -+ Format: `delete event` -+ Enter the event name: `Event name` [Event name] +Goal 'Do Flashcards' review 20 flashcards by: 2023-12-20T12:30:30 (Reviewed: 0) +has been added to your Calendar +-**Example of usage**: +#### Delete an event from the calendar: `delete event` -+ `Enter your command: delete event` -+ `Enter the event name: Do HW` +Deletes an event from the calendar with event name. -#### Delete All Events From the Calendar +After the (`delete event`) command has been given, the user is prompted to give +the name of the event he/she wants to delete from the calendar. If the given +event exist in the calendar, then TaskLinker will display (`[Event Name] has been deleted from your Calendar!`). +Then the event gets deleted from the event list. -**deletes all events from the calendar** +However, if the given event name doesn't exist in the calendar. Then the event +doesn't exist in the calendar message will display (`[Event Name] doesn't exist in your Calendar!`). +The user then enter a different command. -#### Usage +Format: +
+Enter your command: delete event +What's the event?: Name [Event Name] + [Event Name] has been deleted from your Calendar! +-+ Format: `delete all events` +Example of usage: +
+Enter your command: delete event +What's the event?: hello + hello has been deleted from your Calendar! +-**Example of usage**: +#### Delete all events from the Calendar: `delete all events` -+ `Enter your command: delete all events` +Deletes all events from the calendar. -#### Find an Event From the Calendar +Once the (`delete all events`) command has been given by the user, +the TaskLinker will clear all events in the calendar. If the exact +command is not entered, the feature will not work. -**finds an event from the calendar** +Format & Example: +
+Enter your command: delete all events + All your events have been successfully deleted from the Calendar. +-##### Usage +#### Find an event from the Calendar: `find event` -+ Format: `find event` -+ What event are you looking for?: `event name` +Finds an event from the calendar. -**Example of usage**: +Once the (`find event`) command has been entered, the user is prompted to +give the name of the event he/she is looking for. The input user gives can +just be partial name of the event. If so, the feature will list all +events that included the given input. -+ `Enter your command: find event` -+ `What event are you looking for?: Do HW` +However, if the given input is not found from the events in the Calendar, +then the (`No such event found`) message will be displayed. -#### List All Events From the Calendar +Format: +
+Enter your command: find event +What's the event?: Name [Event Name] +1. Event 'Event Name' From: yyyy-mm-ddThh:mm:ss, To: yyyy-mm-ddThh:mm:ss + These events have been found +-**Lists all events from the calendar** +Example of usage: +
+Enter your command: find event +What's the event?: Do HW +1. Event 'Do HW' From: 2023-12-20T12:30:30, To: 2023-12-20T13:30:30 + These events have been found +-#### Usage +#### List all events from the Calendar: `list events` -+ Format: `list events` +Lists all events from the calendar -**Example of usage**: +Once the (`list events`) command has been entered, the TaskLinker lists +all the events in the event list. If there is no event in the event list, +the (`The Calendar is empty!`) message will be displayed. -+ `Enter your command: find event` +Format & Example: +
+Enter your command: list events + Here is a list of all your events: +-------------------------------------------------------------------------------- +1. Event 'Do User' From: 2023-12-20T12:30:30, To: 2023-12-20T13:30:30 +-------------------------------------------------------------------------------- +## FAQ @@ -415,6 +494,14 @@ Every event and flashcard are automatically save after each command. **A**: You can transfer your data by copying & pasting the data folder. +**Q**: Why is the calendar features needed? + +**A**: The calendar features are used for adding a flashcard review and other goals. + +**Q**: Are the flashcard and the calendar use different commands? + +**A**: Yes, they have different command based on their features. + ## Command Summary * [Listing all flashcards](#listing-all-flashcards-list-flashcards): `list @@ -427,8 +514,15 @@ Every event and flashcard are automatically save after each command. flashcard` * [Deleting all flashcards](#deleting-all-flashcards-delete-all-flashcards) `delete all flashcards` -* Create an event: `add event` -* Delete an event: `delete event` -* Delete all events: `delete all events` -* Find an event: `find event` -* List events: `list events` +* [Create an event](#adding-an-event-to-the-calendar-add-event): + `add event` +* [Add a goal event](#adding-a-goal-event-to-the-calendar-add-goal-event): + `add goal event` +* [Delete an event](#delete-an-event-from-the-calendar-delete-event): + `delete event` +* [Delete all events](#delete-all-events-from-the-calendar-delete-all-events): + `delete all events` +* [Find an event](#find-an-event-from-the-calendar-find-event): + `find event` +* [List all events](#list-all-events-from-the-calendar-list-events): + `list events` diff --git a/docs/team/brian030601.md b/docs/team/brian030601.md index 91f6b8cd2e..1cb9b0c583 100644 --- a/docs/team/brian030601.md +++ b/docs/team/brian030601.md @@ -1,4 +1,4 @@ -# Kherlen Bayasgalan (brian030601) - Project Portfolio Page +# Kherlen Bayasgalan (Brian030601) - Project Portfolio Page ## Overview diff --git a/docs/team/wendelinwemhoener.md b/docs/team/wendelinwemhoener.md index 047c7bb91b..50aad97a73 100644 --- a/docs/team/wendelinwemhoener.md +++ b/docs/team/wendelinwemhoener.md @@ -11,11 +11,19 @@ taking. ### Code Contribution See my code contribution [here on the tP Code Dashboard](https://nus-cs2113-ay2324s1.github.io/tp-dashboard/?search=wendelinwemhoener&breakdown=true) +- implemented architecture that my team reused +- made sure that build check and ui text testcase passed +- javadoc for all methods (except getters/setters and constructors) ### Contributions to the UG +- wrote the general sections + ### Contributions to the DG +product scope + + ### Contributions to team-based tasks - I set up the GitHub team org, created the project board on GitHub and set @@ -26,5 +34,5 @@ See my code contribution [here on the tP Code Dashboard](https://nus-cs2113-ay23 - I documented target user profile and value proposition in UG/DG - I set up the Google Doc we used for coordinating the project in the initial phase -- I set up and administrated our Telegram chat group to allow for easy and - efficient communication +- I set up and administrated our Telegram chat group to allow for + efficient communication and coordinated our weekly meetings diff --git a/src/main/java/seedu/duke/calendar/CalendarManager.java b/src/main/java/seedu/duke/calendar/CalendarManager.java index 187b887263..53d4d396f6 100644 --- a/src/main/java/seedu/duke/calendar/CalendarManager.java +++ b/src/main/java/seedu/duke/calendar/CalendarManager.java @@ -1,4 +1,4 @@ -//@@author Brian030601 & jingxizhu +//@@author Brian030601 package seedu.duke.calendar; diff --git a/src/main/java/seedu/duke/calendar/Event.java b/src/main/java/seedu/duke/calendar/Event.java index 77e6b5a372..868c5f5bdc 100644 --- a/src/main/java/seedu/duke/calendar/Event.java +++ b/src/main/java/seedu/duke/calendar/Event.java @@ -1,4 +1,4 @@ -//@@author Brian030601 & Cheezeblokz +//@@author Brian030601 package seedu.duke.calendar; @@ -9,6 +9,7 @@ public class Event { private LocalDateTime from; private LocalDateTime to; + //@@author Cheezeblokz // Event is a constructor method for Event class. public Event(String name, LocalDateTime from, LocalDateTime to) { this.name = name; @@ -16,6 +17,7 @@ public Event(String name, LocalDateTime from, LocalDateTime to) { this.to = to; } + //@@author Cheezeblokz // getName returns the name of the event. public String getName() { return name; diff --git a/src/main/java/seedu/duke/calendar/command/AddEventCommand.java b/src/main/java/seedu/duke/calendar/command/AddEventCommand.java index 2f70cffe04..c9d8f7f9b5 100644 --- a/src/main/java/seedu/duke/calendar/command/AddEventCommand.java +++ b/src/main/java/seedu/duke/calendar/command/AddEventCommand.java @@ -49,7 +49,7 @@ public void executeBeginnerMode(Scanner scanner, EventList eventList) { if (endTime.isAfter(startTime)) { Event event = new Event(eventName, startTime, endTime); eventList.addEvent(event); - System.out.println(event + " has been added to your Calendar"); + System.out.println(" " + event + " has been added to your Calendar"); } else { System.out.println(" End time is before or equal to the start time. Please enter the correct end time."); } @@ -66,7 +66,7 @@ protected void executeExpertMode(Scanner scanner, EventList eventList) { if (endTime.isAfter(startTime)) { Event event = new Event(eventName, startTime, endTime); eventList.addEvent(event); - System.out.println(event + " has been added to your Calendar"); + System.out.println(" " + event + " has been added to your Calendar"); } else { System.out.println(" End time is before or equal to the start time. " + "Please enter the correct end time."); diff --git a/src/main/java/seedu/duke/calendar/command/AddGoalEventCommand.java b/src/main/java/seedu/duke/calendar/command/AddGoalEventCommand.java index 43114fc792..b2149abc38 100644 --- a/src/main/java/seedu/duke/calendar/command/AddGoalEventCommand.java +++ b/src/main/java/seedu/duke/calendar/command/AddGoalEventCommand.java @@ -24,7 +24,7 @@ public void executeBeginnerMode(Scanner scanner, EventList eventList) { String eventName = scanner.nextLine(); LocalDateTime endTime = parseDateTimeInput(scanner, - "When does it end? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): "); + "What is the deadline? (yyyy-MM-ddTHH:mm:ss) (e.g., 2023-12-20T12:30:30): "); int goal = parseIntegerInput(scanner, "How many flashcard to review by then?: "); diff --git a/src/main/java/seedu/duke/calendar/command/EventCommand.java b/src/main/java/seedu/duke/calendar/command/EventCommand.java index 1ddbf994c7..0c51a49f86 100644 --- a/src/main/java/seedu/duke/calendar/command/EventCommand.java +++ b/src/main/java/seedu/duke/calendar/command/EventCommand.java @@ -1,4 +1,4 @@ -//@@author Brian030601 & Cheezeblokz +//@@author Brian030601 package seedu.duke.calendar.command; diff --git a/src/main/java/seedu/duke/calendar/command/ListCalendarEventsCommand.java b/src/main/java/seedu/duke/calendar/command/ListCalendarEventsCommand.java index 7dc2bfd913..bd3bf643b4 100644 --- a/src/main/java/seedu/duke/calendar/command/ListCalendarEventsCommand.java +++ b/src/main/java/seedu/duke/calendar/command/ListCalendarEventsCommand.java @@ -22,7 +22,7 @@ public class ListCalendarEventsCommand extends EventCommand{ public void execute(Scanner scanner, EventList eventList) { if (eventList.getSize() > 0) { - System.out.println("Here is a list of all your events: "); + System.out.println(" Here is a list of all your events: "); printLine(); int count = 0; diff --git a/src/main/java/seedu/duke/flashcard/FlashcardCommandParser.java b/src/main/java/seedu/duke/flashcard/FlashcardCommandParser.java index cec901d612..8c28d303c5 100644 --- a/src/main/java/seedu/duke/flashcard/FlashcardCommandParser.java +++ b/src/main/java/seedu/duke/flashcard/FlashcardCommandParser.java @@ -11,11 +11,16 @@ import seedu.duke.flashcard.command.DeleteFlashcardCommand; import seedu.duke.flashcard.command.UnknownCommand; +import java.util.logging.Level; +import java.util.logging.Logger; + /** * Parses input entered by the user into a FlashcardCommand for further * processing. */ public class FlashcardCommandParser { + private Logger logger; + /** * Returns the FlashcardCommand corresponding to the passed input. * @@ -25,8 +30,13 @@ public class FlashcardCommandParser { public FlashcardCommand parseInput(String input, Calendar calendar) { assert input != null : "input must not be null"; + logger = Logger.getLogger("FlashcardCommandParser"); + logger.setLevel(Level.WARNING); + input = input.toLowerCase().strip(); + logger.log(Level.INFO, "trying to find matching FlashcardCommand"); + if (input.equals("create flashcard")) { return new CreateFlashcardCommand(); } else if (input.equals("list flashcards")) { @@ -39,6 +49,8 @@ public FlashcardCommand parseInput(String input, Calendar calendar) { return new DeleteFlashcardCommand(input); } + logger.log(Level.INFO, "input doesn't match any know command"); + return new UnknownCommand(); } } diff --git a/src/main/java/seedu/duke/flashcard/FlashcardList.java b/src/main/java/seedu/duke/flashcard/FlashcardList.java index 958867a5c6..a497e85c2e 100644 --- a/src/main/java/seedu/duke/flashcard/FlashcardList.java +++ b/src/main/java/seedu/duke/flashcard/FlashcardList.java @@ -3,6 +3,8 @@ package seedu.duke.flashcard; import java.util.ArrayList; +import java.util.logging.Level; +import java.util.logging.Logger; /** * Container class for a list of flashcards. @@ -10,6 +12,7 @@ */ public class FlashcardList { private ArrayList