Skip to content

SairaPatel/FlashcardApp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Flashcard App

Background and Inspiration

This is a simple flashcard desktop application based on a previous VB project that I made to help with studying for A-levels.

This application was designed to suit my own preferred study technique of writing long/detailed flashcards and then studying them by jotting down my answers (as opposed to the traditional "think of/say the answer to yourself" method).

After creating and using my initial VB application for a couple of years, I discovered the flashcard app/website Anki and I have taken some inspiration from Anki to design this version of my application. Specifically, my old application only organised cards by assigning each one into a set. However, Anki has the additionaly ability to assign multiple tags to each card for more complex filtering.

About

This is a Java Swing application which uses MySQL to store a database of flashcards. It allows the user to create, edit and study their own flashcards.

Edit

For organisation, each flashcard belongs to a set and can also have multiple tags.

Edit Card Properties Panel Edit Card Content Panel

Home

A user can filter their flashcard database by set, tag and keyword before studying them. The user can choose to study a group of flashcards in a random order or in order of their knowledge ratings.

Home Page with All Cards Home Page with Filtered Cards

Study

During study mode, the user can view the card's front content (i.e. questions/prompts) and has a space to type their thoughts/answers.

image

They can then click to reveal the card's back contents (i.e. answers/info).

image

After studying each card, the user can rate their knowledge of the card which will be stored for next time.

Implementation

Database

The database consists of 2 relations: Cards and CardTags.

Cards stores all the main properties of a flashcard (Title, Set, Front, Back...).

CREATE TABLE Cards (
	CardID int NOT NULL AUTO_INCREMENT,
	Title varchar(255) DEFAULT 'Untitled',
	CardSet varchar(255) DEFAULT 'Set 1',
	Front varchar(3000) DEFAULT '',
	Back varchar(6000) DEFAULT '',
	Rating float(3) DEFAULT 0,
	PRIMARY KEY (CardID)
	
	);

CardTags is used to stores pairs of Cards and Tag names.

CREATE TABLE CardTags(
	CardID int,
	Tag varchar(255),
	PRIMARY KEY(CardID, Tag),
	FOREIGN KEY (CardID) REFERENCES Cards(CardID) ON DELETE CASCADE
);

When I first designed and created the database, I included a separate relation, Tags, which the CardTags relation referenced, rather than simply storing the TagName in CardTags. I did this with the idea of potentially atatching other attributes to a Tag in the future (such as a Tag Description or Tag Groups). However, I later decided that these ideas were unncessary and hence restructured the database to remove the redundant Tag relation.

Classes

  • App
    • The root JFrame for the application
    • Uses CardLayout to display/switch between the HomePage, EditCardPage and LearnPage panels
  • HomePage
    • JPanel that contains controls for filtering and viewing cards
    • Handles navigation to the Edit/Learn pages as well as deletion and insertion of cards
  • EditCardPage
    • JPanel that contains controls for editing a card. Includes instances of:
      • EditCardContentPanel
        • JPanel with controls for editing the front and back of the card
      • EditCardPropertiesPanel
        • JPanel with controls for editing the general properties of a card and it's tags
  • LearnPage
    • JPanel with controls for studying and rating cards. Includes an instance of:
      • LearnCardPanel
        • JPanel with controls for viewing and learning a single card
  • Controller
    • Class that contains attributes and methods for managing the overall flow of data in the application
    • Maintains a list of the current Cards that are being viewed/learned/edited:
      • Card
        • Class that models a Flashcard, with attributes for each of it's properties
    • Accesses the database using:
      • DB
        • Class with methods for querying the database

Possible Future Changes

  • Add ability to change filter mode from using AND to OR (at the moment the default is AND. i.e. all filters must apply for a card to be part of the results)
  • Changes to knowledge rating:
    • Display the rating of each card on the home page
    • Add an additional filter for knowledge rating
    • Maybe colour code ratings/add a progress bar to allow more visualisation of the knowledge level/progress of a card
    • Add a progress bar/score to indicate the collective knowledge level of the currently displayed/filtered cards
    • Change the formula for ratings to consider the time since the card was last studied (rated)

About

Flashcard Desktop Application

Resources

Stars

Watchers

Forks

Languages