fix bug where survey could be completed early
This commit is contained in:
parent
113423e893
commit
5cf1046c8d
|
@ -80,11 +80,18 @@ function serve(forminfo::Dict)
|
||||||
uid_str = string(uid, base=UID_ENCBASE)
|
uid_str = string(uid, base=UID_ENCBASE)
|
||||||
page = parse(Int, forminfo[:page])
|
page = parse(Int, forminfo[:page])
|
||||||
if page > length(SURVEY)
|
if page > length(SURVEY)
|
||||||
@info SURVEY => INPROGRESS[uid]
|
# Verify the survey is /actually/ complete,
|
||||||
INPROGRESS[uid].completed = now()
|
# and go to response's current page if not.
|
||||||
save!(INPROGRESS[uid], Symbol[])
|
if INPROGRESS[uid].page > length(SURVEY)
|
||||||
delete!(INPROGRESS, uid)
|
@info SURVEY => INPROGRESS[uid]
|
||||||
completed(uid)
|
INPROGRESS[uid].completed = now()
|
||||||
|
save!(INPROGRESS[uid], Symbol[])
|
||||||
|
delete!(INPROGRESS, uid)
|
||||||
|
completed(uid)
|
||||||
|
else
|
||||||
|
forminfo[:page] = string(INPROGRESS[uid].page)
|
||||||
|
serve(forminfo)
|
||||||
|
end
|
||||||
else
|
else
|
||||||
res = html(:surveys, :survey, layout=:base,
|
res = html(:surveys, :survey, layout=:base,
|
||||||
uid=uid_str, survey=SURVEY,
|
uid=uid_str, survey=SURVEY,
|
||||||
|
|
Loading…
Reference in New Issue