Code Monkey home page Code Monkey logo

nickhnsn / facharbeit-spaced-repetition Goto Github PK

View Code? Open in Web Editor NEW
22.0 1.0 0.0 35.27 MB

A Java Spaced Repetition API implementing various spaced repetition algorithms: Leitner's system, SuperMemo SM-2 algorithm and the Free Spaced Repetition Scheduler (FSRS)

Home Page: https://facharbeit.nickhansen.de

License: GNU General Public License v3.0

Java 100.00%
active-recall anki education facharbeit flashcards forgetting-curve leitner leitner-method leitnerbox sm2

facharbeit-spaced-repetition's Introduction

Java Spaced Repetition API

CodeFactor

Java Spaced Repetition API

Java Spaced Repetition API with an example for a spaced repetition software prototype
Releases · Javadoc

About the project

Language information

This GitHub repository is part of my German school paper in Computer Science (German "Facharbeit im Fach Informatik"). As a part of my school paper, I implemented an API for three spaced repetition algorithms which can be used by any spaced repetition software. An example for the productive usage of the API can be found in the implemented software.

API

The API contains the SuperMemo SM-2 algorithm, also an algorithm according to Sebastian Leitner's system and the Free Spaced Repetition Scheduler (FSRS).

Download

Feel free to use the API in your own software:

Maven

Add the repository in your pom.xml to the repositories:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Add the dependency in your pom.xml to the dependencies:

<dependency>
    <groupId>com.github.nickhnsn.facharbeit-spaced-repetition</groupId>
    <artifactId>spaced-repetition-api</artifactId>
    <version>v1.0.0</version>
</dependency>

Gradle

Add it in your root build.gradle at the end of the repositories:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency to your build.gradle:

dependencies {
    implementation 'com.github.nickhnsn.facharbeit-spaced-repetition:spaced-repetition-api:v1.0.0'
}

Usage

The API uses a builder system with a fluent interface since the algorithms have many parameters. This system also makes it possible to leave algorithm parameters out and fall back to their default values:

// Create the algorithm object
SM2Algorithm sm2 = SM2Algorithm.builder()
                .quality(3)
                .repetitions(4)
                .easinessFactor(1.6F)
                .interval(5)
                .build();

// Calculate the outputs based on the inputs from object creation
SM2AlgorithmResult result = sm2.calc();

Examples for the other algorithms can be found in the SpacedRepetitionAPI.java. The method AlgorithmResult#calc returns an object with multiple getters, namely the algorithm outputs. These outputs need to be stored in some way since they are required for the next algorithm usage. Suggested database structure (in this case for MySQL):

database structure

Software

The software is a prototype/example for a Spaced Repetition Software in which this API is used. You can have a look at it for an inspiration in case you want to use this API or you are developing an own software.

Setup

A Java Version >= 8 is required as well as an active MySQL instance.

  1. Build the software: mvn package
  2. Configuration of the database connection: Edit the config.properties in the project and build it with mvn package or create a config.properties file in the same folder the software is executed.
  3. Execute the software: java -jar spaced-repetition-software-1.0-SNAPSHOT.jar

Screenshots

Spaced Repetition Software ManageView Spaced Repetition Software LearnView Spaced Repetition Software LearnView_SM2

License

This project is licensed unter the terms of the GNU General Public License v3.0

Contact

If you have any questions about this project, please feel free to create an issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.