summaryrefslogtreecommitdiff
path: root/js/codeq/python.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/codeq/python.js')
-rw-r--r--js/codeq/python.js34
1 files changed, 2 insertions, 32 deletions
diff --git a/js/codeq/python.js b/js/codeq/python.js
index 10032e8..f2b0184 100644
--- a/js/codeq/python.js
+++ b/js/codeq/python.js
@@ -35,11 +35,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
jqAllQuadrants = jqDescription.add(jqCode).add(jqConsole).add(jqInfo), // all the quadrants
// buttons
jqBtnPlan = jqScreen.find('.btn-plan'),
- jqBtnHint = jqScreen.find('.btn-hint').ladda(),
jqBtnTest = jqScreen.find('.btn-test').ladda(),
jqBtnRun = jqScreen.find('.btn-run'),
jqBtnStop = jqScreen.find('.btn-stop'),
- jqInfoButtons = jqBtnPlan.add(jqBtnHint).add(jqBtnTest), // all info-focusing buttons
+ jqInfoButtons = jqBtnPlan.add(jqBtnTest), // all info-focusing buttons
jqAllButtons = jqInfoButtons.add(jqBtnRun).add(jqBtnStop), // all buttons
// misc
currentSubState = null,
@@ -208,7 +207,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
}),
activityHandler = codeq.makeActivityHandler(editor, problemDef.id),
terminal = makePythonTerminalHandler(jqTerminal, editor, problemDef.id, activityHandler),
- hinter = codeq.makeHinter(jqHints, jqEditor, editor, 'python_hints', problemDef, commonDef),
+ hinter = codeq.makeHinter(jqHints, jqEditor, editor, 'python_hints', problemDef, commonDef, activityHandler),
commError = function (error) {
alert(error);
};
@@ -236,39 +235,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
});
jqBtnPlan.on('click', function () {
- activityHandler.queueTrace({'typ': 'plan'});
if (!hinter.planNext()) {
jqBtnPlan.prop('disabled', true).blur();
}
});
- jqBtnHint.on('click', function () {
- editor.setOption('readOnly', true);
- jqBtnTest.prop('disabled', true);
- jqBtnHint.ladda('start');
- codeq.comms.sendHint({
- 'program': editor.getDoc().getValue(),
- 'problem_id': problemDef.id
- })
- .then(function (data) {
- if (data.code === 0) {
- activityHandler.queueTrace({'typ': 'hint', 'feedback': data.hints});
- hinter.handle(data.hints);
- }
- else {
- terminal.append('error: ' + data.message);
- }
- })
- .fail(commError)
- .fin(function () {
- editor.setOption('readOnly', false);
- jqBtnHint.ladda('stop');
- jqBtnTest.prop('disabled', false);
- })
- .done();
- });
jqBtnTest.on('click', function () {
editor.setOption('readOnly', true);
- jqBtnHint.prop('disabled', true);
jqBtnTest.ladda('start');
codeq.comms.sendTest({
'program': editor.getDoc().getValue(),
@@ -276,7 +248,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
})
.then(function (data) {
if (data.code === 0) {
- activityHandler.queueTrace({'typ': 'test', 'feedback': data.hints});
hinter.handle(data.hints);
}
else {
@@ -287,7 +258,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
.fin(function () {
editor.setOption('readOnly', false);
jqBtnTest.ladda('stop');
- jqBtnHint.prop('disabled', false);
})
.done();
});