Example #1
0
 def set_next_practice(self, rating):
     if not 0 <= rating <= 5:
         raise ValidationError("Rating must be in range from 1 to 5")
     days, ef = interval(self.times_practiced, rating, self.easy_factor)
     self.next_practice = datetime.today() + timedelta(days=days)
     self.times_practiced += 1
     self.easy_factor = ef
Example #2
0
 def set_next_practice(self, rating):
     if not 0 <= rating <= 5:
         raise ValidationError("Rating must be in range from 1 to 5")
     days, ef = interval(self.times_practiced, rating,
                         self.easy_factor)
     self.next_practice = datetime.today() + timedelta(days=days)
     self.times_practiced += 1
     self.easy_factor = ef
Example #3
0
 def set_next_practice(self, rating):
     days, ef = interval(self.times_practiced, rating, self.easy_factor)
     self.next_practice = date.today() + timedelta(days=days)
     self.times_practiced += 1
     self.easy_factor = ef