~kevang/mnemosyne-proj/grade-shortcuts-improvements

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne/libmnemosyne/schedulers/SM2_mnemosyne.py

  • Committer: Peter Bienstman
  • Date: 2012-05-30 19:19:38 UTC
  • mto: This revision was merged to the branch mainline in revision 1501.
  • Revision ID: peter.bienstman@ugent.be-20120530191938-0gcfl4u0rh8n9ve4
Windows sound system rework.

Show diffs side-by-side

added added

removed removed

Lines of Context:
409
409
        # duplicate.
410
410
        return len(self._card_ids_in_queue) >= 3
411
411
 
 
412
    def interval_multiplication_factor(self, card, interval):
 
413
 
 
414
        """Allow plugin to easily scale the scheduled interval."""
 
415
 
 
416
        return 1.0
 
417
 
412
418
    def grade_answer(self, card, new_grade, dry_run=False):
413
419
        # The dry run mode is typically used to determine the intervals
414
420
        # for the different grades, so we don't want any side effects
519
525
                # that actual_interval becomes 0.
520
526
                if new_interval < DAY:
521
527
                    new_interval = DAY
 
528
        # Allow plugins to modify new_interval by multiplying it.
 
529
        new_interval *= self.interval_multiplication_factor(card, new_interval)
522
530
        new_interval = int(new_interval)
523
531
        # When doing a dry run, stop here and return the scheduled interval.
524
532
        if dry_run: