summaryrefslogtreecommitdiff
path: root/yaksh/xmlrpc_clients.py
diff options
context:
space:
mode:
authorprathamesh2016-11-17 13:58:51 +0530
committerprathamesh2016-11-17 13:58:51 +0530
commit93b16753ded5f3ef07187e9413c94bd52f2e77f7 (patch)
treef137a0fd2a3036c5a6e87d323d8d14ee3d480c0b /yaksh/xmlrpc_clients.py
parent6ac9e99453543e6a5533f5ab77c7db3c08cc0cf9 (diff)
parentaa6ed71496c4a36faed9b42104c8426345bdc2e3 (diff)
downloadonline_test-93b16753ded5f3ef07187e9413c94bd52f2e77f7.tar.gz
online_test-93b16753ded5f3ef07187e9413c94bd52f2e77f7.tar.bz2
online_test-93b16753ded5f3ef07187e9413c94bd52f2e77f7.zip
Merge branch 'master' of https://github.com/FOSSEE/online_test into student-interface
Resolved Conflicts: yaksh/templates/yaksh/question.html Added testarea back for now.
Diffstat (limited to 'yaksh/xmlrpc_clients.py')
-rw-r--r--yaksh/xmlrpc_clients.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/yaksh/xmlrpc_clients.py b/yaksh/xmlrpc_clients.py
index 4da70dd..bb8260d 100644
--- a/yaksh/xmlrpc_clients.py
+++ b/yaksh/xmlrpc_clients.py
@@ -55,14 +55,21 @@ class CodeServerProxy(object):
Returns
-------
- A json string of a dict: {success: success, err: error message}.
+ A json string of a dict containing:
+ {"success": success, "weight": weight, "error": error message}
+
+ success - Boolean, indicating if code was executed successfully, correctly
+ weight - Float, indicating total weight of all successful test cases
+ error - String, error message if success is false
"""
try:
server = self._get_server()
result = server.check_code(language, test_case_type, json_data, user_dir)
except ConnectionError:
- result = json.dumps({'success': False, 'error': 'Unable to connect to any code servers!'})
+ result = json.dumps({'success': False,
+ 'weight': 0.0,
+ 'error': 'Unable to connect to any code servers!'})
return result
def _get_server(self):