From 8f35e1e3c2ffc08b17cf76f8cf1d4944c20af440 Mon Sep 17 00:00:00 2001 From: Timotej Lazar Date: Mon, 5 Oct 2015 19:21:05 +0200 Subject: Save current program in trace with each 'open' action So we can resynchronize if something goes wrong. --- js/codeq/prolog.js | 6 +++++- js/codeq/python.js | 6 +++++- js/codeq/robot.js | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'js/codeq') 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 () { -- cgit v1.2.1