DKL9 GitList
Repositories
DKL9 home
memoire
Code
Commits
Branches
Tags
Search
Tree:
b08a881
Branches
Tags
master
memoire
review.lua
Add success- and failure-counters to memoire records
John Smith
commited
b08a881
at 2021-329 15:52:17
review.lua
Blame
History
Raw
--[[ stuff to help with the review mechanics ]] --[[ manipulates `Prompt` `prompt` in-place as it should be when reviewed at timestamp `revtime` with review success `revsucc` ]] local function update(prompt, revtime, revsucc) if revsucc then prompt.delay = 2 * (revtime - prompt.time) prompt.succ = prompt.succ + 1 else prompt.delay = 64 prompt.fail = prompt.fail + 1 end prompt.time = revtime end --[[ checks (returns boolean) if `Prompt` `prompt` should be reviewed now ]] local function should(prompt) return os.time() - prompt.time >= prompt.delay end return { update = update, should = should }