summaryrefslogtreecommitdiff
path: root/js/codeq/prolog.js
diff options
context:
space:
mode:
authorMarko Pušnik <marko.pusnik@guru.si>2015-10-05 19:59:21 +0200
committerMarko Pušnik <marko.pusnik@guru.si>2015-10-05 19:59:21 +0200
commite79eb3693220430ecbe2cac68187d525cf6474a3 (patch)
tree44e3008157b30d22f1bc95dab33168fdce252d46 /js/codeq/prolog.js
parent2f415bc811f7378091bd2285e9e822cb39eed3e6 (diff)
parent8f35e1e3c2ffc08b17cf76f8cf1d4944c20af440 (diff)
Merge branch 'master' of ssh://212.235.189.51:22122/codeq-web
Diffstat (limited to 'js/codeq/prolog.js')
-rw-r--r--js/codeq/prolog.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js
index 2aeede4..ce1865a 100644
--- a/js/codeq/prolog.js
+++ b/js/codeq/prolog.js
@@ -166,7 +166,7 @@
'step': 'run',
'program': editor.getDoc().getValue(),
'query': command,
- 'trace': activityHandler.addAndPurge({'typ': 'slv', 'qry': command})
+ 'trace': activityHandler.addAndPurge({'typ': 'prolog_solve', 'query': command})
}, problem_id).then(tcs, tcf);
}
else {
@@ -176,7 +176,7 @@
return codeq.comms.sendQuery({
'problem_id': problem_id,
'step': 'next',
- 'trace': activityHandler.addAndPurge({'typ': 'nxt'})
+ 'trace': activityHandler.addAndPurge({'typ': 'prolog_next'})
}, problem_id).then(tcs, tcf);
}
else {
@@ -185,10 +185,9 @@
return codeq.comms.sendQuery({
'problem_id': problem_id,
'step': 'end',
- 'trace': activityHandler.addAndPurge({'typ': 'stp'})
+ 'trace': activityHandler.addAndPurge({'typ': 'prolog_end'})
}, problem_id).then(tcs, tcf);
}
-
}
};
@@ -240,6 +239,7 @@
});
jqBtnPlan.on('click', function () {
+ activityHandler.queueTrace({'typ': 'plan'});
if (!hinter.planNext()) {
jqBtnPlan.prop('disabled', true).blur();
}
@@ -255,6 +255,7 @@
})
.then(function (data) {
if (data.code === 0) {
+ activityHandler.queueTrace({'typ': 'hint', 'feedback': data.hints});
hinter.handle(data.hints);
}
else {
@@ -279,6 +280,7 @@
})
.then(function (data) {
if (data.code === 0) {
+ activityHandler.queueTrace({'typ': 'test', 'feedback': data.hints});
hinter.handle(data.hints);
}
else {
@@ -294,6 +296,11 @@
});
codeq.comms.loadProblem(problemDef.id).done();
+ activityHandler.queueTrace({
+ 'typ': 'open',
+ 'time': Date.now(),
+ 'content': editor.getDoc().getValue()
+ });
return {
destroy: function () {
@@ -301,6 +308,7 @@
$('#screen_prolog .title').text('');//empty the title text
jqAllButtons.off();
editor.off('change');
+ activityHandler.queueTrace({'typ': 'close'});
activityHandler.flush();
hinter.destroy();
terminal.destroy();