Skip to content

Commit a746f34

Browse files
authored
Merge pull request nus-cs2113-AY2324S1#9 from AY2324S1-CS2113-F11-3/master
Update
2 parents 5427ad9 + e1833f6 commit a746f34

34 files changed

+389
-289
lines changed

META-INF/MANIFEST.MF

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Main-Class: seedu.duke.Duke
3+

data/events/event.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
submit v1.0 | 2023-10-29T23:59:59 | 2023-10-30T23:59:59
22
eat dinner | 2023-12-20T19:00 | 2023-12-20T20:00
3+
Do HW | 2023-12-20T12:30:30 | 2023-12-20T12:30:30

data/flashcards/flashcard 1124.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3 | Hello | Duke | - | - | -
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2 | d | a | - | 2023-11-02T00:03:45.242754100 # MODERATE/2023-11-02T00:03:47.250188600 # EASY/2023-11-02T00:03:49.267332500 # HARD/2023-11-02T00:16:31.511531100 # MODERATE/2023-11-02T00:18:58.600168500 # MODERATE/2023-11-02T00:19:05.649443900 # MODERATE | -
2+
4 | Hello | Duke | - | - | -

data/flashcards/flashcard.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2 | d | a | - | 2023-11-02T00:03:45.242754100 # MODERATE/2023-11-02T00:03:47.250188600 # EASY/2023-11-02T00:03:49.267332500 # HARD/2023-11-02T00:16:31.511531100 # MODERATE/2023-11-02T00:18:58.600168500 # MODERATE/2023-11-02T00:19:05.649443900 # MODERATE | -
2-
4 | Hello | Duke | - | - | -
1+
3 | cs2113 | software enginnering | 5
2+
5 | Hello | Duke | 5

docs/DeveloperGuide.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,39 @@
1010

1111
### Storage Components
1212

13-
API: `Storage.java`
13+
API: `FlashcardStorage.java`
1414

15-
The `Storage` component,
15+
![Flashcard Storage Sequance Diagram](photo/FlashcardStorage-0.png)
16+
17+
The `FlashcardStorage` component,
1618
* can save flashcards in `flashcard.txt` in specific text format
17-
* can save events in `event.txt` in specific text format
1819
* saves automatically when changes occur.
1920
* component loads automatically when the program starts.
2021
* component can check if the saved txt file has been damaged.
2122

23+
`EventStorage` has same structure.
24+
25+
2226
### Calendar Components
23-
24-
The `Calendar` component,
25-
* Add events
26-
* Delete events
27-
* List events
28-
* Find events
27+
28+
#### Command Package
29+
30+
+ The package has 7 files in it for users to command their calendar. Those files are
31+
AddEventCommand, DeleteAllEventsCommand, DeleteEventCommand, EventCommand, FindEventCommand
32+
ListEventCommand, and UnknownCommand. The other 6 commands extend EventCommand, which is
33+
an abstract class that forces other 6 commands to have an execute method.
34+
35+
36+
+ Each command files execute its own commands. The UnknownCommand file handles the exceptions,
37+
such as if the user commands something that doesn't exist
38+
39+
#### Calendar Package
40+
41+
+ The calendar package excluding the command package has another 8 files.
42+
The empty calendar class is reserved for adding future implementations.
43+
The CalendarManager, EventStorage, & CalendarCommandParser manages user input, saves, and loads them.
44+
The classes are associated with one another through instant accesses and other means. The
45+
CalendarManager directs the events and event list, which then are run on Duke.
2946

3047
## Product scope
3148

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,61 @@
11
@startuml
2-
activate FlashcardStorage
32

3+
participant ":FlashcardComponent" as fc
4+
participant ":FlashcardDirectory" as fd
5+
participant ":FlashcardStorage" as fs
6+
participant ":FlashcardList" as fl2
7+
participant ":FlashcardList" as fl
8+
participant ":FlashcardStorageParser" as fp
9+
10+
11+
activate fc
12+
13+
create fd
14+
fc->fd ++: new
15+
16+
return directory:FlashcardDirectory()
17+
18+
destroy fd
19+
20+
create fs
21+
fc->fs ++: FlashcardStorage(directory)
22+
23+
return : FlashcardStorage
24+
25+
fc->fs++ : loadFlashcards()
26+
27+
alt default
28+
29+
create fl
30+
fs->fl ++: FlashcardList()
31+
32+
return :FlashcardList
33+
34+
35+
36+
loop for all lines in file
37+
38+
fs->fp++ : loadFlashcard()
39+
40+
return flashcard:Flashcard
41+
42+
fs->fl ++: add(flashcard)
43+
return
44+
45+
end
46+
47+
return :FlashcardList
48+
49+
else FileNotFoundException
50+
51+
52+
fs-->fc
53+
create fl2
54+
fc->fl2 ++: FlashcardList(emptyArray)
55+
return :FlashcardList
56+
57+
58+
59+
end
460

561
@enduml

docs/UserGuide.md

Lines changed: 139 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -9,89 +9,106 @@ taking.
99
## Quick Start
1010

1111
1. Ensure that you have Java 11 or above installed.
12-
2. Down the latest jar from [the latest release on GitHub]
13-
(https://github.com/AY2324S1-CS2113-F11-3/tp/releases).
12+
2. Down the latest jar from [the latest release on GitHub](https://github.com/AY2324S1-CS2113-F11-3/tp/releases).
1413
3. Run the jar via `java -jar duke.jar`
1514

16-
## General explanation of flashcards
17-
1815
## Features
1916

20-
### Listing all flashcards: `list flashcards`
21-
22-
Prints out a list of all flashcards.
23-
24-
Format: `list flashcards`
25-
26-
### Adding a todo: `todo`
27-
Adds a new item to the list of todo items.
28-
29-
Format: `todo n/TODO_NAME d/DEADLINE`
17+
### Flashcard-related features
3018

31-
* The `DEADLINE` can be in a natural language format.
32-
* The `TODO_NAME` cannot contain punctuation.
19+
#### General explanation of flashcards
3320

34-
Example of usage:
21+
#### Listing all flashcards: `list flashcards`
3522

36-
`todo n/Write the rest of the User Guide d/next week`
23+
Prints out a list of all flashcards that shows each flashcard's front text
24+
and back text as well as its id and current difficulty level.
3725

38-
`todo n/Refactor the User Guide to remove passive voice d/13/04/2020`
26+
Format: `list flashcards`
3927

40-
### Creating a new flashcard: `create flashcard`
28+
#### Creating a new flashcard: `create flashcard`
4129

4230
Starts the process of adding a new flashcard.
4331

44-
After entering this command, you are prompted to first input the front page
45-
text (once you have typed it out, submit it by pressing <ENTER>) and then the
46-
back page text (once you have typed it out, submit it by pressing <ENTER>) of
32+
After entering this command, you are prompted to first input the front page
33+
text (once you have typed it out, submit it by pressing <ENTER>) and then the
34+
back page text (once you have typed it out, submit it by pressing <ENTER>) of
4735
your new flashcard.
4836

49-
After you've done this, a success message will be printed out. This
37+
After you've done this, a success message will be printed out. This
5038
indicates that a new flashcard has been successfully created and saved.
5139

5240
Format: `create flashcard`
5341

54-
### Reviewing your flashcards: `review flashcards`
42+
#### Reviewing your flashcards: `review flashcards`
5543

5644
Starts the process of reviewing flashcard.
5745

58-
After entering this command, you are prompted to select your exact review
59-
mode from 3 choices:
46+
After entering this command, you are prompted to select your exact review
47+
mode from two choices:
6048

6149
- `random mode`: Randomly selects flashcards to review
62-
- `spaced repetition mode`: Which flashcards are shown depends on how well
63-
you previously knew them. Flashcards which you couldn't remember well are
64-
shown more often, while flashcards which you remembered well are shown
50+
- `spaced repetition mode`: Which flashcards are shown depends on how well
51+
you previously knew them. Flashcards which you couldn't remember well are
52+
shown more often, while flashcards which you remembered well are shown
6553
less often.
66-
- `review by tag mode`: Randomly selects flashcards with a certain tag to review
6754

68-
Input `a` to choose `random mode`, input `b` to choose `spaced repetition
69-
mode` and input `c` to choose `review by tag mode`.
55+
Input `a` to choose `random mode`, or input `b` to choose `spaced repetition
56+
mode`.
7057

71-
Once you've selected a review mode, the actual review begins: the front page
72-
of a flashcard is shown to you. You should now try and think of the answer
73-
(the text on the back page of the flashcard); and once you're ready, press
58+
Once you've selected a review mode, the actual review begins: the front page
59+
of a flashcard is shown to you. You should now try and think of the answer
60+
(the text on the back page of the flashcard); and once you're ready, press
7461
<ENTER> to compare it to the actual back page.
7562

63+
In spaced repetition mode, after you have revealed the back page of a
64+
flashcard, you are prompted to rate how to difficult it was to remember.
65+
Select `E` if it was easy, `M` if it was moderately hard and `H` if it was
66+
quite hard. This information is used to adjust the difficulty of the
67+
flashcard you just reviewed.
68+
7669
Now, the process repeats and the next flashcard is shown to you.
7770

78-
If you want to quit the review process, simply input `q` or `quit` instead
71+
If you want to quit the review process, simply input `q` or `quit` instead
7972
of pressing <ENTER> to reveal the back page.
8073

8174
Format: `create flashcard`
8275

83-
## General explanation of calendar features
76+
#### Deleting a flashcard
8477

85-
## Features
86-
- `add event` , `delete event`
87-
- `list events` , `find event`
88-
- `delete all events`
78+
Starts the process of deleting a flashcard.
8979

90-
### Add an Event to the Calendar: `add event`
80+
After entering this command, you are prompted to input the id of the
81+
flashcard you want to delete. Input it into the terminal and then press enter.
9182

92-
- **Adds an event to the calendar with start and end time**
83+
If it was a valid id, the flashcard with that id is deleted; otherwise, an
84+
error message is shown and you are prompted to retry.
9385

94-
Format: `add event`
86+
Format: `delete flashcard`
87+
88+
#### Deleting all flashcards: `delete all flashcards`
89+
90+
Deletes all flashcards that you have added so far.
91+
92+
Format: `delete all flashcards`
93+
94+
95+
96+
97+
### General Explanation of Calendar Features
98+
99+
Here is your features list:
100+
101+
+ `add event` , `delete event`
102+
+ `list events` , `find event`
103+
+ `delete all events`
104+
105+
Users can use the above features to handle their events
106+
107+
#### Adding a todo: `todo`
108+
109+
Adds a new item to the list of todo items.
110+
111+
Format: `todo n/TODO_NAME d/DEADLINE`
95112

96113
* The `DEADLINE` can be in a natural language format.
97114
* The `TODO_NAME` cannot contain punctuation.
@@ -102,6 +119,78 @@ Example of usage:
102119

103120
`todo n/Refactor the User Guide to remove passive voice d/13/04/2020`
104121

122+
123+
124+
#### Add an Event to the Calendar
125+
126+
**Adds an event to the calendar with start and end time**
127+
128+
#### Usage
129+
130+
+ Format: `add event` [Command]
131+
+ What's the event?: `Event name` [Event name]
132+
+ When does it start?: `yyyy-mm-ddThh:mm:ss` [Start time]
133+
+ When does it end?: `yyyy-mm-ddThh:mm:ss` [End time]
134+
135+
**Example of usage**:
136+
137+
+ `Enter your command: add event`
138+
+ `What's the event?: Do HW`
139+
+ `When does it start?: 2023-12-20T12:30:30`
140+
+ `When does it end?: 2023-12-20T12:40:30`
141+
142+
#### Delete an Event From the Calendar
143+
144+
**deletes an event from the calendar with event name**
145+
146+
#### Usage
147+
148+
+ Format: `delete event`
149+
+ Enter the event name: `Event name` [Event name]
150+
151+
**Example of usage**:
152+
153+
+ `Enter your command: delete event`
154+
+ `Enter the event name: Do HW`
155+
156+
#### Delete All Events From the Calendar
157+
158+
**deletes all events from the calendar**
159+
160+
#### Usage
161+
162+
+ Format: `delete all events`
163+
164+
**Example of usage**:
165+
166+
+ `Enter your command: delete all events`
167+
168+
#### Find an Event From the Calendar
169+
170+
**finds an event from the calendar**
171+
172+
##### Usage
173+
174+
+ Format: `find event`
175+
+ What event are you looking for?: `event name`
176+
177+
**Example of usage**:
178+
179+
+ `Enter your command: find event`
180+
+ `What event are you looking for?: Do HW`
181+
182+
#### List All Events From the Calendar
183+
184+
**Lists all events from the calendar**
185+
186+
#### Usage
187+
188+
+ Format: `list events`
189+
190+
**Example of usage**:
191+
192+
+ `Enter your command: find event`
193+
105194
## FAQ
106195

107196
**Q**: Where can I find my flashcard and caldendar data?
@@ -119,3 +208,8 @@ Every event and flashcard are automatically save after each command.
119208
* List all flashcards: `list flashcards`
120209
* Create a new flashcard: `create flashcard`
121210
* Review your flashcards: `review flashcards`
211+
* Create an event: `add event`
212+
* Delete an event: `delete event`
213+
* Delete all events: `delete all events`
214+
* Find an event: `find event`
215+
* List events: `list events`

docs/photo/FlashcardStorage-0.png

43 KB
Loading

flashcard.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)