public void ProcessResponse_Should_ResetIntervalForBadAnswer(ResponseQuality qual) { var interval = RepetitionInterval.FromValues(4, 2.5f); interval.ProcessResponse(qual); interval.Interval.Should().Be(1); }
private float CalculateUpdatedEasinessFactor(ResponseQuality responseQuality) { int q = (int)responseQuality; float updated = EasinessFactor - 0.8f + 0.28f * q - 0.02f * q * q; if (updated < 1.3f) { updated = 1.3f; } return(updated); }
public void ProcessResponse_ShouldNot_UpdateStartBadAnswer(ResponseQuality badQuality) { var interval = RepetitionInterval.NewDefault(); interval.ProcessResponse(badQuality); interval.ProcessResponse(badQuality); interval.ProcessResponse(badQuality); interval.Interval.Should().Be(0); interval.ProcessResponse(ResponseQuality.CorrectPerfect); interval.ProcessResponse(ResponseQuality.CorrectPerfect); interval.Interval.Should().Be(0); }
private void TryIncrementInterval(ResponseQuality responseQuality) { if (responseQuality < ResponseQuality.CorrectDifficult) { if (_interval < 0) { return; } _interval = 1; } else { _interval++; } }
public void ProcessResponse(ResponseQuality responseQuality) { TryIncrementInterval(responseQuality); EasinessFactor = CalculateUpdatedEasinessFactor(responseQuality); }