summaryrefslogtreecommitdiff
path: root/yaksh/views.py
diff options
context:
space:
mode:
authorprathamesh2017-08-14 14:51:39 +0530
committerprathamesh2017-08-14 14:51:39 +0530
commit49615e5a24ecfdd0b22bae080e7f9bb2507bbfd7 (patch)
treedf6c5d1a56376a92c2c8aa893c4c3b3f2dff52d4 /yaksh/views.py
parentce995e06e3509a1340061c51dfa08a65c69eef66 (diff)
downloadonline_test-49615e5a24ecfdd0b22bae080e7f9bb2507bbfd7.tar.gz
online_test-49615e5a24ecfdd0b22bae080e7f9bb2507bbfd7.tar.bz2
online_test-49615e5a24ecfdd0b22bae080e7f9bb2507bbfd7.zip
To handle unknown status response from code server
Diffstat (limited to 'yaksh/views.py')
-rw-r--r--yaksh/views.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yaksh/views.py b/yaksh/views.py
index f6243a7..0e9835d 100644
--- a/yaksh/views.py
+++ b/yaksh/views.py
@@ -562,12 +562,13 @@ def check(request, q_id, attempt_num=None, questionpaper_id=None):
@csrf_exempt
def get_results(request, uid):
+ result = {}
url = 'http://localhost:%s' % SERVER_POOL_PORT
result_state = get_result(url, uid)
- result = json.loads(result_state.get('result'))
- next_question, error_message, paper = _update_paper(request, uid, result)
result['status'] = result_state.get('status')
- if result['status']== 'done':
+ if result['status'] == 'done':
+ result = json.loads(result_state.get('result'))
+ next_question, error_message, paper = _update_paper(request, uid, result)
return show_question(request, next_question, paper, error_message)
return JsonResponse(result)