Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ug dg #145

Merged
merged 6 commits into from
Oct 24, 2019
Merged

Ug dg #145

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The `Model`,
[NOTE]
As a more OOP model, we can store a `Category` list in `Address Book`, which `FlashCard` can reference. This would allow `Address Book` to only require one `Category` object per unique `Category`, instead of each `Flashcard` needing their own `Category` object. An example of how such a model may look like is given below. +
+
image:BetterModelClassDiagram.png[]
image:BetterModelClassDiagram.png[width = "600"]

[[Design-Storage]]
=== Storage component
Expand Down Expand Up @@ -178,7 +178,7 @@ image::AddSequenceDiagram.png[]


The add feature does not allow adding of duplicate flashcards.
If the flashcard exits in the storage, an error will be shown.
If the flashcard exists in the storage, an error will be shown.

The following activity diagram summarizes what happens when a user executes an add command:

Expand All @@ -191,7 +191,7 @@ image::AddActivityDiagram.png[]
prefixes like `q>`, `a>`, `r>` and `c>`
** pros: Easier to implement.
** cons: User might miss the prefixes hence adding wrong flashcards
* **Alternative 2:** Make use of the GUI. after user execute `add` command,
* **Alternative 2:** Make use of the GUI. After user execute `add` command,
an **add flash card window** would pop up and there is segment for individual fields.
** pros: More user friendly.
** cons: Harder to implement.
Expand Down
205 changes: 170 additions & 35 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= AddressBook Level 3 - User Guide
= KeyboardFlashCards - User Guide
:site-section: UserGuide
:toc:
:toc-title:
Expand Down Expand Up @@ -38,48 +38,178 @@ image::annotatedUi.png[width="790"]


== Features

This section contains the features and their respective commands
====
*Command Format*

* Words in `UPPER_CASE` are the parameters to be supplied by the user e.g. in `add >QUESTION`, `QUESTION` is a parameter. The command format would thus be as such: `add q>1+1`.
* Items in square brackets are optional e.g `q>QUESTION [c>CATEGORY]` can be used as `q>1+1 c>math` or as `q>1+1`.
* Items in square brackets skinparam linetype orthoare optional e.g `q>QUESTION [c>CATEGORY]` can be used as `q>1+1 c>math` or as `q>1+1`.
* Items with `…`​ after them can be inserted zero or more times e.g. `[c>CATEGORY]...` can be used as `{nbsp}` (i.e. 0 times), `c>math`, `c>math c>school` etc.
* Parameters can be in any order e.g. if the command specifies `q>QUESTION a>ANSWER`, `a>ANSWER q>QUESTION` is also acceptable.
====

=== Add new flashcard: `add [q>QUESTION] [q>ANSWER] [c>CATEGORY]...`

You can add a new flashcard with specific question and answer. +
This command allow to you to add a new flashcard with specific question and answer. +
`add q>What is CS2103T a>Software engineering`

You may also specified the category of the flashcard. +
`add q>What is CS2103T a>Software engineering c>CS2103T`

To add:

. Type `add` followed by the question and answer and press **Enter** to execute it.
+
image::AddStep1.png[width="600"]

. The result box will display the message: _"New flashCard added: What is the use of checksum ? Answer: To detect "error" Categories: "_
+
image::AddStep2.png[width="600"]

. And you can check whether the new flashcard has been added to the flashcard list.
+
image::AddStep3.png[width="600"]

=== Edit an existing flashcard: `edit [INDEX] {fields wanted to edit}...`

Edit the flashcard with index corresponding to the display list with 1 or multiple fields
`edit 1 q>1+1`
This command allows you to edit the flashcard with index corresponding to the
display list with 1 or multiple fields +
e.g: +

* `edit 7 c>CS2105`
* `edit 1 a>lambda c>science`
* `edit 1 q> 11 * 11 a> 121 c> math`

=== Delete entire topic: `delete [category]`
To edit:

`delete Math *`
. Type `edit` followed by the index and the content to edit, then press *Enter* to execute it.
+
image::EditStep1.png[width="600"]

. The result box will display the message: _"Edited FlashCard: What is the use of checksum ? Answer: To detect "error" Categories: [CS2105]"_.
+
image::EditStep2.png[width="600"]

****
* Edits the person at the specified `INDEX`. The index refers to the index number shown in the displayed person list. The index *must be a positive integer* 1, 2, 3, ...
* At least one of the optional fields must be provided.
* Existing values will be updated to the input values.
* When editing categories, the existing categories of the person will be removed i.e adding of categories is not cumulative.
* You can remove all the person's categories by typing `t>` without specifying any categories after it.
****
. And you can check whether the flashcard has been edited on the flashcard list.
+
image::EditStep3.png[width="600"]

=== Delete flashcard: `delete [INDEX]`

This command allows you the delete a
particular flashcard with the index
show on the flashcard list. e.g.
`delete 1`

To delete:

. Type `delete` with the corresponding index displayed on the
flashcard list and press *Enter* to execute it.
+
image::DeleteStep1.png[width="600"]

. The result box will show the message: _"Deleted FlashCard: What is the use of checksum ? Answer: To detect "error" Categories: [CS2105]"_
+
image::DeleteStep2.png[width="600"]

. And you can check the flashcard list that the flashcard has been deleted.
+
image::DeleteStep3.png[width="600"]

=== Clear all the flashcard: `clear`

This command allows you to delete all the flashcard in the storage.

To clear:

. Type `clear' and press *Enter* to execute it.
+
image::ClearStep1.png[width="600"]

. The result box will show the message: -"Flash card has been cleared!"_
And you will see that all lists turn empty.
+
image::ClearStep2.png[width="600"]


=== Search of flashcards: `find`

This section will show you different ways to find flashcards that matches the keyword(s).

==== Search for flashcards that either the question or the answer matches the keyword(s): "find [keyword(s)]

This command allows you to find a list of flashcards with the question or answer matching the keyword(s).
Multiple keywords are separated by a single space.

To find:

. Type `find` followed by the keywords and press *Enter* to execute it.
+
image::FindStep1.png[width="600"]

. The result box will show message: _"4 flash cards listed!"_ and the flashcard list will show the matched flashcards
+
image::FindStep2.png[width="600"]

==== Search for flashcard with question matching the keyword(s) only: `findq [keyword(s)]`

This command allows you to find a list of flashcards with the question matching the keyword(s).
Multiple keywords are separated by a single space.

to find question:

. Type `findq` follow by the keywords and press *Enter* to execute it.
+
image::FindqStep1.png[width="600"]

. The result box will show message: _"2 flash cards listed!"_ and the flashcard list will show the matched flashcards
+
image::FindqStep2.png[width="600"]

==== Search for flashcard with answer matching the keyword(s) only: `finda [keyword(s)]`

This command allows you to find a list of flashcards with the answer matching the keyword(s).
Multiple keywords are separated by a single space.

to find answer:

. Type `finda` follow by the keywords and press *Enter* to execute it.
+
image::FindaStep1.png[width="600"]

. The result box will show message: _"1 flash cards listed!"_ and the flashcard list will show the matched flashcards
+
image::FindaStep2.png[width="600"].

==== Search for category/categories : `findcat [keyword(s)]`

=== List function topics and flashcards: `list [category]`
list all the flashcards under the specific category that matching the keyword(s).
Multiple keywords are separated by a single space.

Lists all the flashcards under the specific topic folder. Each flashcard is color-coded to represent your familiarity with the content.
`list Math`
to find category:

. Type `findcat` follow by the keywords and press *Enter* to execute it.
+
image::FindcatStep1.png[width="600"]

. The result box will show message: _""_ and the flashcard list will show the matched flashcards
+
image::FindcatStep2.png[width="600"].


=== List all flashcards: `list`

This command allows you to lists all the flashcards in the storage.

To list:

. Type `list` and press *Enter* to execute it.
+
image::ListStep1.png[width="600"]

. The result box will show message: _"Listed all Flash Cards"_ and the flashcard list will show all the flashcards.
+
image::ListStep2.png[width="600"]

=== Start flashcard test: `start`

Expand Down Expand Up @@ -135,17 +265,22 @@ exporting to document files.

`help`

=== Search flashcards: `search [keywords]`

`search process`

=== Stop test: `stop`

`stop`

=== Exit: `exit`

`exit`
This command allows you to exit the application.

To exit:

. Type `exit` and press *Enter* to execute it.

. The application window will close by itself.


=== View overall stats: `stats`

Expand Down Expand Up @@ -196,28 +331,28 @@ There is no need to save manually.

== Command Summary

* Add new flashcard: add [q>QUESTION] [q>ANSWER] [c>CATEGORY]…​ +
e.g. `add q>1+1 a>2`
* Edit an existing flashcard - ` edit [INDEX] {fields wanted to edit}…​` +
e.g. `edit 2 c>CS2103`
* Delete an existing flashcard - `delete [INDEX]` +
e.g. `delete 10`
* Clear all the flashcard - `clear` +
e.g. `clear`
* Start a certain topic of flashcards - `start [keyword]` +
e.g. `start Mathematics`
* Add a new (empty) category - `cat [name]` +
e.g. `cat Math`
* Add a new flashcard - `add [category]` +
e.g. `add Math`
* Edit an existing flashcard - `edit [category] [ID]` +
e.g. `edit Math 10`
* Delete an existing flashcard - `delete [category] [ID]` +
e.g. `delete Math 10`
* Delete an entire category - `delete [category]` +
e.g. `delete Math *`
* Set user preference for reminders - `remind [category] DD/MM HHmm` +
e.g. `remind Math 04/10 1230`
* List all flashcards under a specific category - `list [category]` +
e.g. `list Math`
* Search of flashcards - `find`
** find [keyword(s)]
** findq [keyword(s)]
** finda [keyword(s)]
** findcat [keyword(s)]
* List all flashcards - list
* Export all flashcards under a specific category, to a specific filepath - `export c>CATEGORY p>FILE_PATH` +
e.g. `export c>CS2105 p>C:\Users\User\Documents\cheat_sheet.docx`
* Get full list of commands - `help` +
e.g. `help`
* Search specific flashcards - `search [keywords]` +
e.g. `search UML diagrams`
* Stop flashcard test - `stop`
* Exit - `exit`
* View overall statistics - `stats`
2 changes: 1 addition & 1 deletion docs/diagrams/AddActivityDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if () then ([question and answer
to respective fields;
:Create FlashCard;
if () then([flashCard does
not exists
not existed
in the storage]
)
:Add FlashCard to the storage;
Expand Down
45 changes: 10 additions & 35 deletions docs/diagrams/AddSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@

box Logic LOGIC_COLOR_T1
participant ":LogicManager" as LogicManager LOGIC_COLOR
participant ":AddressBookParser" as AddressBookParser LOGIC_COLOR
participant ":KeyboardFlashCardsParser" as KeyboardFlashCardsParser LOGIC_COLOR
participant ":AddCommandParser" as AddCommandParser LOGIC_COLOR
participant "a:AddCommand" as AddCommand LOGIC_COLOR
participant ":CommandResult" as CommandResult LOGIC_COLOR
participant ":ParserUtil" as ParserUtil LOGIC_COLOR
participant ":FlashCard" as FlashCard LOGIC_COLOR

end box
Expand All @@ -19,43 +18,19 @@ end box
[-> LogicManager : execute("add q>1+1 a>2 c>math")
activate LogicManager

LogicManager -> AddressBookParser : parseCommand("add q>1+1 a>2 c>math")
activate AddressBookParser
LogicManager -> KeyboardFlashCardsParser : parseCommand("add q>1+1 a>2 c>math")
activate KeyboardFlashCardsParser

create AddCommandParser
AddressBookParser -> AddCommandParser : AddCommandParser()
KeyboardFlashCardsParser -> AddCommandParser : AddCommandParser()
activate AddCommandParser

AddCommandParser --> AddressBookParser
AddCommandParser --> KeyboardFlashCardsParser
deactivate AddCommandParser

AddressBookParser -> AddCommandParser : parse("q>1+1 a>2 c>math")
KeyboardFlashCardsParser -> AddCommandParser : parse("q>1+1 a>2 c>math")
activate AddCommandParser

AddCommandParser -> ParserUtil: parseQuestion("1+1")
activate ParserUtil

ParserUtil --> AddCommandParser: qn
deactivate ParserUtil

AddCommandParser -> ParserUtil: parseAnswer("2")
activate ParserUtil

ParserUtil --> AddCommandParser: ans
deactivate ParserUtil

AddCommandParser -> ParserUtil: parseRating("null")
activate ParserUtil

ParserUtil --> AddCommandParser: r
deactivate ParserUtil

AddCommandParser -> ParserUtil: parseCategory("math")
activate ParserUtil

ParserUtil --> AddCommandParser: cat
deactivate ParserUtil

create FlashCard
AddCommandParser -> FlashCard: FlashCard(qn, ans, r, c)
activate FlashCard
Expand All @@ -71,14 +46,14 @@ activate AddCommand
AddCommand --> AddCommandParser : a
deactivate AddCommand

AddCommandParser --> AddressBookParser : a
AddCommandParser --> KeyboardFlashCardsParser : a
deactivate AddCommandParser
'Hidden arrow to position the destroy marker below the end of the activation bar.
AddCommandParser -[hidden]-> AddressBookParser
AddCommandParser -[hidden]-> KeyboardFlashCardsParser
destroy AddCommandParser

AddressBookParser --> LogicManager : a
deactivate AddressBookParser
KeyboardFlashCardsParser --> LogicManager : a
deactivate KeyboardFlashCardsParser

LogicManager -> AddCommand : execute(model)
activate AddCommand
Expand Down
2 changes: 1 addition & 1 deletion docs/diagrams/ArchitectureSequenceDiagram.puml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ activate model MODEL_COLOR
model -[MODEL_COLOR]-> logic
deactivate model

logic -[LOGIC_COLOR]> storage : saveAddressBook(keyboardFlashCards)
logic -[LOGIC_COLOR]> storage : saveKeyboardFlashCards(keyboardFlashCards)
activate storage STORAGE_COLOR

storage -[STORAGE_COLOR]> storage : Save to file
Expand Down
Loading