<commit_before># ActsAsLearnable

[![Build Status](https://travis-ci.org/itsdn/acts_as_learnable.svg?branch=master)](https://travis-ci.org/itsdn/acts_as_learnable)

ActsAsLearnable is a Ruby gem for ActiveRecord models. It provides a simple way to create flashcards in your app. It automatically schedules flashcards for review depending on recall quality (1 to 5). You can easily create a Spaced Repetition System (SRS) using this gem. Flashcards are scheduled using SuperMemo 2 algorithm.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'acts_as_learnable'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install acts_as_learnable

Create and run migrations (will add flashcard fields if table already exists):

    $ rails generate flashcard MODEL
    $ rake db:migrate

## Usage

Within your model call `acts_as_learnable` method:

```ruby
class Flashcard < ActiveRecord::Base<commit_msg>Add more badge shields [ci skip]<commit_after># ActsAsLearnable

[![Build Status](http://img.shields.io/travis/itsdn/acts_as_learnable.svg?style=flat)](https://travis-ci.org/itsdn/acts_as_learnable)
[![Gem Version](http://img.shields.io/gem/v/acts_as_learnable.svg?style=flat&color=brightgreen)](https://rubygems.org/gems/acts_as_learnable)
[![License](http://img.shields.io/:license-mit-blue.svg?style=flat)](http://itsdn.mit-license.org)


ActsAsLearnable is a Ruby gem for ActiveRecord models. It provides a simple way to create flashcards in your app. It automatically schedules flashcards for review depending on recall quality (1 to 5). You can easily create a Spaced Repetition System (SRS) using this gem. Flashcards are scheduled using SuperMemo 2 algorithm.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'acts_as_learnable'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install acts_as_learnable

Create and run migrations (will add flashcard fields if table already exists):

    $ rails generate flashcard MODEL
    $ rake db:migrate

## Usage

Within your model call `acts_as_learnable` method:

```ruby
class Flashcard < ActiveRecord::Base
{'fraction_non_alphanumeric': 0.0934752429430819, 'fraction_numerical': 0.002776492364645997, 'mean_word_length': 4.988919667590028, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '549721', 'n_tokens_mistral': 694, 'n_tokens_neox': 646, 'n_words': 221}