DKL9 GitList
Repositories
DKL9 home
memoire
Code
Commits
Branches
Tags
Search
Tree:
7540cf0
Branches
Tags
master
memoire
review.lua
Reduce review delay after failure
John Smith
commited
7540cf0
at 2021-347 21:21:36
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 = 30 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 }