Update learn.php

This commit is contained in:
2026-06-15 12:05:38 +02:00
parent 7bea9b91a1
commit 1ada360eb0
+18 -2
View File
@@ -20,8 +20,24 @@ if (!$data) {
die('Geen lijst');
}
// kies woord (simpel: random)
$word = $data['words'][array_rand($data['words'])];
// kies woord
require_once 'includes/srs_queue.php';
$words = $data['words'];
$words = sortDueWords($words);
$today = date('Y-m-d');
$due = array_filter($words, function ($w) use ($today) {
return !isset($w['nextReview']) || $w['nextReview'] <= $today;
});
if (count($due) > 0) {
$word = array_values($due)[0];
} else {
$word = $words[0];
}
?>
<!DOCTYPE html>