diff options
author | adityacp | 2018-04-13 12:17:29 +0530 |
---|---|---|
committer | adityacp | 2018-04-13 12:17:29 +0530 |
commit | 575da538337da6afb23cc159870853b6457797d3 (patch) | |
tree | fbf75cd5a5dfe701005dd0571e92e74f2a87163e /yaksh/static | |
parent | a3e540aa209be57318de6c3e2548c56e68fdeded (diff) | |
download | online_test-575da538337da6afb23cc159870853b6457797d3.tar.gz online_test-575da538337da6afb23cc159870853b6457797d3.tar.bz2 online_test-575da538337da6afb23cc159870853b6457797d3.zip |
Change in python test, grader and request handler
- Add try except in grader to get exceptions for python stdio and python assertion evaluation
- Add additional tests
- Add condition in request handler to avoid error if codemirror is not instantiated
Diffstat (limited to 'yaksh/static')
-rw-r--r-- | yaksh/static/yaksh/js/requesthandler.js | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js index f858317..952de3a 100644 --- a/yaksh/static/yaksh/js/requesthandler.js +++ b/yaksh/static/yaksh/js/requesthandler.js @@ -75,21 +75,23 @@ function response_handler(method_type, content_type, data, uid){ var error_output = document.getElementById("error_panel"); error_output.innerHTML = res.error; focus_on_error(error_output); - err_lineno = $("#err_lineno").val(); - if(marker){ - marker.clear(); - } - if(err_lineno){ - var lineno = parseInt(err_lineno) - 1; - var editor = global_editor.editor; - var line_length = editor.getLine(lineno).length; - marker = editor.markText({line: lineno, ch: 0}, {line: lineno, ch: line_length}, - {className: "activeline", clearOnEnter:true}); - } - else{ + if(global_editor.editor){ + err_lineno = $("#err_lineno").val(); if(marker){ marker.clear(); } + if(err_lineno){ + var lineno = parseInt(err_lineno) - 1; + var editor = global_editor.editor; + var line_length = editor.getLine(lineno).length; + marker = editor.markText({line: lineno, ch: 0}, {line: lineno, ch: line_length}, + {className: "activeline", clearOnEnter:true}); + } + else{ + if(marker){ + marker.clear(); + } + } } } } else { |