diff options
Diffstat (limited to 'js/prolog.js')
-rw-r--r-- | js/prolog.js | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/js/prolog.js b/js/prolog.js index 1082392..ecec0f3 100644 --- a/js/prolog.js +++ b/js/prolog.js @@ -6,10 +6,8 @@ // a constant var firstCharacterPos = {'line': 0, 'ch': 0}; - //codeq.makePrologTerminalHandler = function (jqConsole, editor, problem_id, activityHandler) { var makePrologTerminalHandler = function (jqConsole, editor, problem_id, activityHandler) { var promptMode = true, // default: query composition; alternative: query result browsing - manualStop = false, // if the user stopped showing next answers (false) or if there are no more answers (true) terminal = codeq.makeConsole(jqConsole, { 'greeting': 'CodeQ Prolog terminal proxy' }), @@ -26,7 +24,7 @@ } if (promptMode) { terminal.setLineBuffered(); - terminal.append(manualStop ? '?- ' : '.\n?- ', 'output'); + terminal.append('.\n?- ', 'output'); } }, tcf = function terminalCommandFailed (error) { @@ -51,7 +49,6 @@ terminal.onInput = function (command) { if (promptMode) { promptMode = false; - manualStop = false; terminal.setNotBuffered(); return codeq.comms.sendQuery({ 'problem_id': problem_id, @@ -73,7 +70,6 @@ } else { // stop searching for answers - manualStop = true; return codeq.comms.sendQuery({ 'problem_id': problem_id, 'step': 'end', @@ -148,7 +144,7 @@ jqConsole = $('#console'), jqHints = $('#info'), editor = CodeMirror(jqEditor[0], { cursorHeight: 0.85, lineNumbers: true, matchBrackets: true }), - activityHandler = codeq.makeActivityHandler(editor, problem.id), + activityHandler = makeActivityHandler(editor, problem.id), terminal = makePrologTerminalHandler(jqConsole, editor, problem.id, activityHandler), hinter = codeq.makeHinter(jqHints, jqEditor, editor, problem.hint); |