Update learn.php
This commit is contained in:
@@ -20,8 +20,24 @@ if (!$data) {
|
|||||||
die('Geen lijst');
|
die('Geen lijst');
|
||||||
}
|
}
|
||||||
|
|
||||||
// kies woord (simpel: random)
|
// kies woord
|
||||||
$word = $data['words'][array_rand($data['words'])];
|
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>
|
<!DOCTYPE html>
|
||||||
|
|||||||
Reference in New Issue
Block a user