diff options
author | Aleš Smodiš <aless@guru.si> | 2015-08-26 22:57:59 +0200 |
---|---|---|
committer | Aleš Smodiš <aless@guru.si> | 2015-08-26 22:57:59 +0200 |
commit | ad1451c4d5ca6dfcb31b3559b98f78b318159a09 (patch) | |
tree | 7b64ba8624e68b6d800ffa5c9909fd00494acc3a /js/prolog.js | |
parent | f73d2ccb3b0c9c0f0a05eb9d0b9542481fb18d51 (diff) |
Fixed sending of activities (traces and solutions).
Diffstat (limited to 'js/prolog.js')
-rw-r--r-- | js/prolog.js | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/js/prolog.js b/js/prolog.js index 429ac72..e252393 100644 --- a/js/prolog.js +++ b/js/prolog.js @@ -33,19 +33,20 @@ if (promptMode) { terminal.pause(); codeq.comms.sendQuery({ + 'problem_id': problem_id, 'step': 'run', 'program': editor.getDoc().getValue(), 'query': command, - 'problem_id': problem_id, 'trace': activityHandler.addAndPurge({'typ': 'slv', 'qry': command}) - }).then(tcs, tcf).done(); + }, problem_id).then(tcs, tcf).done(); } else { // not in prompt mode -- we should never land here, but handle it anyway codeq.comms.sendQuery({ + 'problem_id': problem_id, 'step': 'end', 'trace': activityHandler.addAndPurge({'typ': 'stp'}) - }).then(tcs, tcf).done(); + }, problem_id).then(tcs, tcf).done(); } }, { 'history': true, @@ -63,17 +64,19 @@ // space or semicolon -> show next answer event.which = 59; // semicolon codeq.comms.sendQuery({ + 'problem_id': problem_id, 'step': 'next', 'trace': activityHandler.addAndPurge({'typ': 'nxt'}) - }).then(tcs, tcf).done(); + }, problem_id).then(tcs, tcf).done(); } else { // everything else: stop searching for answers event.which = 46; // full stop codeq.comms.sendQuery({ + 'problem_id': problem_id, 'step': 'end', 'trace': activityHandler.addAndPurge({'typ': 'stp'}) - }).then(tcs, tcf).done(); + }, problem_id).then(tcs, tcf).done(); } } }); |