public DateTime NextReview(IReviewItem item)
        {
            var now = _clock.Now();
            if(item.CorrectReviewStreak == 0)
                return now;
            if(item.CorrectReviewStreak == 1)
                return item.ReviewDate.AddDays(6);

            var easinessFactor = DifficultyRatingToEasinessFactor(item.DifficultyRating.Percentage);
            var daysSincePreviousReview = (item.ReviewDate - item.PreviousCorrectReview).Days;
            var daysUntilNextReview = (daysSincePreviousReview - 1) * easinessFactor;
            return item.ReviewDate.AddDays(daysUntilNextReview);
        }
Beispiel #2
0
        public DateTime NextReview(IReviewItem item)
        {
            var now = _clock.Now();

            if (item.CorrectReviewStreak == 0)
            {
                return(now);
            }
            if (item.CorrectReviewStreak == 1)
            {
                return(item.ReviewDate.AddDays(6));
            }

            var easinessFactor          = DifficultyRatingToEasinessFactor(item.DifficultyRating.Percentage);
            var daysSincePreviousReview = (item.ReviewDate - item.PreviousCorrectReview).Days;
            var daysUntilNextReview     = (daysSincePreviousReview - 1) * easinessFactor;

            return(item.ReviewDate.AddDays(daysUntilNextReview));
        }
        public DifficultyRating AdjustDifficulty(IReviewItem item, ReviewOutcome outcome)
        {
            //EF':=EF+(0.1-(5-q)*(0.08+(5-q)*0.02))
            //where:
            //EF' - new value of the E-Factor,
            //EF - old value of the E-Factor,
            //q - quality of the response in the 0-3 grade scale.
            //If EF is less than 1.3 then let EF be 1.3.

            var currentEasinessFactor = DifficultyRatingToEasinessFactor(item.DifficultyRating.Percentage);
            var newEasinessFactor = currentEasinessFactor + (0.1 - (3 - (int)outcome)*(0.08 + (3 - (int)outcome)*0.02));
            var newDifficultyRating = EasinessFactorToDifficultyRating(newEasinessFactor);

            if (newDifficultyRating > 100)
                newDifficultyRating = 100;
            if (newDifficultyRating < 0)
                newDifficultyRating = 0;

            return new DifficultyRating(newDifficultyRating);
        }
Beispiel #4
0
        public DifficultyRating AdjustDifficulty(IReviewItem item, ReviewOutcome outcome)
        {
            //EF':=EF+(0.1-(5-q)*(0.08+(5-q)*0.02))
            //where:
            //EF' - new value of the E-Factor,
            //EF - old value of the E-Factor,
            //q - quality of the response in the 0-3 grade scale.
            //If EF is less than 1.3 then let EF be 1.3.

            var currentEasinessFactor = DifficultyRatingToEasinessFactor(item.DifficultyRating.Percentage);
            var newEasinessFactor     = currentEasinessFactor + (0.1 - (3 - (int)outcome) * (0.08 + (3 - (int)outcome) * 0.02));
            var newDifficultyRating   = EasinessFactorToDifficultyRating(newEasinessFactor);

            if (newDifficultyRating > 100)
            {
                newDifficultyRating = 100;
            }
            if (newDifficultyRating < 0)
            {
                newDifficultyRating = 0;
            }

            return(new DifficultyRating(newDifficultyRating));
        }
 private static bool IsNewItem(IReviewItem item)
 {
     return(item.ReviewDate == DateTime.MinValue);
 }
        public bool IsDue(IReviewItem item)
        {
            var nextReview = ReviewStrategy.NextReview(item);

            return(nextReview <= Clock.Now());
        }
 public DateTime NextReview(IReviewItem item)
 {
     return DateTime.Now;
 }
 public DifficultyRating AdjustDifficulty(IReviewItem item, ReviewOutcome outcome)
 {
     return DifficultyRating.Easiest;
 }
 public DateTime NextReview(IReviewItem item)
 {
     return(DateTime.Now);
 }
 public DifficultyRating AdjustDifficulty(IReviewItem item, ReviewOutcome outcome)
 {
     return(DifficultyRating.Easiest);
 }