From b208fddabbde7beebd05ff0b3d7ca598bcd62045 Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Wed, 23 Mar 2016 15:56:45 -0700 Subject: [PATCH] Fix #3484 --- app/models/LevelSession.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/models/LevelSession.coffee b/app/models/LevelSession.coffee index 0865d2e31..63621fa66 100644 --- a/app/models/LevelSession.coffee +++ b/app/models/LevelSession.coffee @@ -67,7 +67,13 @@ module.exports = class LevelSession extends CocoModel return 0 unless last = state.lastUnsuccessfulSubmissionTime last = new Date(last) if _.isString last # Wait at least this long before allowing submit button active again. - (last - new Date()) + 22 * 60 * 60 * 1000 + wait = (last - new Date()) + 22 * 60 * 60 * 1000 + if wait > 24 * 60 * 60 * 1000 + # System clock must've gotten busted; max out at one day's wait. + wait = 24 * 60 * 60 * 1000 + state.lastUnsuccessfulSubmissionTime = new Date() + @set 'state', state + wait recordScores: (scores, level) -> state = @get 'state'