diff options
author | Timotej Lazar <timotej.lazar@araneo.org> | 2015-10-05 19:21:05 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@araneo.org> | 2015-10-05 19:21:05 +0200 |
commit | 8f35e1e3c2ffc08b17cf76f8cf1d4944c20af440 (patch) | |
tree | e8d85aed4766af0502736e2c705fb6b39dff2586 /js/codeq | |
parent | d2150cf0ed43abc8e496e9a95013028325057976 (diff) |
Save current program in trace with each 'open' action
So we can resynchronize if something goes wrong.
Diffstat (limited to 'js/codeq')
-rw-r--r-- | js/codeq/prolog.js | 6 | ||||
-rw-r--r-- | js/codeq/python.js | 6 | ||||
-rw-r--r-- | js/codeq/robot.js | 6 |
3 files changed, 15 insertions, 3 deletions
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js index 69523b0..ce1865a 100644 --- a/js/codeq/prolog.js +++ b/js/codeq/prolog.js @@ -296,7 +296,11 @@ }); codeq.comms.loadProblem(problemDef.id).done(); - activityHandler.queueTrace({'typ': 'open', 'time': Date.now()}); + activityHandler.queueTrace({ + 'typ': 'open', + 'time': Date.now(), + 'content': editor.getDoc().getValue() + }); return { destroy: function () { diff --git a/js/codeq/python.js b/js/codeq/python.js index 236d947..c3a76b9 100644 --- a/js/codeq/python.js +++ b/js/codeq/python.js @@ -264,7 +264,11 @@ }); codeq.comms.loadProblem(problemDef.id).done(); - activityHandler.queueTrace({'typ': 'open', 'time': Date.now()}); + activityHandler.queueTrace({ + 'typ': 'open', + 'time': Date.now(), + 'content': editor.getDoc().getValue() + }); return { destroy: function () { diff --git a/js/codeq/robot.js b/js/codeq/robot.js index c716be8..5d86559 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -231,7 +231,11 @@ }); codeq.comms.loadProblem(problemDef.id).done(); - activityHandler.queueTrace({'typ': 'open', 'time': Date.now()}); + activityHandler.queueTrace({ + 'typ': 'open', + 'time': Date.now(), + 'content': editor.getDoc().getValue() + }); return { destroy: function () { |