Socket
Book a DemoInstallSign in
Socket

acts_as_learnable

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acts_as_learnable

0.2.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

ActsAsLearnable

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:

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:

class Flashcard < ActiveRecord::Base
  acts_as_learnable
end

It will automatically extend your class with all necessary methods.

Then you can review flashcards:

card = Flashcard.create
card.review(4)   # => Recall quality from 1 (bad) to 5 (perfect)
card.due_today?  # => false
card.due         # => 2015-03-11
card.studied_at  # => 2015-03-10
card.interval    # => 1
card.repetitions # => 1

Contributing

  • Fork it ( https://github.com/dankimio/acts_as_learnable/fork )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create a new Pull Request

FAQs

Package last updated on 08 Jul 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.