lib/jldrill/model/Quiz/Schedule.rb in jldrill-0.5.1.7 vs lib/jldrill/model/Quiz/Schedule.rb in jldrill-0.6.0.1

- old
+ new

@@ -1,5 +1,6 @@ +# encoding: utf-8 require 'jldrill/model/Duration' module JLDrill # Calculates and stores the Schedule information for an item @@ -138,11 +139,11 @@ # Returns a +-10% random variation in the interval. # This smooths out the distribution of items and makes # it so that similar items aren't always together. def randomVariation(interval) # 10% - rand(20%) = +- 10% - (interval / 10) - rand(interval / 5) + ((interval.to_f / 10) - rand(interval.to_f / 5)).to_i end # This is the interval the item will have when it it first # promoted into the Review Set. # @@ -202,11 +203,12 @@ # for the next review. # # Calculates the interval for the item. For newly # promoted items, the schedule will be the interval based on # difficulty. - # For the rest it is twice the actual amount of time since - # the last review. + # For the rest it is based on the actual amount of time since + # the last review. A reducing backoff algorithm computes the + # multiple. # To avoid increasing the gap too much, a maximum of # twice the previous duration plus 25% is used. def calculateInterval interval = intervalFromDifficulty(difficulty) # If it is scheduled, then that means it isn't