SM2 Algorithm Visualizer

Result (days)

QualityRun 1Run 2Run 3Run 4Run 5Run 6Run 7
0-2-------
3-------
4-------
5-------

SM2 Algorithm Calculations

1. Update E-Factor:
  • The new ease factor is calculated as follows:
    • newEFactor = currentEFactor + (0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02)) + (quality === 5 ? easyBonus : 0).
2. Update Interval:
  • If the quality rating is less than 3, then set the new interval to lapseInterval and reset the number of repetitions to 0.
  • If the number of repetitions is 0, then set the new interval to newInterval.
  • If the number of repetitions is 1, then set the new interval to hardInterval.
  • Otherwise, calculate the new interval as the minimum of the rounded product of the current interval and the ease factor, or the maximum interval of 90 days.
3. Calculate Next Review Date:
  • The next review date is determined by adding the adjusted interval (in days) to the current date:
    • nextReviewDate = currentDate + (adjustedInterval * 24 * 60 * 60 * 1000) milliseconds.
4. Maximum Allowed Next Review Date:
  • The maximum allowed next review date is set to 120 days from the current date:
    • maxNextReviewDate = currentDate + (120 * 24 * 60 * 60 * 1000) milliseconds.
5. Final Next Review Date:
  • The final next review date is the earlier of the calculated next review date and the maximum allowed next review date:
    • finalNextReviewDate = min(nextReviewDate, maxNextReviewDate).