diff options
author | prathamesh | 2017-09-08 17:41:14 +0530 |
---|---|---|
committer | prathamesh | 2017-09-08 17:41:14 +0530 |
commit | cc7fce05eaf48e6662b2f37f088591627f12131a (patch) | |
tree | 2a6ba8a9e2c4a08aaf608f36ca4619e5dc1b5e57 /yaksh | |
parent | ad020f9039e33fc6c29e9f0e1de8fd56c2f78406 (diff) | |
download | online_test-cc7fce05eaf48e6662b2f37f088591627f12131a.tar.gz online_test-cc7fce05eaf48e6662b2f37f088591627f12131a.tar.bz2 online_test-cc7fce05eaf48e6662b2f37f088591627f12131a.zip |
Modifications as per comments on PR - II
Diffstat (limited to 'yaksh')
-rw-r--r-- | yaksh/static/yaksh/js/requesthandler.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/yaksh/static/yaksh/js/requesthandler.js b/yaksh/static/yaksh/js/requesthandler.js index 73d0405..9fcf5b6 100644 --- a/yaksh/static/yaksh/js/requesthandler.js +++ b/yaksh/static/yaksh/js/requesthandler.js @@ -1,25 +1,22 @@ request_status = "initial"; count = 0; - -function submitRequest(){ - document.forms["code"].submit(); -} +MAX_COUNT = 14 function reset_values() { request_status = "initial"; count = 0; } function check_state(state, uid) { - if ((state == "running" || state == "not started") && count < 7) { + if ((state == "running" || state == "not started") && count < MAX_COUNT) { count++; setTimeout(function() {get_result(uid);}, 2000); } else if (state == "unknown") { reset_values(); - notify("Request timeout. Try again later"); + notify("Request timeout. Try again later."); unlock_screen(); } else { reset_values() - notify("Please try again"); + notify("Please try again."); unlock_screen(); } } @@ -40,7 +37,7 @@ function unlock_screen() { } function get_result(uid){ - var url = "/exam/get_result/"+uid+"/"; + var url = "/exam/get_result/" + uid + "/"; ajax_check_code(url, "GET", "html", null, uid) } |