PROJECT: FlashCard Pro

Overview

FlashCard Pro is an application designed for students of all fields who prefer to use a desktop app for managing flashcards, as well as teachers who would like to provide resources (in the form of custom flashcard decks) to support their students’ learning.

It has a GUI but most of the user interactions happen using a CLI (Command Line Interface). The GUI is to support the user if he/she prefers using the GUI to interact with FlashCard Pro.

Summary of contributions

  • Major enhancement: expanded the functionality and type of FlashCards.

    • Worked on parsing and validation of inputs for create, add (Front and Back flash card and Multiple Choice flash card), edit (Front and Back flash card and Multiple Choice flash card), delete CLI functionality.

    • Allows the user to assign priorities to each flash card.

    • Allows the creation of a random set of flash cards for the test function. The set of flash cards created for the test will have a proportion of high priority and low priority cards.

    • Expanded the cards to support Multiple Choice cards on top of ordinary Front and Back flash cards.

    • Added support for shuffling choices of Multiple Choice cards when displaying the Multiple Choice cards in test mode.

    • Wrote JUnit tests for MultipleChoiceCard and FrontBackCard.

  • Justification:

    • This feature allows the user to explore multiple modes of learning using flash cards.

    • The priorities also allow the user to customize his/her own test deck set, so that he/she can vary the difficulty of the test.

    • The creation of test subset also allows the user to take the test with a different set of cards each time, allowing the user to learn more from each test.

    • The shuffling allows the user to take the test of Multiple Choice Cards with greater learning value since the options are changed.

  • Highlights:

    • This enhancement allowed the user to have more flexibility in exploring various types of flash cards to support the usage of the test function.

    • In addition, this feature is challenging because it requires in-depth analysis and design of the Regex parser to determine which card type (Front and Back card or Multiple Choice card) is created.

    • Also, this feature is tightly related to other components, such as:

      • In test mode, the cards need to be designed such that the display and logic for test is coherent with the designs of multiple flash cards.

  • Code contributed: [Functional code][Test code]

  • Other contributions:

    • Project management:

    • Testing:

      • Did product testing to ensure that the command parsing were accurate, and various system integration tests.

      • Debugged certain command related bugs: #294, #333, #318, #355, #358

      • Alerted team about bugs found in issue tracker: #146, #99, #109

    • Enhancements to existing features:

      • Wrote the regular expression parsing, user input validation, and command execution for:

        • add Front and Back, Multiple Choice Card addition.

        • edit Front and Back Card, Multiple Choice Card.

        • delete Flash card and deck.

    • Documentation:

    • Community:

      • PRs reviewed (with non-trivial review comments): #205, #91

      • Contributed to forum discussions (examples: #137)

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.

Create new empty deck: create

Creates an empty deck in FlashCard Pro library.

Format: `create deck/DECK_NAME.

Note :

  • The DECK_NAME must be unique and no deck that exist in FlashCard Pro library should have the same name of DECK_NAME.

  • If there is another deck with the same name DECK_NAME, there will be an error message and the empty deck will not be created.

Examples:

  • create deck/german

Creates a new empty deck named german.

Add new Front Back card or Multiple Choice Card to deck: add

Adds a Front Back card or Multiple Choice Card in a deck of FlashCard Pro library.

Format: add deck/DECK_NAME [priority/PRIORITY_LEVEL] front/FRONT_TEXT back/BACK_TEXT [choice/CHOICE_TEXT]…​

  • The DECK_NAME must be a name of an existing deck in FlashCard Pro.

    • If there is not deck with the name of DECK_NAME, there will be an error message and the card will not be created.

  • When entering the PRIORITY_LEVEL, there are only 2 valid choices HIGH and LOW. Refer to the table below to know how to use the PRIORITY_LEVEL:

Priority Value Input for PRIORITY_LEVEL

High

You find the card important and want it to be tested more often

HIGH

Low

You find the card less important and want it to be tested less often

LOW

  • If no priority/ parameter is entered, then the default priority level is LOW.

  • If you enter any input other than HIGH or LOW, there will be an error message and the card will not be created.

    • FRONT_TEXT is the question that you wish to see in the flashcard.

    • To create a Front Back card,

  • BACK_TEXT is the answer of the Front Back flashcard.

  • No choice should be entered under choice/.

    • To create a Multiple Choice card,

  • the BACK_TEXT parameter should correspond to choice entered by the user, using the order of choice entered and should be a integer value from 1, 2, …​., Number of choices entered.

  • To create a Multiple Choice card, there should be at least 2 choice/ parameters entered.

  • If there are only 1 choice/ parameters entered, there will be an error message and the card will not be created.

Examples:

  • add deck/german front/hello back/moin moin

Creates a new Front Back card in deck german.

  • add deck/german front/hello back/1 choice/hello choice/bye choice/zzz

Creates a new Multiple Choice card in deck german, with the answer as the first choice/ parameter, hello.

Contributions to the Developer Guide

Given below are sections I contributed to the Developer Guide. They showcase my ability to write technical documentation and the technical depth of my contributions to the project.

FlashCard:

  • There are 3 types of cards used by our App, the JavascriptCard, FrontBackCard and MultipleChoiceCard.

cards class diagram
  • JavascriptCard and FrontBackCard implements from FlashCard, an interface class.

  • MultipleChoiceCard inherits from FrontBackCard.

  • The interface class FlashCard also implements JsonInterface class to allow loading and saving to Json format.

Refer to the activity diagram below to see the process of creating a MultipleChoiceCard:

MultipleChoiceCardCreation

For the MultipleChoiceCard, the choices provided by the user must be unique, i.e. there cannot be any duplicate in the choices provided. If a duplicate choice is detected, then the creation of the MultipleChoiceCard will not be successful.

FlashCard Priority

Each FlashCard has an associated priority level, which the user can indicate his/her value of the importance of the card.

The priority levels are described below:

Priority Value Intended Action

HIGH_PRIORITY

10

Valued as important by user, should be tested more often

LOW_PRIORITY

1

Valued, but less important by user, should be tested less often

The sequence diagram below shows how the ExamRunner component can use the createSubsetForTest() method in the Deck and make use of the priorities associated with the FlashCards to create a test that emphasises the FlashCards that the user deems as important.

PriorityFlashCardTestSetSequenceDiagram
  • Step 1: Constructor of ExamRunner is called.

  • Step 2: In the constructor of ExamRunner, a method call is made to Deck to create a subset of cards for test.

  • Step 3: If there are less than 10 cards in Deck, return all the cards.

  • Step 4 - 10: Return a set of cards with both HIGH_PRIORITY and LOW_PRIORITY cards, which the proportion is weighted at 60% to 40% ratio respectively.

  • Step 11: Deck returns the test set to ExamRunner.

Design Considerations

Aspect: how to store and select the HIGH_PRIORITY and LOW_PRIORITY cards

  • Alternative 1: Use a priority queue to store the cards

    • Pros: Allows the user to test the cards according to HIGH_PRIORITY cards first, effectively choosing only HIGH_PRIORITY cards first, then LOW_PRIORITY cards.

    • Cons: Certain LOW_PRIORITY cards may not be tested if the test set size is smaller than the number of HIGH_PRIORITY cards

    • Cons: FlashCard Pro cannot have the flexibility of letting the user select the number of LOW_PRIORITY cards in the test set.

  • Alternative 2: (Current Choice) Maintain two lists of cards, HIGH_PRIORITY and LOW_PRIORITY cards

    • Pros: Can control the ratio of HIGH_PRIORITY and LOW_PRIORITY cards in the test set created

    • Pros: Have the flexibility to randomize the card order and choose a random set each time

    • Cons: FlashCard Pro cannot have the flexibility of letting users assign more than 2 priority levels

Use case: Timed Test with a deck of Multiple Choice Cards

MSS

  1. User enters command to start test on a deck.

    (System creates a test subset)

  2. System gets the deck the user wants to test on.

  3. System starts test session.

  4. System randomises the choice ordering.

  5. System displays the front of card and choices.

  6. User enters the choice of correct answer.

  7. System evaluates the answer.

  8. System shows the correctness of the answer.

  9. System moves to next card.

    Steps 4-9 are repeated until there are no more cards in the test set.

    Use case ends.

Extensions

  • 1a. System does not find a deck with the deck name specified by the user

    • 1a1. System tells user that there is no deck with specified name.

    • 1a2. System exits test creation.

      Use case ends.

  • 1b. System has no decks in library.

    • 1b1. System tells user that there are no decks in the library.

    • 1b2. System exits test creation.

      Use case ends.

  • 6a. User enters an invalid choice.

    • 6a1. System checks if choice is valid.

    • 6a2. System tells User that choice entered is invalid.

      Steps 6a1-6a3 repeats 3 times.

    • 6a4. User enters invalid choice for 4th time.

    • 6a5. System receives invalid choice for 4th time.

    • 6a6. System terminates test.

    • 6a7. System tells User that test has terminated due to incorrect inputs.

      Use case ends.

Use case: Creating a Multiple Choice Card

MSS

  1. User enters command to create a MCQ Card to a deck.

  2. System starts MCQ Card creation.

  3. System stores MCQ card in deck.

    Use case ends.

Extension

  • 1a. User enters duplicated choices.

    • 1a1. System detects duplicated choices in choices provided by user.

    • 1a2. System tells User that there are duplicates in choices provided.

    • 1a3. System ends card creation.

      Use case ends.