https://github.com/dankimio/acts_as_learnable
A Ruby gem to create flashcards in your app
https://github.com/dankimio/acts_as_learnable
flashcards ruby
Last synced: 11 months ago
JSON representation
A Ruby gem to create flashcards in your app
- Host: GitHub
- URL: https://github.com/dankimio/acts_as_learnable
- Owner: dankimio
- License: mit
- Created: 2015-03-09T22:32:52.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2022-07-08T23:54:13.000Z (almost 4 years ago)
- Last Synced: 2024-12-03T01:09:19.433Z (over 1 year ago)
- Topics: flashcards, ruby
- Language: Ruby
- Homepage:
- Size: 22.5 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# 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. ActsAsLearnable uses SuperMemo 2 algorithm.
Consider using [repetition](https://github.com/dankimio/repetition), a rewrite of this gem with many improvements.
## 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
acts_as_learnable
end
```
It will automatically extend your class with all necessary methods.
Then you can review flashcards:
```ruby
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
1. Fork it ( https://github.com/dankimio/acts_as_learnable/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request