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

Update PPP #268

Merged
merged 45 commits into from
Nov 12, 2018
Merged
Show file tree
Hide file tree
Changes from 44 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
2921c42
Add Performance sort command
Nov 11, 2018
3d011c2
Add review score and next review date to card
Nov 11, 2018
3ab97fc
Change sort to accept sort types
Nov 11, 2018
9656657
Modify card list to perform performance sort
Nov 11, 2018
cef607c
Augment performance enum
Nov 11, 2018
7e47558
Add documentation for Card methods
Nov 11, 2018
987f3fa
Fix style errors
Nov 11, 2018
1ff7302
Acknowledge Jethro Kuan for suggestions
Nov 11, 2018
0ee64e9
Integrate performance sort to parser
Nov 11, 2018
b253a25
Merge branch 'master' of https://github.com/CS2103-AY1819S1-T09-2/main
Nov 11, 2018
70b986b
Add bias, update threshold
Nov 11, 2018
ec048c8
Refactor if else loops
Nov 11, 2018
4da4d8e
Update isCorrect core calculation in Performance
Nov 11, 2018
64937b2
Remove reviewed property of card
Nov 11, 2018
665f11e
Change Alphabetical to Lexicographical sort
Nov 11, 2018
6b38a9b
Change Alphabetical to Lexicographical sort
Nov 11, 2018
a4175b9
Add documentation for Card methods
Nov 11, 2018
db9c4a1
Add initial helper methods for performance sort tests
Nov 11, 2018
f28fdc5
Update PPP, fix style errors
Nov 11, 2018
3e4eee7
Remove unused constant
Nov 11, 2018
e8d7ff2
Merge branch 'master' into master
J0 Nov 11, 2018
8ee4331
Merge branch 'master' into master
kr0stofa Nov 11, 2018
11cb17b
Update user guide with rank command
Nov 11, 2018
944abf9
Merge branch 'master' of https://github.com/CS2103-AY1819S1-T09-2/main
Nov 11, 2018
87d86bd
Rename test
Nov 11, 2018
87fcb06
Remove unused import
Nov 11, 2018
202001c
Resolve merge conflicts
Nov 11, 2018
9f8ccb8
Update summary of major enhancements in PPP
Nov 11, 2018
f8abd9b
Fix Grammar errors in PPP
Nov 12, 2018
a398981
Add initial description of deck level operations
Nov 12, 2018
f5de63f
Merge branch 'master' into updatePPP
kr0stofa Nov 12, 2018
b905ae7
Remove comments
Nov 12, 2018
14a15b8
Update developer guide
Nov 12, 2018
5578581
Merge branch 'master' of https://github.com/CS2103-AY1819S1-T09-2/mai…
Nov 12, 2018
eefe63f
Merge branch 'master' of https://github.com/leeyjjoel/Main into updat…
Nov 12, 2018
da38f18
Merge branch 'updatePPP' of https://github.com/leeyjjoel/Main into up…
Nov 12, 2018
559bef7
Fix Style Errors
Nov 12, 2018
8f07425
Update leeyjjoel.adoc
Nov 12, 2018
22822d4
Merge branch 'master' of https://github.com/CS2103-AY1819S1-T09-2/mai…
Nov 12, 2018
2610654
Add images for user guide
Nov 12, 2018
33b8ca4
Update Userguide
Nov 12, 2018
c7a8347
Change phrasing of user guide
Nov 12, 2018
52c2717
Update PPP
Nov 12, 2018
4d7d50e
Fix grammar
kr0stofa Nov 12, 2018
278a3b6
Merge branch 'master' into updatePPP
J0 Nov 12, 2018
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
59 changes: 51 additions & 8 deletions docs/DeveloperGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,25 @@ image::Newcard Sequence Diagram.png[width="790", align="left"]
** Cons: The logic for executing deck-level and card-level commands are implemented at different places. We must ensure that the implementation of each command is correct.

// end::cardleveloperation[]
// tag::deckleveloperation[]
=== Deck-level operations
The following deck level operations are supported in Anakin:

* Anakin#newDeck()
* Anakin#removeDeck()
* Anakin#updateDeck()
* Anakin#importDeck()
* Anakin#exportDeck()

The following sequence diagram describes how the editdeck command would work: +
Step 1: +

Choose a reason for hiding this comment

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

I'm guessing here is where you will add diagrams

Step 2: +
Step 3: +

* *Alternative 1* : <Insert first option here>
* *Alternative 2* : <Insert Alternative here>

// end::deckleveloperation[]

// tag::handleinvalidcommands[]
=== Handle invalid commands
Expand Down Expand Up @@ -529,31 +548,55 @@ We are using `java.util.logging` package for logging. The `LogsCenter` class is
* `INFO` : Information showing the noteworthy actions by the App
* `FINE` : Details that is not usually noteworthy but may be useful in debugging e.g. print the actual list instead of just its size
// tag::autocompleteimplementation[]

=== Autocomplete Implementation
==== Current implementation (v1.4)

Autocompletion in Anakin is handled by an Autocompleter.
The logic behind autocompletion is handled by an `Autocompleter` class.

On pressing tab, CommandBox will raise an event and check if the current text in the command box is autocompletable, that is to say, it is a prefix of one of the existing commands supported by Anakin.
On pressing `<TAB>`, Command Box will raise an event and check if the current text in the command box is autocompletable, that is to say, it is a prefix of one of the existing commands supported by Anakin.
If it is Autocompletable, Autocompleter will search through the list of existing commands in lexicographic order and find the first match for the current text in the command box.

Here is a sequence diagram of what happens during the autocompletion.

==== Design considerations

* *Alternative 1 (current choice):* Use a set of pre-decided completion text for each command and have a list of all supported command words
** Explanation: Each command has a pre-decided autocompletion text and we do prefix-matching between the text in the command box and our existing set of command words.
If there is a potential match, we replace the current text in the command box with the autocompletion text of the supported command which it is matched to.
** Explanation: Each command has a pre-decided `AUTOCOMPLETE_TEXT` field and we do prefix-matching between the text in the command box and our existing set of command words.
If there is a potential match, we replace the current text in the command box with the `AUTOCOMPLETE_TEXT` of the supported command which it is matched to.

** Pros: Better modularity
** Cons: Less customizability. This design doesn't take into account the past commands that the user has issued.
** Pros: Provides better modularity by decreasing the depndency of autocomplete on external components (Current Implementation)
** Cons: Less personalisation to each user. This design doesn't take into account the past commands that the user has issued.

* *Alternative 2:* Match current command against the history of previously executed commands

** Pros: Better prediction of intended command
** Cons: Worse modularity and Separation of Concerns as the autocompleter would need to interact with the history and thus the state of the model.
** Pros: Better personalisation of each command
** Cons: Worse modularity and separation of concerns as the autocompleter would need to interact with the history. As such, it might increase coupling between the autocomplete and history components.

==== How to add autocompletion for new commands
* Should there be a need to include new commands, you can follow the following steps to ensure your command can be autocompleted.

Example Scenario: Suppose we just introduced the `undo` command and we wish to integrate it with the autocompleter.

Step 1 : Add the `AUTOCOMPLETE_TEXT` field to the class. This will decide what the command autocompletes to when the user presses tab. +

image::AddAutocompleteTextExample.png[width="600"]


Step 2 : Add the class to Autocompleter java

image::AddCommandToAutocompleterExample.png[width="600"]

With that, you're good to go!

// end::autocompleteimplementation[]




[[Implementation-Configuration]]


=== Configuration

Certain properties of the application can be controlled (e.g App name, logging level) through the configuration file (default: `config.json`).
Expand Down
72 changes: 52 additions & 20 deletions docs/UserGuide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -332,20 +332,6 @@ Format: `sort`

// end::sort[]

// tag::showDue[]
=== Show cards that should be reviewed on a particular date : `showDue` [coming in v1.4]
Show cards due on a particular date

* Shows the cards which require a review for a particular date based on past card performance. +

Format: `showDue c/10 m/12 y/14`
****
* Note: User must be inside a deck to perform this command.
* The above command will display the cards due on the 10th December, 2014. If no arguments are given for date
* If no day, month or year is given, showDue will default to showing the cards due for today
****
// end::showDue[]

// tag::find[]
=== Search for a deck or card : `find`

Expand Down Expand Up @@ -499,21 +485,67 @@ The `redo` command fails as there are no `undo` commands executed previously.
// end::undoredo[]

=== Clearing all entries : `clear`
Clears all entries from Anakin. +
To clear all entries from Anakin. +
Format: `clear`


=== Exiting Anakin : `exit`
Exits the program. +
To exit the program. +
Format: `exit`

// start::autocompletion[]
// tag::autocompletion[]
=== Autocompletion : Hit `<TAB>`

Provides autocompletion for existing text. If there is an available autocompletion for the text in the textbox then hitting <TAB> will replace the text in the command box with the autocompletion text of the existing command
which is lexicographically closest to what is in the text box. If the command box is empty autocompletion will default to ``cd 1``. Unfortunately, this feature does not work with trailing or preceeding whitespace currently.
Hit <TAB> for autocompletion so you don't have to remember verbose commands. If there is an autocompletion available, hitting <TAB> will replace the current text in the command box with the autocompletion text.

Examples: +

1. Suppose you're attempting to create a new card.

image::newCardPreAutocomplete.png[width="500"]

Image: Partially completed `newcard` command.

2. Just hit <TAB> and you will instantly get the desired result

image::newCardPostAutocomplete.png[width="500"]

Image: After pressing <TAB> the command is automatically completed!

[NOTE]
====
If the command box is empty autocompletion will default to ``cd 1``.
Additionally, this feature does not work with trailing or preceding whitespace currently.
====

// end::autocompletion[]
// tag::rank[]
=== Rank : `rank`

To sort all cards by a user's cumulative performance score on each card. +
Format: `rank` +
Examples: Suppose you are studying for an important exam, and you want to find out which cards you performed poorly on so you can review them.


1. Classify cards as described in the `classify` section above and type `rank`

image::rankScreenshot1.png[width="500"]

Image: Appearance of cards before sorting by performance

2. Type and you will instantly get the desired result

Choose a reason for hiding this comment

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

Missing word


image::rankScreenshot2.png[width="500"]
Image: Appearance of cards after sorting by performance. As can be seen, harder cards move to the top. +

[NOTE]
====
The indicator in the card panel only shows the most recent classification of the card while the scheduling algorithm takes into account all past reviews.
As such, cards labelled HARD may not always be above cards ranked NORMAL.
====


// end::rank[]


== FAQ
Expand Down Expand Up @@ -554,7 +586,7 @@ You must be inside a deck to perform this operation.
|`classify DIFFICULTY` | Classifies the current card into one of the following categories: {‘easy’, ‘normal' , ‘hard’}
|`sort` | Sorts the displayed list of decks by name. +
When you are inside a deck, sorts the displayed list of cards by question.
//|`rank` | Sort the list of cards by performance
|`rank` | Sort the list of cards by performance
|`find KEYWORD [MORE_KEYWORDS]...` | Finds decks with names that contain any of the given keywords. +
When you are inside a deck, finds cards with questions that contain any of the given keywords.
|`export INDEX` | Exports the deck at the specified INDEX. (Default location is the same folder as Anakin)
Expand Down
Binary file added docs/images/AddAutoCompleteTextExample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/AddCommandToAutoCompleterExample.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/newCardPostAutocomplete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/newCardPreAutocomplete.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/rankScreenshot1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/rankScreenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
91 changes: 62 additions & 29 deletions docs/team/leeyjjoel.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,37 @@
:site-section: AboutUs
:imagesDir: ../images
:stylesDir: ../stylesheets
:repoURL: https://github.com/CS2103-AY1819S1-T09-2/main/tree/master

This portfolio outlines the contributions of Lee Yi Jie Joel to the following project(s).
This portfolio outlines my contributions to the following project.

== PROJECT: Anakin

---

This project was completed during August 2018 to November 2018 as part of a Software Engineering module (CS2103T) in
the National University of Singapore. The team comprises Tay Yu Jia, Joel Lee, Foo Guo Wei, David Goh and Nguyen
Trong Truong Thanh.
Anakin is the result of our search for a better command line application to revise for exams. From August 2018 to November 2018,
Team T09-2 comprising of myself, Tay Yu Jia, Foo Guo Wei, David Goh and Nguyen Truong Thanh built Anakin as part of a Software Engineering module (CS2103T) conducted at
the National University of Singapore.

== Overview

Anakin is a desktop-based flashcard application which makes remembering things easy. The user
interacts with it using a CLI, and it has a GUI created with JavaFX. Its key selling points are the ability to replace
traditional paper flashcards (thus saving the environment) and to provide an enhanced learning experience through the
well-established spaced repetition learning method.
interacts with it using a Command Line Interface but can fallback to the Java FX GUI if needed. Anakin uses https://www.supermemo.com/english/ol/sm2.htm[Super Memo 2] which is the spaced repetition algorithm used by popular language learning tools such as
Duolingo, Wani Kani, and Memrise. +

Anakin aims to revolutionise the studying experience of the technically advanced user. On top of being easy to use,
Anakin is also environmentally friendly, having zero paper wastage unlike conventional flashcards.

image::Ui.png[width="500"]
[NOTE]
====
What is spaced repetition? +
Spaced repetition is a learning technique that incorporates increasing intervals of time between subsequent review of previously learned material in order to exploit the psychological spacing effect.
====

It is written in Java, and has about 10 kLoC.


* *Main features*:
** Create decks of flashcards easily
** Review your flashcards on the go
Expand All @@ -32,25 +43,31 @@ It is written in Java, and has about 10 kLoC.

This section acts as a summary of the contributions made by Lee Yi Jie Joel to project Anakin.

* *Major enhancement*: added *showDue* command as well as the scheduling algorithm behind it
** What it does: allows the users to see cards which have been scheduled on a particular date .
** Justification: This feature improves the product significantly because a user will want to be able to look through
review cards based on how he has classified them
** Highlights: This enhancement affects existing commands and commands to be added in future. While in the review
mode, using the *supermemo2* spaced recognition algorithm, the student is saved from the hassle of seperating his/her flashcards
into boxes based on how well he/she remembers them. This will allow for a better studying experience and in turn better recall for tests
* *Major enhancement*: I added autocompletion for commands
** What it does: allows the users to sort cards by when they should be reviewed.
** Justification: This feature improves the product significantly because a user will want to be able to finish expressing
the command he wants to type with a simple press of <TAB>
** Highlights: This enhancement affects existing commands and commands to be added in future. While typing in the command box, the student is saved from the hassle of typing and remembering
long strings of command syntax. This will allow for a better user experience and in turn easier studying for tests.

* *Major enhancement*: I added the scheduling algorithm at the core of the product together with the `rank` command
** What it does: allows the users to sort cards by when they should be reviewed.
** Justification: This feature improves the product significantly because a user will want to review cards which he or she performed poorly on
** Highlights: This allows user to focus on what's important for review by sorting the cards in order of performance and pushing cards which require review to the top of the deck.



* *Minor enhancements*:
** Help command which allows user to seek help when he/she is lost or initially starting out
** Added systemtests to increase robustness of the application
** Implemented a `editdeck` command that allows user to update the details of their deck.
** Added an exit command to allow user to leave the deck
** Added a `select` command which is now deprecated
** Add `undo` and `redo` functions
** Implement autocompletion function
** Added Help command which allows user to seek help when he/she is lost.
** Implemented the `editdeck` command that allows users to update the name of their deck.
** Added the `exit` command to allow the user to leave the deck
** Added the `select` command which eventually formed the basis for other commands to be developed.
** Add `undo` and `redo` commands


*Code contributed:* https://nus-cs2103-ay1819s1.github.io/cs2103-dashboard/#=undefined&search=leeyjjoel[GitHub]
*Code contributed:*
https://github.com/CS2103-AY1819S1-T09-2/main/commits?author=leeyjjoel[Github Commits],
https://nus-cs2103-ay1819s1.github.io/cs2103-dashboard/#=undefined&search=leeyjjoel[Reposense]

* *Other contributions*:

Expand All @@ -59,27 +76,41 @@ into boxes based on how well he/she remembers them. This will allow for a better
https://github.com/CS2103-AY1819S1-T09-2/main/issues?q=is%3Aissue+is%3Aclosed+author%3Aleeyjjoel[List of created issues]
*** Update contact us page (Pull request https://github.com/CS2103-AY1819S1-T09-2/main/pull/68[#68])
*** Added initial documentation for team README (Pull request https://github.com/CS2103-AY1819S1-T09-2/main/pull/23[#23])
*** Integrate reposense for code contribution tracking
*** Integrate Reposense for code contribution tracking (Pull request https://github.com/CS2103-AY1819S1-T09-2/main/pull/75/files[#75])
*** Configure naming convention of files and packages across the project to comply with project style guide(https://github.com/CS2103-AY1819S1-T09-2/main/pull/38/files[#38]
, https://github.com/CS2103-AY1819S1-T09-2/main/pull/106/files[#106])



** Enhancements to existing features:
*** Created system tests (Pull request https://github.com/CS2103-AY1819S1-T09-2/main/pull/158[#158])
*** Wrote extensive system tests which played a major role in boosting coverage from 66% to the above 90%
**** Wrote integration tests and tests for help command(https://github.com/CS2103-AY1819S1-T09-2/main/pull/148[#148])
**** Wrote Unit Tests for editdeck(https://github.com/CS2103-AY1819S1-T09-2/main/pull/121/files[#121])
**** Wrote tests for EditCard, EditDeckParser, and GUI (https://github.com/CS2103-AY1819S1-T09-2/main/pull/157/files[#157])
**** Wrote System Tests for ClearCommand, FindCommand, Logic Manager, EditDeck, NewDeck(https://github.com/CS2103-AY1819S1-T09-2/main/pull/158/files[#158],
https://github.com/CS2103-AY1819S1-T09-2/main/pull/165/files[#165],
https://github.com/CS2103-AY1819S1-T09-2/main/pull/238[#238], https://github.com/CS2103-AY1819S1-T09-2/main/pull/242[#242], https://github.com/CS2103-AY1819S1-T09-2/main/pull/244[#244])


** Documentation:
*** Add documentation for deck level operations(https://github.com/CS2103-AY1819S1-T09-2/main/pull/110/files[#110])
*** Update user guide and development guide(https://github.com/CS2103-AY1819S1-T09-2/main/pull/268[#268])

** Community:
*** PRs reviewed (with non-trivial review comments):
https://github.com/CS2103-AY1819S1-T09-2/main/pull/189[#189]
https://github.com/CS2103-AY1819S1-T09-2/main/pull/195[#195]
https://github.com/CS2103-AY1819S1-T09-2/main/pull/271[#271]

*** Discovered and reported bugs to peers:
This is a work in progress

== Contributions to the User Guide

|===
|_Given below are sections I contributed to the User Guide. They showcase my ability to write documentation targeting end-users._
|===

include::../UserGuide.adoc[tag=showDue]
include::../UserGuide.adoc[tag=autocompletion]
include::../UserGuide.adoc[tag=rank]
include::../UserGuide.adoc[tag=undoredo]


== Contributions to the Developer Guide
Expand All @@ -89,6 +120,8 @@ include::../UserGuide.adoc[tag=showDue]
|===

include::../DeveloperGuide.adoc[tag=autocompleteimplementation]
include::../DeveloperGuide.adoc[tag=decklevelcommands]
//include::../DeveloperGuide.adoc[tag=deckleveloperation]




12 changes: 7 additions & 5 deletions src/main/java/seedu/address/logic/parser/Autocompleter.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package seedu.address.logic.parser;

//import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -37,7 +36,11 @@
*/

public class Autocompleter {
// This method of approaching the problem was inspired by @jethrokuan
/** This method of approaching the problem was inspired by verbal discussion with @jethrokuan
* (a Year Three CS student)
* His team's CS2103 project can be found at https://github.com/jethrokuan/main
*/

/**
* Checks if {@code commandBox}'s commandTextField has a potential autocompletable command word,
* if there exists such a word, it is replaced with the relevant autocompletion command.
Expand Down Expand Up @@ -88,11 +91,10 @@ private static List<String> getCommandField(String field) {
}

/**
* Creates a list of all existing command classes and returns it to the user.
* Creates a list of all existing command classes and returns it to the user so that
* the user can retrieve properties within each command class.
*/
private static List<Class<? extends Command>> getCommandClasses() {
// File directory = new File(COMMAND_DIRECTORY);
// File[] fList = directory.listFiles();
List<Class<? extends Command>> commandClasses = new ArrayList<>();
commandClasses.add(ChangeDeckCommand.class);
commandClasses.add(ClassifyCommand.class);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/seedu/address/model/deck/UniqueCardList.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void sort() {
* Sort all cards in the list in order of performance.
*/
public void perfsort() {
internalList.sort(Comparator.comparing(o -> o.getNextReview()));
internalList.sort(Comparator.comparing(o -> -o.getReviewScore()));
J0 marked this conversation as resolved.
Show resolved Hide resolved

}

Expand Down
Loading