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

[CS2113T-F12-1] CardLI #47

Open
wants to merge 575 commits into
base: master
Choose a base branch
from

Conversation

xRossKoh
Copy link

@xRossKoh xRossKoh commented Oct 1, 2021

CardLI is a desktop app for creating, organising, and reviewing flashcards via a Command Line Interface to serve students.

Copy link

@renzocanare renzocanare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, great work on the Developer Guide and use of sequence diagrams to supplement your wordier sections. With a little bit of quick-fixes on the formatting, the whole Developer Guide will look fantastic!

Comment on lines 56 to 61
### Storage Component
The Storage component:
* Saves all the decks
* Saves all the flashcards
* Remembers which deck each flashcard belongs to
* Saves the results of each test

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can consider adding a sequence diagram here to show how the data is loaded into the app and saved into the text files. This will help your users to understand more about how the data is safely saved, and also explain your earlier point in the Design section on "initializes the components in the correct sequence".

image

Comment on lines 240 to 279
<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>

<body>

![](assets/Cards_CardLI.txt%20Example.png)
</body>

For the saving of the user's test history, the method call will expect an `ArrayList` of `AnswerList` objects along
with a `type` argument of "tests".
The `toString()` methods within the `AnswerList`and `Answer` classes have been overridden as per the specified format
of saving the test history to the text file.
For a `Answer` instance, the `toString()` method outputs a formatted string: `<answer> | <questionIndex>`.
For a `AnswerList` instance, the `toString()` method also outputs a formatted string containing information
about the test deck and the user's test score, on top of information on each of the user's answers for the test.
An example of the format of the `Tests_CardLI.txt` where the decks of flashcards are saved is shown
in the screenshot below.

<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

</head>

<body>

![](assets/Tests_CardLI.txt%20Example.png)
</body>


`readCardsFromFile()` and `readTestsFromFile()`

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section appears to have been formatted incorrectly and might have caused the rest of the DG to break. The image below is what this section looks like at your GitHub Pages DG link.

image

Comment on lines 163 to 190
![class diagram](../docs/assets/testClassDiagram.png)

Currently, test feature is implemented on a systemwide level and is handled by `TestManager`.
`TestManager` will call on `TestUi` and `TestParser` to handle the inputs and outputs with the user
and the parsing respectively during the test.

![sequence diagram](../docs/assets/TestSequenceDiagram.png)

To enter into test mode, the user needs to enter `test` in main menu in which the program will
prompt the user to input a number corresponding to the index of the deck that they want to
be tested on or "all" to test all decks.

![sequence diagram](../docs/assets/getTestDeckSequenceDiagram.png)

In both cases, `TestManager` will create an `AnswerList` using a `Deck` that it creates or gets from
`DeckManager` depending on the condition which is shown by the sequence diagram above.
If the user decides to test all decks, the program will compile all `FlashCard` into a `Deck`. If the user
decides to test a single deck, the program will get that deck instance from `DeckManager`.
The `AnswerList` is where the user's response to the test is stored, and it is made up
of `Answer` as shown in the class diagram above. The `AnswerList` is also tagged with the test deck.

![sequence diagram](../docs/assets/testAllCardsShuffledSequenceDiagram.png)

After initializing the `AnswerList`, the testing begins. The `Deck` gets shuffled, then the cards (question)
will be printed one at a time for the user to answer. The user's answer is then parsed and then added into
the `AnswerList`. This process is repeated for the entire `Deck` that is being tested.

![sequence diagram](../docs/assets/markTestSequenceDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great choice to use sequence diagrams here, but it seems that the sequence diagrams are not appearing correctly in the GitHub Pages for your DG (as seen below).

You may want to consider removing ../docs/ from the image source in the code (e.g. assets/testClassDiagram.png as the image link can be relative to where DeveloperGuide.md is stored.

image


Given below is the sequence diagram for `find`:

![](assets/findFlashcardDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good choice to add single-level numbering as it helps me to understand the sequence of which the calls flow. However, I personally am unsure if this is standard notation, and you may want to check if this is allowed. If it is, it's great help!

However, the image also appears quite small on your DG Page, and requires a few zoom-ins to read. If this is possible to adjust, it will definitely help the overall readability of your DG!

image


`returnMatchingFlashCards()` is implemented by creating a stream that consists of all the `FlashCards` from one deck, and filters them based on whether they contain the search term given. Finally all the `FlashCards` that contain the search term are collected in an arrayList and their console outputs are returned in string format for `CardLiUi` to display to the user.

Given below is the sequence diagram for `find`:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to consider moving your sequence diagram for find to below the header as that is where many will expect to find images related to a whole section (and to keep in line with the formatting of the rest of your DG, where their sequence diagrams are located below the header of that section).


### `EditCardCommand`

![](assets/editCardCommandSeqDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
You might want to eliminate the lifeline of the activated bars once they are no longer being referenced.
I mean that once there is a cross in the line, which indicates the item is no longer being referenced you can choose to not extend the line after that cross.


### Move

![](assets/moveCardCommandSeqDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Similarly here, your team might want to not extend the timeline after there is a cross (which represents that the object is no longer being referenced).


### Test Feature

![class diagram](../docs/assets/testClassDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
It seems that the image here is missing. You all might want to check this and update the DG.


How the parsing works:

`Inner Parser` or `Outer Parser` creates a `XYZCommand` which in turn creates its corresponding `XYZCommandParser` (eg. when `InnerParser` creates a `EditCardCommand`, `EditCardCommand` creates a `EditCardParser`.)</li>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Your team might consider checking the content presented on the DG. For example, here the DG displays a List tag which is not supposed to be displayed.
Otherwise, its a good job done on the content:)

3. The command communicates with the `Model` when it is executed (eg. to add a flashcard).
4. The result of the command execution is encapsulated as a `CommandResult` object which is returned to the `UI` from `Logic` to process.

![](assets/parserArchitectureDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Your team might consider making the direction of these little triangle arrows more explicit for better understandability and redability.

Comment on lines 26 to 315
|v2.0|user|find a to-do item by name|locate a to-do without having to go through the entire list|
| |user| add flashcards|
| |user| delete flashcards|
| |user| view my flashcards|know what cards I currenly have in the deck|
| |user| test myself with my flashcards|know if I have memorised the flashcards correctly|

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
As from the syntax used, I think in this section your team was trying to put forward the information in tabular form. However there are some formatting issues which do not present in the tabular form. I have faced a similar issue before and I think its because too much information is being presented in one line.
You can consider making the points (which are presented on each line) to be short so that it fits well in the table and can be presented in tabular form.

@@ -1,29 +1,366 @@
# Developer Guide
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently on Github pages, the template used for this developer guide only takes up half of the screen (at least on my device), perhaps it is good to change to a template that is easier for the reader to view?
image

{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the original source as well}
{list here sources of all reused/adapted ideas, code, documentation, and third-party libraries -- include links to the
original source as well}

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps your team can add something like a content page here containing hyperlinks to jump to each section of the DG? This might make navigating around the document easier.


### Model Component

![](assets/modelArchitectureDiagram.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Maybe the dotted line with these arrows can be straight instead (especially when there is enough space) since the direction of the arrow might seem a little bit confusing to the reader.


## Design & implementation
![](assets/moveCardCommandSeqDiagram.png)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Having a sequence diagram here really helps to clear things up, however, unlike the previous diagrams, this one (and the next few) tends to have more content inside, and it is kind of hard for the reader to read, perhaps the size of the image can be enlarged?
On top of that, I think it was also mentioned by someone else as well: I believe that the lifeline of an object do not need to be drawn after the cross.

@@ -1,29 +1,366 @@
# Developer Guide

# Introduction

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be better for users to navigate around if you consider creating a
"table of contents" section with hooks (a.k.a. hyperlinks)?


Given below is the sequence diagram for `edit` (Deck):

![](assets/editDeckCommandSeqDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could perhaps consider using create in your sequence diagrams to indicate newly created objects.
You could consider this for DeckManager, Deck, or CardLiUi
image

### `EditDeckCommand`


Given below is the sequence diagram for `edit` (Deck):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could perhaps consider deleting the lifeline upon object deletion
image


Given below is the sequence diagram for `find`:

![](assets/findFlashcardDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More of a consistency issue, perhaps you could adjust the sequence diagrams for move, find, and editcardcommand to follow the same style. For instance, in object deletion, if you want to use the cross, consider using it for all your diagrams.

For the find sequence diagram in particular, well done in using the numbering, perhaps this could be replicated in the other diagrams as well. Also, "create" is used here, which again could be replicated in the other sequence diagrams if applicable.

You could also take an extra step by adding numbered steps in the explanation and adjusting it according to the numbers in the sequence diagram

image

returns `deck`, of string type, which represents the deck to be edited.`prepareMoveCommand()` will then return
a string array, `preparedArguments`, which represents the arguments for the next method call.

The `execute()` method will then call the `moveCard()` method of the `DeckManager` class, which in turn calls the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The sequence diagram explanation is detailed, to enhance it further, you could consider using bullet points to ease readers in understanding the thought process better.

prompt the user to input a number corresponding to the index of the deck that they want to
be tested on or "all" to test all decks.

![sequence diagram](../docs/assets/getTestDeckSequenceDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, the class and sequence diagrams for the Test feature are not rendered properly. Could try to fix this urgently

image

namely an `ArrayList` of a generic type `<T>` as well as a `boolean` value, `saveCards`, that indicates whether the method
is saving cards or tests to their respective text files.

![](assets/writeToFileSequenceDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the previous sequence diagrams, perhaps you could consider making your diagram styling more consistent.

namely an `ArrayList` of a generic type `<T>` as well as a `boolean` value, `saveCards`, that indicates whether the method
is saving cards or tests to their respective text files.

![](assets/writeToFileSequenceDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could perhaps consider using "create" for newly created objects, ie. FileWriter, ArrayList

image

* Types fast
* Prefers to store their information online rather than physically
* Has a lot of flashcards


### Value proposition

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done in keeping this section concise. However, a bug caused the page to not render properly.
The user stories, non-functional requirements, glossary, and instructions for manual testing sections are not rendered as expected.

image


Given below is the sequence diagram for `find`:

![](assets/findFlashcardDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could perhaps consider adding the operation invoked above the arrows in steps 2 and 3
image

CardLI is a Command Line Interface (CLI) desktop app designed to help students manage their flashcards. CardLI can help
students keep track of all their flashcards. It also allows students to test their knowledge. All of this in one
single platform.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before the start of DG, it would be better to have a set of hyperlinks for user to navigate the whole DG.

returns `deck`, of string type, which represents the deck to be edited.`prepareMoveCommand()` will then return
a string array, `preparedArguments`, which represents the arguments for the next method call.

The `execute()` method will then call the `moveCard()` method of the `DeckManager` class, which in turn calls the

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this part can consider to use FUNCTION_NAME to make the long paragram more clearer.


### Test Feature

![class diagram](../docs/assets/testClassDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
some of the diagrams are not showing properly, maybe there's something wrong when you imported this .png file to your DG.

the method.

![](assets/readTestsFromFileSequenceDiagram.png)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
For this sequence diagram, maybe you can consider adding cross after each activation bar is ended.

xkisxk and others added 25 commits November 1, 2021 17:03
Edited find function to return error message when there are no cards matching the search term.
changed split parameters such that there needs to be a space after a flag
Fixed dg bugs and bugs from PED
Fix output when viewing a flashcard to accommodate long lines
Changed storage and test functionalities
Fixed bugs for EditDeck,EditCard,UG; Added Junit Testing for EditDeck,EditCard
xRossKoh and others added 30 commits November 8, 2021 19:42
Edit Countdown sequence diagram
Fix bug when adding command
Add Javadoc for CommandArgumentsParser class
sorted out authorship in ugdg. updated ppp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants