summaryrefslogtreecommitdiff
path: root/yaksh/static
diff options
context:
space:
mode:
authorprathamesh2017-12-05 19:38:21 +0530
committerprathamesh2017-12-05 19:38:21 +0530
commitd33e622b8790d81c80eea2305ab7a2989c21b156 (patch)
tree9dc3d84df3f955a200f7182ed9d0067e8c138f5f /yaksh/static
parent06cc3dc5d3671ca24fc412b6078906a582b83e98 (diff)
parentd2eb978e3ca51914b16655403bd74cc84d4eab28 (diff)
downloadonline_test-d33e622b8790d81c80eea2305ab7a2989c21b156.tar.gz
online_test-d33e622b8790d81c80eea2305ab7a2989c21b156.tar.bz2
online_test-d33e622b8790d81c80eea2305ab7a2989c21b156.zip
Merge branch 'yaksh_video_lessons' of https://github.com/FOSSEE/online_test into yaksh_video_lessons
Diffstat (limited to 'yaksh/static')
-rw-r--r--yaksh/static/yaksh/css/exam.css2
-rw-r--r--yaksh/static/yaksh/js/requesthandler.js25
2 files changed, 23 insertions, 4 deletions
diff --git a/yaksh/static/yaksh/css/exam.css b/yaksh/static/yaksh/css/exam.css
index ec48a14..7d10629 100644
--- a/yaksh/static/yaksh/css/exam.css
+++ b/yaksh/static/yaksh/css/exam.css
@@ -4,4 +4,4 @@ table td, table th { border: black solid 1px !important;
}
#stdio, #assertion {
table-layout: fixed
-} \ No newline at end of file
+}
diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js
index 9749676..0663a55 100644
--- a/yaksh/static/yaksh/js/requesthandler.js
+++ b/yaksh/static/yaksh/js/requesthandler.js
@@ -53,16 +53,35 @@ function response_handler(method_type, content_type, data, uid){
} else if(content_type.indexOf("application/json") !== -1) {
res = JSON.parse(data);
request_status = res.status;
- if(method_type === "POST") {
- uid = res.uid;
+ if (request_status){
+ if(method_type === "POST") {
+ uid = res.uid;
+ }
+ check_state(request_status, uid);
+ }
+ else{
+ unlock_screen();
+ if ($("#notification")){
+ $("#notification").toggle();
+ }
+
+ var error_output = document.getElementById("error_panel");
+ error_output.innerHTML = res.error;
+ focus_on_error(error_output);
}
- check_state(request_status, uid);
} else {
reset_values();
unlock_screen();
}
}
+function focus_on_error(ele){
+ if (ele) {
+ ele.scrollIntoView(true);
+ window.scrollBy(0, -15);
+ }
+ }
+
function ajax_check_code(url, method_type, data_type, data, uid) {
$.ajax({
method: method_type,