Description:
fixed timeout bug for wrong submission (thanks to @dtinth), and js bugs occurring in IE
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r232:f00dec11b375 - - 2 files changed: 6 inserted, 2 deleted
@@ -279,7 +279,7 | |||||
|
279 | if assignment == nil |
|
279 | if assignment == nil |
|
280 | timeout = nil |
|
280 | timeout = nil |
|
281 | else |
|
281 | else |
|
282 | - if assignment.expired? |
|
282 | + if (assignment.expired?) or (assignment.submitted) |
|
283 | timeout = 0 |
|
283 | timeout = 0 |
|
284 | else |
|
284 | else |
|
285 | timeout = assignment.created_at + TEST_ASSIGNMENT_EXPIRATION_DURATION - Time.new.gmtime |
|
285 | timeout = assignment.created_at + TEST_ASSIGNMENT_EXPIRATION_DURATION - Time.new.gmtime |
@@ -8,6 +8,8 | |||||
|
8 |
|
8 | ||
|
9 | updateProblemMessages: function() { |
|
9 | updateProblemMessages: function() { |
|
10 | CodejomTimeout.timeouts.each(function(data) { |
|
10 | CodejomTimeout.timeouts.each(function(data) { |
|
|
11 | + if(data==null) | ||
|
|
12 | + return; | ||
|
11 | if(data.timeout==null) { |
|
13 | if(data.timeout==null) { |
|
12 | $("problem-submission-form-" + data.problem).hide(); |
|
14 | $("problem-submission-form-" + data.problem).hide(); |
|
13 | } else if(data.timeout==0) { |
|
15 | } else if(data.timeout==0) { |
@@ -26,6 +28,8 | |||||
|
26 | var timeElapsed = ((new Date()).getTime() - CodejomTimeout.timeStarted)/1000; |
|
28 | var timeElapsed = ((new Date()).getTime() - CodejomTimeout.timeStarted)/1000; |
|
27 | // update timeout info |
|
29 | // update timeout info |
|
28 | CodejomTimeout.timeouts.each(function(data) { |
|
30 | CodejomTimeout.timeouts.each(function(data) { |
|
|
31 | + if(data==null) | ||
|
|
32 | + return; | ||
|
29 | if(data.timeout > timeElapsed) { |
|
33 | if(data.timeout > timeElapsed) { |
|
30 | data.timeout -= timeElapsed; |
|
34 | data.timeout -= timeElapsed; |
|
31 | } else if(data.timeout > 0) { |
|
35 | } else if(data.timeout > 0) { |
@@ -46,7 +50,7 | |||||
|
46 |
|
50 | ||
|
47 | updateTimeoutAfterDownloadClick: function(problem) { |
|
51 | updateTimeoutAfterDownloadClick: function(problem) { |
|
48 | CodejomTimeout.timeouts |
|
52 | CodejomTimeout.timeouts |
|
49 | - .filter(function(data) { return data.problem==problem; }) |
|
53 | + .filter(function(data) { return (data!=null) && (data.problem==problem); }) |
|
50 | .each(function(data) { |
|
54 | .each(function(data) { |
|
51 | if(data.timeout==0 || data.timeout==null) { |
|
55 | if(data.timeout==0 || data.timeout==null) { |
|
52 | // TODO: use value from rails app. |
|
56 | // TODO: use value from rails app. |
You need to be logged in to leave comments.
Login now