Update learn.php
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user