Commit 5a36efa8974de146a51b973074a5df47238405ce

Authored by Andrew Buss
Exists in master

Merge branch 'master' of git.ucsd.edu:110swag/flashy-backend

Showing 1 changed file Side-by-side Diff

flashcards/models.py View file @ 5a36efa
... ... @@ -226,8 +226,8 @@
226 226 if self.last_interval == 1:
227 227 self.last_interval = 6
228 228 else:
229   - self.last_response_factor = min(1.3, self.last_response_factor + (0.1 - (5 - q) * (0.08 + (5 - q) * 0.02)))
230   - self.last_interval += (now() - self.next_review).days
  229 + self.last_response_factor = max(1.3, self.last_response_factor + (0.1 - (5 - q) * (0.08 + (5 - q) * 0.02)))
  230 + self.last_interval = max(1, self.last_interval + (now() - self.next_review).days)
231 231 self.last_interval = int(round(self.last_interval * self.last_response_factor))
232 232 self.next_review = user_flashcard_quiz.when + timedelta(days=self.last_interval)
233 233 self.save()