diff --git a/includes/functions.php b/includes/functions.php index d7ee59f..3ed1a4a 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -68,3 +68,17 @@ function listPath( . slug($list) . '.json'; } + +function calculateNextInterval(array $word, bool $correct): int +{ + $correctCount = $word['correct'] ?? 0; + + if (!$correct) { + return 1; + } + + // gecontroleerde groei (SM-lite) + $interval = 1 + ($correctCount * 2); + + return min(30, $interval); +} \ No newline at end of file